Unconfigured Ad

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

    #1

    getting rid of 0 entries in bedTools genomeCoverageBed tool

    I am trying to use genomeCoverageBed in the bedTools suite to find coverage of each base in the human genome from an RNA seq bam file that has been generated with TopHat. The output file gets enormous because all of the positions with 0 hits are included. Is there a way I can get the output file to include only chromosome-coordinate pairs that have non-zero hits? This is the command that I use to generate the output file:


    genomeCoverageBed -ibam bamfile.bam -g human.hg19.genome -d -split > genome_coverage_split_071711_1.txt

    Thanks.

    Eric
  • biznatch
    Senior Member
    • Nov 2010
    • 124

    #2
    So this is basically making a .wig file? Is it a fixedStep (one column) or variableStep (two column) file? If you have a lot of 0's it is probably better to use variableStep. I haven't used bedTools so I don't know if that is an option within that program.
    Last edited by biznatch; 07-17-2011, 08:34 PM.

    Comment

    • dariober
      Senior Member
      • May 2010
      • 311

      #3
      Originally posted by efoss View Post
      I am trying to use genomeCoverageBed in the bedTools suite to find coverage of each base in the human genome from an RNA seq bam file that has been generated with TopHat. The output file gets enormous because all of the positions with 0 hits are included. Is there a way I can get the output file to include only chromosome-coordinate pairs that have non-zero hits? This is the command that I use to generate the output file:


      genomeCoverageBed -ibam bamfile.bam -g human.hg19.genome -d -split > genome_coverage_split_071711_1.txt

      Thanks.

      Eric
      Hi,
      Assuming the BED output looks something like this (where line2 is to be filtered out):
      Code:
      chr1	1	10	line1	1	+
      chr2	100	1000	line2	0	-
      chr3	200	210	line3	10	-
      You could parse the output of genomeCoverageBed with grep:
      Code:
      genomeCoverageBed -ibam bamfile.bam -g human.hg19.genome -d -split | grep -P -v .+?[[:blank:]].+?[[:blank:]].+?[[:blank:]]0[[:blank:]].+? > genome_coverage_split_071711_1.txt
      (Untested... Make sure it does what you want!)

      Dario

      Comment

      • idonaldson
        Member
        • Oct 2009
        • 37

        #4
        Were you using the -d flag (reports coverage for every single base)? I once used:

        awk '$3>0' < in.file > out.file

        This ensures the bedTools output only has coverage greater then 0.

        Comment

        • efoss
          Member
          • Jul 2011
          • 98

          #5
          Thanks very much, all. I'll look in to these solutions.

          Comment

          Latest Articles

          Collapse

          • kinpict.com
            Reply to 16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
            by kinpict.com
            The part about this topic feels surprisingly grounded, and the details on the page is the bit that made me slow down. I’d keep <a href="https://kinpict.com/">ai family photo generator</a> bookmarked for later.
            Today, 06:37 PM
          • SEQadmin2
            16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
            by SEQadmin2





            NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
            10-30-2026, 06:46 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 11-12-2026, 07:59 AM
          0 responses
          28 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 11-05-2026, 09:25 AM
          0 responses
          35 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 11-03-2026, 11:54 AM
          2 responses
          56 views
          0 reactions
          Last Post kinpict.com  
          Started by SEQadmin2, 10-28-2026, 09:57 AM
          0 responses
          175 views
          0 reactions
          Last Post SEQadmin2  
          Working...