Sam/Bam Manipulation


samtools fixmate [-rpc] [-O format] in.nameSrt.bam out.bam


Required arguments

  • input.bam file: Input BAM file to fix mate information. The input file must be grouped by read name (e.g. sorted by name). Coordinated sorted input is not accepted.
  • output.bam file: Output BAM file with fixed mate information.

Note: As elsewhere in samtools, use '-' as the filename for stdin/stdout.


  • -r: Remove unmapped reads and secondary alignments.
  • -p: Disable FR proper pair check
  • -c: Add template cigar ct tag
  • -m: Add mate score tag
  • -u: Uncompressed output
  • --no-PG: do not add a PG line
  • --input-fmt-option OPT[=VAL]: Specify a single input file format option in the form of OPTION or OPTION=VALUE
  • -O, --output-fmt string: Output format ('sam', 'bam', or 'CRAM') for the output file (default: bam).
  • --output-fmt-option OPT[=VAL]: Specify a single output file format option in the form of OPTION or OPTION=VALUE
  • --reference string: Reference sequence name for header (required if 'input.bam' has no header).
  • -@, --threads int: Number of additional threads to use [0]
  • --verbosity int: Set level of verbosity

File formats this tool works with

Share your experience or ask a question