How to get a list of aligned read and reference positions using samtools
0
0
Entering edit mode
4.0 years ago

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 api htslib Cpp c • 1.0k views
ADD COMMENT
0
Entering edit mode

samtools view in.bam “chr1:100-1000”

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

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