Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Samtools seek like effect.

    Hi,
    I am currently implementing a module in c++ using samtools's c library and I seem to encounter many problems in trying to implement a Seek like effect for the bamfile. I have browse through everything I though would help within samtools without success.

    I am using bam_plp_next and bam_plp_next to do a continuous read of the bamfile but I want to be able to say : Seek(int chrmTid); or something like that and then continue reading from the first available position of this chromosome.

    Every function that access the index file is of the form
    Code:
    bam_iter_t bam_iter_query(const bam_index_t *idx, int tid, int beg, int end);
    where beg and end are positions in this chromosome.

    My question is : Is there a way that I can achieve the described functionality while only providing a tid and a beginning position?

    What I use currently is the above mentionned function which I provide with 0 as beg position and arbitrairy 15000 as end.

  • #2
    You should be able to get the full length of the references from the BAM header (I'm sure there is an API for that), and then you don't have to guess.

    Comment

    Latest Articles

    Collapse

    • seqadmin
      The Impact of AI in Genomic Medicine
      by seqadmin



      Article Coming Soon......
      Today, 02:07 PM
    • seqadmin
      Multiomics Techniques Advancing Disease Research
      by seqadmin


      New and advanced multiomics tools and technologies have opened new avenues of research and markedly enhanced various disciplines such as disease research and precision medicine1. The practice of merging diverse data from various ‘omes increasingly provides a more holistic understanding of biological systems. As Maddison Masaeli, Co-Founder and CEO at Deepcell, aptly noted, “You can't explain biology in its complex form with one modality.”

      A major leap in the field has
      ...
      02-08-2024, 06:33 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, 02-23-2024, 04:11 PM
    0 responses
    31 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 02-21-2024, 08:52 AM
    0 responses
    46 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 02-20-2024, 08:57 AM
    0 responses
    37 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 02-14-2024, 09:19 AM
    0 responses
    63 views
    0 likes
    Last Post seqadmin  
    Working...
    X