samtools-fixmate(1)
π samtools-fixmate(1) β the glow-up your mates deserved π
okay so bestie, welcome to samtools-fixmate, part of the samtools tool family (that's the samtools manual, page one, iykyk). this is the little icon that goes through your name-sorted alignments and fills in all the mate info so your downstream tools stop ghosting you. let's get into it π«Ά
β¨ NAME β¨
samtools fixmate β fills in mate coordinates and insert size fields. that's the whole personality, and honestly? it ate. π
π¦ SYNOPSIS π¦
samtools fixmate [-rpcmu] [-O format] in.nameSrt.bam out.bam
πΈ DESCRIPTION πΈ
so here's the vibe: you give it a name-sorted or name-collated alignment, and it fills in the mate coordinates, the ISIZE, and all the mate-related flags and tags. no cap, it does the boring bookkeeping so you don't have to. π
and it's not just the basics β it also handles the mate CIGAR (MC) and mate mapping quality (MQ) tags, and it does this on both primary and supplementary alignments. equal opportunity tagging, we love to see it β¨
π OPTIONS π
-rβ remove secondary and unmapped reads. lowkey important caveat: if one of a pair gets removed, thePAIREDflag will not be unset on the read that's left behind. this is a change from the older behaviour in samtools versions up to1.20, so if you're coming from an ancient version, heads up bestie π-pβ disable the FR proper pair check. yes, it's just turning that check off. sometimes you just need to let things be π-cβ add the template cigarcttag. cute little extra tag, no notes π-mβ addms(mate score) tags. these are the onesmarkdupuses to pick the best reads to keep, so if you're doing a markdup run later, this is your moment π₯-Mβ fix any base modification tags (MM,MLandMN). the whole situation: if we have secondary alignments with hard-clipping and the hard clipped reads don't have anMNtag, then we use the base modification tags in the primary alignment to clip the secondary alignment modifications β and we addMNtags in the process. this also does other sanity checks on the consistency of these tags. very much the responsible older sister of the option list π-uβ output uncompressed BAM or CRAM. uncompressed! living freely! π¦-OFORMAT β write the final output assam,bam, orcram. by default, samtools tries to pick a format based on the output filename extension; if output is to standard output or no format can be deduced,bamis selected. it's giving "i'll figure it out" energy β¨--no-PGβ do not add a@PGline to the header of the output file. no provenance line, no problem π-@,--threadsINT β number of input/output compression threads to use in addition to the main thread. default is[0], as in none, as in the main thread is doing all the work solo π-zFLAGs,--sanitizeFLAGs β perform basic sanitizing of records. FLAGs is a comma-separated list of keywords, defined in thesamtools-view(1)man page. by default all FLAGs are enabled, and you can use-z offto disable this. off means off, periodt π
π«Ά friendly reminder:-ztakes that comma-separated keyword list fromsamtools-view(1), and the default is all of them β don't come for me if you forgot to writeoff.
π AUTHOR π
written by Heng Li from the Sanger Institute. legend behaviour, honestly π«‘
β SEE ALSO β
samtools website: http://www.htslib.org/ π
and that's the whole page bestie π this one ships as samtools-1.24, dated 9 July 2026 β go fill in those mates, slay, and remember: name-sorted input or it's not happening πβ¨
π¦ where this page comes from
- epel 10: samtools 1.24-2.el10_3 Β· MIT
- nixpkgs unstable: samtools 1.24
- Copyright (C) 2008-2011, 2013-2018 Genome Research Ltd
- copyright (C) 2010, 2011 Broad Institute
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms