Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • papori
    Senior Member
    • Dec 2010
    • 181

    #1

    coverage precentage of the hg19 using bowtie2

    Hi all,
    i am using bowtie2 for mapping WGS reads to hg19.
    I am trying to find out what is the coverage precentage of the hg19 using my reads.
    For example:
    if the genome siae is 300 bases and my reads cover 30 bases, so my genome coverage is 10%.
    i am looking for the 10%...
    Can i know it from bowtie2 output?
    Any ideas?

    Thanks,
    Pap
    Last edited by papori; 12-06-2013, 03:53 AM.
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    While it probably won't give you the gross % value you are looking for "genomecov" from BEDTools would be a good starting point to experiment: http://bedtools.readthedocs.org/en/l...genomecov.html

    Comment

    • jgibbons1
      Senior Member
      • Oct 2009
      • 135

      #3
      If I understand you correctly, you'd like to know the average coverage of your read set. Is that right?

      You may consider using the samtools depth function. This calculates depth for every base of the reference. You can then take the sum of the depth value and divide by non 'N' base pairs in hg19.

      This will give you a quick and dirty estimate.

      samtools depth you.file.bam | awk '{sum=sum+$3} END {print sum}'

      (this will give you the sum of depth values)

      Comment

      • jgibbons1
        Senior Member
        • Oct 2009
        • 135

        #4
        If you just want to know how many reads are covered, you can use the same tool, as it does not report '0' depth values. You can simply subtract "covered" bases from total bases.

        Comment

        • papori
          Senior Member
          • Dec 2010
          • 181

          #5
          Originally posted by jgibbons1 View Post
          If I understand you correctly, you'd like to know the average coverage of your read set. Is that right?

          You may consider using the samtools depth function. This calculates depth for every base of the reference. You can then take the sum of the depth value and divide by non 'N' base pairs in hg19.

          This will give you a quick and dirty estimate.

          samtools depth you.file.bam | awk '{sum=sum+$3} END {print sum}'

          (this will give you the sum of depth values)
          I want to know how many bases from the reference has hit from my reads.
          I dont care from the depth.
          Is it clearer?
          Thanks

          Comment

          • papori
            Senior Member
            • Dec 2010
            • 181

            #6
            Originally posted by GenoMax View Post
            While it probably won't give you the gross % value you are looking for "genomecov" from BEDTools would be a good starting point to experiment: http://bedtools.readthedocs.org/en/l...genomecov.html
            This function is great, but the output is huge!!! more than 2TB per bam file..
            This is to much for my storage
            Any solutions?

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #7
              Originally posted by papori View Post
              This function is great, but the output is huge!!! more than 2TB per bam file..
              This is to much for my storage
              Any solutions?
              Just don't store the output then. If you just want to know how many bases have a read aligning to them, just use the "-d" option and then pipe the output to awk:

              Code:
              bedtools genomecov ...stuff.. | awk '{if($3==0) { nocov+=1;}else{cov+=1}}END{printf("%i have hits and %i do not\n",cov,nocov)}'
              That will occupy no space and be faster since you don't have to write anything to disk.

              Comment

              • papori
                Senior Member
                • Dec 2010
                • 181

                #8
                Originally posted by dpryan View Post
                Just don't store the output then. If you just want to know how many bases have a read aligning to them, just use the "-d" option and then pipe the output to awk:

                Code:
                bedtools genomecov ...stuff.. | awk '{if($3==0) { nocov+=1;}else{cov+=1}}END{printf("%i have hits and %i do not\n",cov,nocov)}'
                That will occupy no space and be faster since you don't have to write anything to disk.
                Is it report 1 for base which have also more than 1 hits?
                I guess yes is the answer, just want to be sure..
                Many Thanks!

                Comment

                • dpryan
                  Devon Ryan
                  • Jul 2011
                  • 3478

                  #9
                  It does. A base with a million reads mapping to it counts the same as another base with only a single read covering it.

                  You'll find awk and the other standard unix tools extremely useful.

                  Comment

                  • papori
                    Senior Member
                    • Dec 2010
                    • 181

                    #10
                    Originally posted by dpryan View Post
                    It does. A base with a million reads mapping to it counts the same as another base with only a single read covering it.

                    You'll find awk and the other standard unix tools extremely useful.
                    Thanks!
                    Very Help

                    Comment

                    • SeqMlife
                      Junior Member
                      • Jul 2013
                      • 3

                      #11
                      Hi papori,
                      I am currently doing something similar to you.
                      Could you share one of the example final output from the code?
                      like cov= ,ncov=?
                      The result I got is extremely huge.
                      879370384 hits and 1984311365 no hits. Not sure if I was doing it right.
                      Thanks for your reply!

                      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, Yesterday, 11:13 AM
                      0 responses
                      19 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, Yesterday, 10:48 AM
                      0 responses
                      18 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 10-15-2026, 10:52 AM
                      0 responses
                      36 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 10-14-2026, 05:39 AM
                      0 responses
                      42 views
                      0 reactions
                      Last Post SEQadmin2  
                      Working...