Biostar Beta. Not for public use.
Is there a tools to select alignment from BAM files with particular tag value?
0
Entering edit mode
2.6 years ago
epigene • 450
United States

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 • 904 views
ADD COMMENTlink
1
Entering edit mode
16 months ago
France/Nantes/Institut du Thorax - INSE…

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

Thanks, will try it out!

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.3.1