Question: Count 0, 5, 20 covered sites in bam
0
gravatar for DVA
9 months ago by
DVA530
United States
DVA530 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 • 260 views
ADD COMMENTlink modified 9 months ago by Pierre Lindenbaum121k • written 9 months ago by DVA530

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

ADD REPLYlink written 9 months ago by genomax69k

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

ADD REPLYlink written 9 months ago by DVA530
2
gravatar for Pierre Lindenbaum
9 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum121k 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 9 months ago by Pierre Lindenbaum121k
1

Thanks for the help! Appreciate it.

ADD REPLYlink written 9 months ago by DVA530
1
gravatar for Devon Ryan
9 months ago by
Devon Ryan91k
Freiburg, Germany
Devon Ryan91k wrote:

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

ADD COMMENTlink written 9 months ago by Devon Ryan91k

Thank you very much!

ADD REPLYlink written 9 months ago by DVA530
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: 1452 users visited in the last hour