Question: Is there a tools to select alignment from BAM files with particular tag value?
0
gravatar for epigene
2.8 years ago by
epigene450
United States
epigene450 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 • 892 views
ADD COMMENTlink modified 2.8 years ago by Pierre Lindenbaum120k • written 2.8 years ago by epigene450
1
gravatar for Pierre Lindenbaum
2.8 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum120k 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.8 years ago • written 2.8 years ago by Pierre Lindenbaum120k

Thanks, will try it out!

ADD REPLYlink written 2.8 years ago by epigene450
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: 647 users visited in the last hour