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

          • SEQadmin2
            Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
            by SEQadmin2



            Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

            Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
            ...
            10-14-2026, 09:55 AM
          • SEQadmin2
            New Genomics Technologies Take Aim at Long-Standing Limits
            by SEQadmin2


            Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

            We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
            ...
            09-28-2026, 10:25 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 10-22-2026, 11:13 AM
          0 responses
          28 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 10:48 AM
          0 responses
          20 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          38 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          44 views
          0 reactions
          Last Post SEQadmin2  
          Working...