Is there a tools to select alignment from BAM files with particular tag value?
1
0
Entering edit mode
8.3 years ago
epigene ▴ 590

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

How to remove non-unique mapping reads with Hisat?

bam • 2.0k views
ADD COMMENT
1
Entering edit mode
8.3 years ago

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
ADD COMMENT
0
Entering edit mode

Thanks, will try it out!

ADD REPLY

Login before adding your answer.

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