Question: Nucletotide distribution, at each position, in a .sam/.bam file ?
1
gravatar for remi.maglione
3.3 years ago by
Canada
remi.maglione10 wrote:

Hi,

i'm trying to extract the nucleotide distribution, for each position, from a .sam/.bam file ?!

I don't look for the total depth of coverage (that can be done with GATK or samtools), but the depth of coverage for each nucleotide, at each position in my alignment file (bam/sam/...)

How can i do that ?

Do you know a tools that can do that ?

Thanks in advance for any answer/suggestion,

Rémi

ADD COMMENTlink modified 19 months ago by Zaag620 • written 3.3 years ago by remi.maglione10

duplicate of Coverage In Bam File - Bases And Overall Count

ADD REPLYlink written 3.3 years ago by Pierre Lindenbaum101k
1
gravatar for dariober
3.3 years ago by
dariober8.2k
Glasgow - UK
dariober8.2k wrote:

Have a look at pysamstat executed as:

pysamstats -f ref.fa --type variation_strand aln.bam > aln.var.txt

It will give the count of A, C, G, T, insertions and deletions at each position in the reference (is this what you are after?).

If you want to parse the 5th column of samtools mpileup yourself take care that it contains also the mapping qualities and the sequence of insertions and deletions. So just counting the occurrences of ACTG will give slightly incorrect results (I think the answer Pierre links to has this problem).

ADD COMMENTlink written 3.3 years ago by dariober8.2k
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: 969 users visited in the last hour