Skip to main content

Table 1 Comparison of syntax for a reasonably complex query to keep reads on chromosome 2, mapping at position greater than 1,000,000, on the reverse strand, with mapping quality higher than 30

From: SamQL: a structured query language and filtering tool for the SAM/BAM file format

Tool Syntax
samql RNAME = "chr2" AND POS > 1000000 AND REVERSE AND MAPQ > 30
samtools chr2:1000000 -f 16 -q 30
sambamba 'reverse_strand and mapping_quality > 30' chr2:1000000
bash … | awk -F '\t' '{if ($3 =  = "chr2" && $4 > 1000000 && and($2,16) && $5 > 30) print}'
  1. Sambamba has similar expressivity to SamQL but like samtools, region queries are separated from the main filters, resulting in less intuitive syntax. We have excluded bamtools because it requires a JSON file for advanced queries