Thanks, will try it out!
• 1 views
•
link
I'm interested in selecting only uniquely mapped reads from Hisat2 alignment bam files. I think I can do this using the NH tag after reading the post below. I can write a python script to do this. But I'm wondering if there is any existing tools that can do this? i.e. select to output certain alignments if their tag is certain value? in this case, NH:i:1
using samjs https://github.com/lindenb/jvarkit/wiki/SamJS
java -jar dist/samjs.jar -o out.bam -e 'record.getIntegerAttribute("NH")!=null && record.getIntegerAttribute("NH").intValue()==1' input.bam
Thanks, will try it out!
Log in to answer this question.