Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • efoss
    Member
    • Jul 2011
    • 98

    bedtools coverage is inaccurate

    I am using bedtools to calculate coverage in an RNA-seq bam file. I get screwy readings when it encounters a gap where there are no reads. Rather than filling it in with zeros, it takes a value that is somewhere near the last read and uses that value to fill across the gap. For example, I just looked in IGV at a suspicious area in a bam file. IGV shows readcounts of 11, 11, 10, 10, 10, 9, 9, 9, 9, 1 and then a bunch of zeros. bedtools, on the other hand, lists the same numbers except that when it comes to the final 1, it says 7, and then the very long list of zeros is instead a very long list of 7s. Can anyone suggest a solution? The code I used is pasted below. (The last little thing where I pipe results to grep is to output only lines with non-zero read counts. Perhaps that's where I'm screwing up, but I don't think so.)

    Thanks.

    Eric



    genomeCoverageBed -d -split -ibam input.bam -g /home/efoss/gene_databases/dot_genome_files/g1k_v37.genome | grep -v -P "\S+\t\S+\t0" > output.txt
    Last edited by efoss; 09-19-2013, 11:48 AM.
  • BAMseek
    Senior Member
    • Apr 2011
    • 124

    #2
    Hey Eric,

    My guess would be that if a read is split (such as spanning a splice junction), then that read may count towards the coverage for the entire interval, even the skipped bases. This link seems to talk about a similar issue. Looks like the solution in the post is to split those reads and try coverage again.

    (Edit: although looks like you did use the -split argument so maybe it is a different issue).

    Justin
    Last edited by BAMseek; 09-19-2013, 10:16 PM.

    Comment

    • kokonech
      Curious Character
      • Sep 2010
      • 13

      #3
      Hi!

      Make sure the BAM file is sorted by coordinate and the splitted alignment is defined by N cigar code (true for tophat by default).

      Also you might check some alternative ways to calculate coverage, for example using coverageBed and intersection with annotation file:
      This post is actually inspired by the discussion on the Qualimap google groups . Assume we need to calculate mean coverage inside of the ...

      Comment

      • efoss
        Member
        • Jul 2011
        • 98

        #4
        Hi kokonech,

        Thanks for the suggestion. I finally figured it out - there was a version of bedtools that had this as a known bug. I updated to the latest version and the problem went away.

        I bookmarked your site. It looks very helpful.

        Best wishes,

        Eric

        Comment

        • SylvainL
          Senior Member
          • Feb 2012
          • 180

          #5
          Hi efoss,

          can you tell us which version of bedtools you were using before?

          thanks

          Comment

          • efoss
            Member
            • Jul 2011
            • 98

            #6
            Hi SylvainL,

            I'm afraid I don't know which version it was. I think it was installed on our system in 2011. The one I'm using now is 2.17.0.

            Eric

            Comment

            • Nino
              Member
              • Mar 2013
              • 27

              #7
              Hey Guys,

              I am getting this weird error for my hg19.fa genome file.

              this is my command line argument:
              genomeCoverageBed -d -i Sample_23430_B14_T.sorted.dedup.rg.resorted.realigned.bed -g /pbtech_mounts/fdlab_store003/fdlab/genomes/human/hg19/indexes/bwa/genome/hg19.fa 1> Sample_23430_B14_T.sorted.dedup.rg.resorted.realigned.coverage

              and I get this error:
              Less than the req'd two fields were encountered in the genome file (/pbtech_mounts/fdlab_store003/fdlab/genomes/human/hg19/indexes/bwa/genome/hg19.fa) at line 1. Exiting.

              anyone know why, I can't seem to figure it out.

              Thanks!,
              Nino

              Comment

              Latest Articles

              Collapse

              • mylaser
                Reply to Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                by mylaser
                Kheloyaar: The Complete Guide to Kheloyaar Loginand Kheloyaar ID
                The online gaming industry has transformed the way people enjoy digital entertainment. As technology continues to improve, players are looking for platforms that offer convenience, security, and a seamless user experience. Kheloyaarhas gained attention among users who value an easy-to-use platform, quick account access, and a simple registration process.
                Whether you're exploring Kheloyaar for the first time or want to understand...
                Today, 09:27 PM
              • SEQadmin2
                Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                by SEQadmin2



                Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                ...
                Today, 11:10 AM
              • SEQadmin2
                Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                by SEQadmin2



                Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                Yesterday, 05:17 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, Today, 10:04 AM
              0 responses
              8 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, Yesterday, 10:08 AM
              0 responses
              7 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-07-2026, 11:05 AM
              0 responses
              10 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-02-2026, 11:08 AM
              0 responses
              31 views
              0 reactions
              Last Post SEQadmin2  
              Working...