dpryan79 / SE-MEI

Tools for finding mobile element insertions from single-end datasets
GNU General Public License v2.0
23 stars 15 forks source link

how do you print the read name in the fastq output? #1

Closed indapa closed 7 years ago

indapa commented 7 years ago

Very useful program! Thank you making this public. I'm not very familiar to the htslib C library. How do you modify the code to print the name of the soft-clipped read?

fprintf(of, "@%s:%"PRId32"\n", hdr->target_name[b->core.tid], pos);

dpryan79 commented 7 years ago

@indapa Sorry I never replied to this, I didn't see it when you posted. In htslib, you can use bam_get_qname(b) to get the read name.

tjakobi commented 4 years ago

In case anybody finds this and would like to get the read names, simply replace the line:

fprintf(of, "@%s:%"PRId32"\n", hdr->target_name[b->core.tid], pos);

with

fprintf(of, "@%s:%s:%"PRId32"\n", bam_get_qname(b), hdr->target_name[b->core.tid], pos);