ref and alt allele count from BAM file
1
0
Entering edit mode
5.4 years ago

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 • 2.8k views
ADD COMMENT
0
Entering edit mode
5.4 years ago
Vitis ★ 2.6k

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

https://pyvcf.readthedocs.io/en/latest/

To tap into BAM, use PySAM

https://pysam.readthedocs.io/en/latest/

ADD COMMENT

Login before adding your answer.

Traffic: 1995 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6