Category

Sam/Bam Manipulation


Usage

samtools calmd [-eubrAESQ] <aln.bam> <ref.fasta>


Manual

The samtools calmd command is an integral component of the samtools suite, specifically tailored for handling SAM (Sequence Alignment/Map) and BAM (Binary Alignment/Map) format files. At its core, the purpose of the MD tag is to represent the alignment differences between a read sequence and a reference sequence. This tag helps researchers and bioinformaticians quickly identify and analyze variations, including substitutions, insertions, and deletions, when comparing aligned reads to a known reference. By computing and appending the MD tag to alignments, the tool aids in downstream analyses such as variant calling, structural variant detection, and alignment quality assessment.

Required arguments

  • aln.bam file: BAM file to compute MD tags against.
  • ref.fasta file: Reference FASTA file for comparison.

Options

  • -e: change identical bases to '='.
  • -u: uncompressed BAM output (for piping).
  • -b: compressed BAM output.
  • -S: ignored (input format is auto-detected).
  • -A: modify the quality string.
  • -Q: use quiet mode to output less debug info to stdout.
  • -r: compute the BQ tag (without -A) or cap baseQ by BAQ (with -A).
  • -E: extended BAQ for better sensitivity but lower specificity.
  • --no-PG: do not add a PG line.
  • --input-fmt-option OPT: Specify a single input file format option in the form of OPTION or OPTION=VALUE.
  • --output-fmt FORMAT[,OPT]: Specify output format (SAM, BAM, CRAM).
  • --output-fmt-option OPT: Specify a single output file format option in the form of OPTION or OPTION=VALUE.
  • --reference FILE: Reference sequence, if you want to specify this, provide a FASTA FILE [null].
  • -@, --threads int: Number of additional threads to use [0].
  • --verbosity int: Set level of verbosity.

Examples

An example usage of computing MD tags against an alignment BAM file with a reference FASTA file: samtools calmd input.bam reference.fasta

Utilizing the -e option to change identical bases to '=': samtools calmd -e input.bam reference.fasta

File formats this tool works with
BAMCRAMSAM

Share your experience or ask a question