Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • kjaja
    Member
    • Aug 2011
    • 58

    coverage calculation for exome data

    Hi,

    I am looking to calculate what percentage of all target positions achieved a coverage of at least 50x? can this be done?


    Appreciate your help
  • swbarnes2
    Senior Member
    • May 2008
    • 910

    #2
    Sure. Use BEDTools.

    You'll also want a .bed file of target regions.

    Comment

    • kjaja
      Member
      • Aug 2011
      • 58

      #3
      Hi

      Below is a sample output for the coverage file from bedtools, the coverage ranges from 0 to 8 for the same region (column 5), so I want to see what percentage of the exome was covered by at least 10x. it seems that for each region, I have to find the max number of bases covered by at least 10 x. is there an easy way to do this?


      chr1 176160618 176161057 Spna1-41 0 8 439 0.0182232
      chr1 176160618 176161057 Spna1-41 1 59 439 0.1343964
      chr1 176160618 176161057 Spna1-41 2 92 439 0.2095672
      chr1 176160618 176161057 Spna1-41 3 103 439 0.2346241
      chr1 176160618 176161057 Spna1-41 4 55 439 0.1252847
      chr1 176160618 176161057 Spna1-41 5 21 439 0.0478360
      chr1 176160618 176161057 Spna1-41 6 49 439 0.1116173
      chr1 176160618 176161057 Spna1-41 7 27 439 0.0615034
      chr1 176160618 176161057 Spna1-41 8 25 439 0.0569476

      Comment

      • nexgengirl
        Member
        • Apr 2010
        • 31

        #4
        Picard's hybridization statistics tool could be used. Description at the link below:

        Comment

        • rbagnall
          Member
          • Jun 2010
          • 34

          #5
          I also use Bedtools. You need coverageBed with the -d option to show the coverage per base...

          Code:
          samtools view -b bamfile.bam | coverageBed -abam stdin -b intervals.bed -d > per_base_coverage.txt
          The file can be large as it has one row per base of the exome, but you can firstly use it to count the total number of bases in your exome if you are unsure..

          Code:
          wc -l per_base_coverage.txt
          Then count the number of lines (i.e. bases) having at least 50 fold coverage..

          Code:
          awk '{FS="\t"}{if($5 > "49") print $0}' per_base_coverage.txt | wc -l
          It works for me, but there are could be quicker ways.
          Last edited by rbagnall; 02-21-2013, 02:55 PM.

          Comment

          • kjaja
            Member
            • Aug 2011
            • 58

            #6
            THANKS! but there seem to be syntax error in the last code awk command? I am not sure how to fix it?

            Comment

            • rbagnall
              Member
              • Jun 2010
              • 34

              #7
              Hi kjaja,

              Sorry, there was an extra close parenthesis ) in the awk command. I have corrected it.

              Comment

              • cuiya
                Junior Member
                • Mar 2013
                • 1

                #8
                right?

                Hi,rbagnall
                your answer is useful. but the last code may be "awk '{FS="\t"}{if($5 > 49) print $0}' per_base_coverage.txt | wc -l". right?

                Comment

                • woodydon
                  Member
                  • Jan 2010
                  • 52

                  #9
                  Sorry I was wrong...

                  Woody
                  Last edited by woodydon; 03-19-2014, 11:49 PM.

                  Comment

                  Latest Articles

                  Collapse

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by SEQadmin2, 06-05-2026, 10:09 AM
                  0 responses
                  13 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-04-2026, 08:59 AM
                  0 responses
                  24 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-02-2026, 12:03 PM
                  0 responses
                  28 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-02-2026, 11:40 AM
                  0 responses
                  22 views
                  0 reactions
                  Last Post SEQadmin2  
                  Working...