Question: Count 0, 5, 20 covered sites in bam
0
gravatar for DVA
5 months ago by
DVA490
United States
DVA490 wrote:

Hello,

I wonder how to use a bam file to learn how many sites are not covered at all, how many are covered >=5 times and 20 times. We got such stats from our sequencing company, but want to see we can do it ourselves as well.

Thank you very much.

bam wgs • 204 views
ADD COMMENTlink modified 5 months ago by Pierre Lindenbaum116k • written 5 months ago by DVA490

Are you looking to get the stats at individual base level or a interval window?

ADD REPLYlink written 5 months ago by genomax62k

Thank you for the comment @genomax, I am looking at individual base level.

ADD REPLYlink written 5 months ago by DVA490
2
gravatar for Pierre Lindenbaum
5 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum116k wrote:
samtools depth -a in.bam | awk '{D=int($3);if(D<5) {D=0;} else if(D<20) {D=5;} else D=20; a[D]++;} END {for(x in a) printf("%s\t%d\n",x,a[x]);}'

5   14484
20  51
0   3771
ADD COMMENTlink written 5 months ago by Pierre Lindenbaum116k
1

Thanks for the help! Appreciate it.

ADD REPLYlink written 5 months ago by DVA490
1
gravatar for Devon Ryan
5 months ago by
Devon Ryan88k
Freiburg, Germany
Devon Ryan88k wrote:

You can get the relevant percentage of the genome with plotCoverage, though picard has some similar tools.

ADD COMMENTlink written 5 months ago by Devon Ryan88k

Thank you very much!

ADD REPLYlink written 5 months ago by DVA490
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2402 users visited in the last hour