Question: How do I filter a BAM file for proper pairs WITHOUT samtools
0
gravatar for hohoku
8 days ago by
hohoku0
hohoku0 wrote:

I need to remove unpaired reads from my BAM file... and I'm looking for a non-samtools way of doing it. Suggestions?

alignment • 110 views
ADD COMMENTlink modified 7 days ago • written 8 days ago by hohoku0
1

May I ask you why samtools is not allowed?

ADD REPLYlink written 8 days ago by finswimmer6.2k

We have some conflicts with samtools

ADD REPLYlink modified 7 days ago • written 7 days ago by hohoku0
1

That's incredibly unusual, it's likely you should just fix your environment then.

ADD REPLYlink written 7 days ago by Devon Ryan85k

I would normally agree, but we have reasons for not using samtools in this instance

ADD REPLYlink modified 7 days ago • written 7 days ago by hohoku0
2
gravatar for Devon Ryan
8 days ago by
Devon Ryan85k
Freiburg, Germany
Devon Ryan85k wrote:

In deepTools:

alignmentSieve --samFlagInclude 2 -b input.bam -o output.bam

You can use multiple threads if you like. Of course this uses pysam, which uses htslib, which is part of samtools, but most tools will use something related to samtools somewhere...it's a standard tool after all.

ADD COMMENTlink written 8 days ago by Devon Ryan85k
2
gravatar for Pierre Lindenbaum
8 days ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum113k wrote:

using samjdk http://lindenb.github.io/jvarkit/SamJdk.html

java -jar  dist/samjdk.jar -e 'return record.getProperPairFlag();' input.bam
ADD COMMENTlink written 8 days ago by Pierre Lindenbaum113k
0
gravatar for hohoku
7 days ago by
hohoku0
hohoku0 wrote:

Thanks for the above responses, but we also found Sambamba which is pretty fast sambamba view -f bam -F "proper_pair" -o output.bam input.bam

ADD COMMENTlink written 7 days ago by hohoku0
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: 767 users visited in the last hour