How do I filter a BAM file for proper pairs WITHOUT samtools
I need to remove unpaired reads from my BAM file... and I'm looking for a non-samtools way of doing it. Suggestions?
• 3,083 views
•
link
3 answers
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.
• 1 views
•
link
using samjdk http://lindenb.github.io/jvarkit/SamJdk.html
java -jar dist/samjdk.jar -e 'return record.getProperPairFlag();' input.bam
• 1 views
•
link
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
• 1 views
•
link
Log in to answer this question.
May I ask you why samtools is not allowed?
We have some conflicts with samtools
That's incredibly unusual, it's likely you should just fix your environment then.
I would normally agree, but we have reasons for not using samtools in this instance