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
              Genetic Variation in Immunogenetics and Antibody Diversity
              by seqadmin



              The field of immunogenetics explores how genetic variations influence immune responses and susceptibility to disease. In a recent SEQanswers webinar, Oscar Rodriguez, Ph.D., Postdoctoral Researcher at the University of Louisville, and Ruben Martínez Barricarte, Ph.D., Assistant Professor of Medicine at Vanderbilt University, shared recent advancements in immunogenetics. This article discusses their research on genetic variation in antibody loci, antibody production processes,...
              11-06-2024, 07:24 PM
            • seqadmin
              Choosing Between NGS and qPCR
              by seqadmin



              Next-generation sequencing (NGS) and quantitative polymerase chain reaction (qPCR) are essential techniques for investigating the genome, transcriptome, and epigenome. In many cases, choosing the appropriate technique is straightforward, but in others, it can be more challenging to determine the most effective option. A simple distinction is that smaller, more focused projects are typically better suited for qPCR, while larger, more complex datasets benefit from NGS. However,...
              10-18-2024, 07:11 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, Today, 11:09 AM
            0 responses
            23 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, Today, 06:13 AM
            0 responses
            20 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 11-01-2024, 06:09 AM
            0 responses
            30 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 10-30-2024, 05:31 AM
            0 responses
            21 views
            0 likes
            Last Post seqadmin  
            Working...
            X