Skip to content

Instantly share code, notes, and snippets.

@macmanes
Last active January 22, 2017 20:00
Show Gist options
  • Save macmanes/04d425d2d9426f29ed95 to your computer and use it in GitHub Desktop.
Save macmanes/04d425d2d9426f29ed95 to your computer and use it in GitHub Desktop.
samtools v sambamba when streaming

About 12% faster streaming sambamba view/sort than if using samtools..

Going from 50M raw pe reads to a sorted BAM file in 15 minutes is pretty sweet.

samtools 1.2

bwa index -p index bwa.Trinity.fasta

time seqtk mergepe \
../Schizo.50M.left.fq.gz \
../Schizo.50M.right.fq.gz \
| skewer -Q 2 -t 16 -x ../adapters.fa - -1 \
| bwa mem -p -t 16 index - \
| samtools view -T . -bu - \
| samtools sort -l 0 -O bam -T tmp -@ 15 -m 1G -o schizo.bam -

real	17m10.772s
user	183m20.991s
sys	4m16.541s

sambamba

time seqtk mergepe \
../Schizo.50M.left.fq.gz \
../Schizo.50M.right.fq.gz \
| skewer -Q 2 -t 16 -x ../adapters.fa - -1 \
| bwa mem -p -t 16 index - \
| sambamba_v0.5.8 view -t 16 -l 0 -S -f bam -o /dev/stdout /dev/stdin \
| sambamba_v0.5.8 sort -l 0 -t 15 -m 15G -o schizo.bam /dev/stdin

real    14m52.308s
user    179m21.680s
sys     3m47.568s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment