This is a test version of Biostars. For the public version, visit https://www.biostars.org.
pysam read iteration

Hello!

I am studying pysam and if have a question: if I have a reference and several reads aligned as will shown below:

pos:      123456789...
ref:      AATTCCGTCGTAGC
read1:    AAT    CGGTC 
read2:     ATTC     TAGC  

How can I get all nucleotides of reads which have 'T' in reference sequence?

I tried to collect all indexes of appearance of 'T' in a list (3,4,9,11) and then iterate pileupread.alignment.query_sequence[index] via collected indexes but it doesn't work since index is out of the range.

reference pysam bam nucleotides

0 answers

No answers yet.

Log in to answer this question.