samfile.pileup How to get reference base

956 views
Skip to first unread message

Dieter

unread,
Oct 10, 2011, 6:04:02 PM10/10/11
to Pysam User group
I am getting started with pysam and I am using pileup to iterate over
the pileupcolumns, get the coverage and the bases in the reads. What
is not immediately clear to me is: How do I get the reference base?

Many thanks in advance.

Andreas

unread,
Oct 17, 2011, 4:00:02 AM10/17/11
to Pysam User group
Hi Dieter,

the reference sequence is not part of a bam/sam file. Hence, it can
not
be got at via a Samfile object.

You will need the sequence and get the base via the position - you can
use pysam.Fastafile to access faidx indexed fasta
files, for example.

Best wishes,
Andreas
Reply all
Reply to author
Forward
0 new messages