pysam read iteration
0
0
Entering edit mode
2.2 years ago
Anst ▴ 40

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 • 350 views
ADD COMMENT

Login before adding your answer.

Traffic: 2613 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