Question: ref and alt allele count from BAM file
gravatar for monaallouba
11 months ago by
monaallouba0 wrote:

Hi All,

I would like to calculate the allele ratio of ref/alt at a specific position. How can I determine the ref and alt counts from the BAM file? (or is it better to extract this info from the VCF?)

Thank you

rna-seq allele_count bam • 516 views
ADD COMMENTlink modified 11 months ago by Vitis2.3k • written 11 months ago by monaallouba0
gravatar for Vitis
11 months ago by
New York
Vitis2.3k wrote:

Both BAM and VCF can be used for this. In VCF, you would be looking for the values in the AD field for each sample. For BAM, you may want to consider using PySAM's pileup engine to query the position and reads stacked at that position. Just be careful with indels when using PySAM, you'll have to add special code to distinguish no coverage and deletions at these positions.

To tap into VCF, use PyVCF

To tap into BAM, use PySAM

ADD COMMENTlink written 11 months ago by Vitis2.3k
Please log in to add an answer.


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