pysam: Use read ID to access location
I know the read_ids of my reads, but I want to know, i.e. "chr1:100-120". Therefore I'm trying to access the read from a bam/sam file using the read id but I have not had any luck with pysam so far. Does anyone know how I could do this?
• 2,814 views
•
link
1 answer
You can't do that, you can only iterate over all of the reads and check if they match your read_ids. Note that this is not a limitation of pysam, it's implicitly not meant to work in the BAM and CRAM formats.
• 1 views
•
link
Log in to answer this question.
It's always clearer with an example. Do you want to access the sequence of your read using
chr1:100-120or the possible gene at this position ?Could you detailed this please :