Sambamba can replace most of the functionality of samtools. The main advantage of sambamba over samtools was parallelized BAM reading and writing.
Command & Options:
sambamba-view, sambamba-sort, sambamba-index, sambamba-merge, sambamba-slice, sambamba-flagstat, sambamba-markdup
sambamba-view
tool for extracting information from SAM/BAM files
-S, --sam-input#Specify that the input is SAM file (default is BAM for all operations).-l, --compression-level=COMPRESSION_LEVEL# Set compression level for BAM output, a number from 0 to 9.-t, --nthreads=NTHREADS# Number of threads to use.-s, --subsample=FRACTION# subsample reads (read pairs)--subsampling-seed=SEED# set seed for subsampling to re-emerge the results.
sambamba-sort
sambamba sortdoes an external sort on input file.
-m, --memory-limit=LIMIT# Sets an upper bound for used memory. Default memory limit is 512MiB. suffix K/KiB/KB/M/MiB/MB/G/GiB/GB recognized.-n, --sort-by-name# Default is 'coordinate'.
sambamba-index
sambamba indexbuilds an index for a sorted by coordinate BAM file.
sambamba-markdup
sambamba-markdup- finding duplicate reads in BAM file
-r, --remove-duplicates--hash-table-size=HASHTABLESIZE# size of hash table for finding read pairs (default is 262144 reads); will be rounded down to the nearest power of two; should be > (average coverage) * (insert size) for good performance--overflow-list-size=OVERFLOWLISTSIZE# size of the overflow list where reads, thrown away from the hash table, get a second chance to meet their pairs (default is 200000 reads); increasing the size reduces the number of temporary files created
samtools vs sambamba
samtools
samtools sort -@ 4 -l 9 ~/SARS_CoV_2/bam/P3-VERO-P3-1-vero_L4.bam -o ~/SARS_CoV_2/vs/P3-VERO-P3-1-vero_L4_sort.bam
In this process, samtools sort created 208 Temporary files, taking 01:14:09.
sambamba
sambamba sort -t 4 -l 9 ~/SARS_CoV_2/mapping/P3-VERO-P3-1-vero_L4.bam -o ~/SARS_CoV_2/vs/P3-VERO-P3-1-vero_L4_sort1.bam
sambamba sort did not create Temporary files, but took 01:51:46.
When sorting a BAM file, Sambamba is not quicker than Samtools single-threaded.
More information:
https://lomereiter.github.io/sambamba/docs/sambamba-view.html
