Question: How to get a list of aligned read and reference positions using samtools
0
gravatar for Aref.Ariyapour
6 months ago by
Aref.Ariyapour0 wrote:

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

htslib C c++ api samtools • 181 views
ADD COMMENTlink written 6 months ago by Aref.Ariyapour0

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

ADD REPLYlink written 6 months ago by geek_y11k

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 REPLYlink written 6 months ago by Aref.Ariyapour0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1008 users visited in the last hour