Question: Is there a tools to select alignment from BAM files with particular tag value?
0
gravatar for epigene
2.5 years ago by
epigene440
United States
epigene440 wrote:

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 • 814 views
ADD COMMENTlink modified 2.5 years ago by Pierre Lindenbaum116k • written 2.5 years ago by epigene440
1
gravatar for Pierre Lindenbaum
2.5 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum116k wrote:

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 modified 2.5 years ago • written 2.5 years ago by Pierre Lindenbaum116k

Thanks, will try it out!

ADD REPLYlink written 2.5 years ago by epigene440
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: 2245 users visited in the last hour