Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Why does samtools idxstats not show the stats

    The ref sequences in my bam file are 1, 2, ...

    idxstats reports get that 0 reads are mapped to each reference.

    Code:
    $ samtools idxstats MyBam.bam
    1	197195432	0	0
    10	129993255	0	0
    11	121843856	0	0
    And yet, the bam file is fine, I can see millions of reads mapped to each reference sequence (with samtools view) and I can run mpileup on it as well. Why would idxstats not work? Any ideas?

    Thanks,
    Gulu
    Kamalakar Gulukota,
    Director,
    Center for Bioinformatics and Computational Biology
    NorthShore University Health System, [email protected]

  • #2
    I'm not sure why it wouldn't work - I never had a problem with it before.

    If you're looking for a workaround you could so something like:
    Code:
    samtools view MyBam.bam | cut -f3 | sort | uniq -c
    Though this will omit the length of the reference.

    I hope this helps!

    Comment


    • #3
      Thank you twaddlac! Yes, I have been doing something like that. Unfortunately I have multiple files and each file has billions of lines and hence my server takes hours per file for this. I thought idxstats might have a fast way. Oh well ...
      Kamalakar Gulukota,
      Director,
      Center for Bioinformatics and Computational Biology
      NorthShore University Health System, [email protected]

      Comment


      • #4
        Try reindexing - 'samtools idxstats' relies on extra fields in the BAI file which are not present in very old BAI files (early versions of 'samtools index' didn't write them).

        Comment


        • #5
          Thank you maubp!

          I reindexed and it worked fine. (The original .bai file was something I downloaded from a public site along with the bam file).
          Kamalakar Gulukota,
          Director,
          Center for Bioinformatics and Computational Biology
          NorthShore University Health System, [email protected]

          Comment


          • #6
            Originally posted by kgulukota View Post
            Thank you maubp!

            I reindexed and it worked fine. (The original .bai file was something I downloaded from a public site along with the bam file).
            Great - can you try contacting the site so they can update their BAI files too?

            Comment

            Latest Articles

            Collapse

            • seqadmin
              Advancing Precision Medicine for Rare Diseases in Children
              by seqadmin




              Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
              12-16-2024, 07:57 AM
            • seqadmin
              Recent Advances in Sequencing Technologies
              by seqadmin



              Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

              Long-Read Sequencing
              Long-read sequencing has seen remarkable advancements,...
              12-02-2024, 01:49 PM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, 12-17-2024, 10:28 AM
            0 responses
            26 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 12-13-2024, 08:24 AM
            0 responses
            42 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 12-12-2024, 07:41 AM
            0 responses
            28 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 12-11-2024, 07:45 AM
            0 responses
            42 views
            0 likes
            Last Post seqadmin  
            Working...
            X