Entering edit mode
4.6 years ago
Aref.Ariyapour
•
0
I am trying to convert a python script that manipulates bam files, to C++. However, I couldn't find out how can I get a list of aligned query and reference positions using samtools. I want to get reads from a region and for that, I used this link: htslib C API: getting reads from region
But I cannot find a way in samtools to get the list of aligned query and reference positions. In pysam "get_aligned_pairs" returns this list. How can I extend the code in the link I mentioned to do this in samtools?
Thanks
samtools view in.bam “chr1:100-1000”
Can you please elaborate a bit more? I want to do it in c. In each read inside while loop ("sam_itr_next(in, iter, b)") I want to get the list of pairs.