This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Positions of variant in certain depth

Hello. I have a SAM file and a referance genome. I'm trying to get a list of all the positions that in the referance it has A and in the alternative is has C, with total depth of at least 20X.

I don't need to do variant call, only get the list of the positions.

I'm a bit lost in this, I'll be happy for help solving it.

Thank you.

sam variant

Thank you for the quick reply! How can I know what is the depth of each allele?

1 answer

samtools mpileup --reference  ref.fa in.bam  |\
awk -F '\t' '(toupper($3)=="A" && $4>20 && index(toupper($5),"C")>0 )' | cut -f1,2

Thank you for the quick reply! How can I know what is the depth of each allele?

Log in to answer this question.