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

Thanks, will try it out!

ADD REPLYlink written 3.3 years ago by epigene490
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: 898 users visited in the last hour