This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Mean Position Of Variant Within Reads - Samtools

Hi all,

I am very new to this forum and also new to do variant calling. I am using samtools mpileup | bcftools | vcfutils.pl commands for this.

I need to find the mean position of variant (or positions of the variant) within supporting reads. Does anyone know how to obtain this?

Thanks a lot in advance for any of your comments and suggestions.

-AS

samtools variant-calling mpileup

2 answers

You can use that java program I wrote for biostars:

position of mismatches per read from a sam/bam file

and extract the positions of the mismatch:

<M read-index="13" read-base="G" ref-index="15" ref-base="A"/>

before calculating the mean value "read-index" of the positions.

Hi Pierre,

After reading a lot and testing , I think I better understand your answer. Thank you very much. In that case, getting the tail distance would be an approximation, right? Thanks again -AS

Hi Pierre,

Thank you for the quick reply.

But taking the mismatches from the bam/sam file is not really an 'snp call', right? From, what I understood, the snp call is made later with bcftools command producing 'bcf/vcf 'files. In that case, isn't the mismatches be taken from bcf/vcf files? Please correct me if I am wrong?

Thanks -AS

Log in to answer this question.