samtools-reset(1)
π samtools-reset(1) β reset, but make it a whole glow-up π
okay bestie, welcome to samtools-reset(1), fresh out of the Bioinformatics tools section π. This is the page for samtools reset, and it is literally about removing the alignment info that aligners added and updating the flags to match. No cap.
β¨ NAME β¨
samtools reset β removes the alignment information added by aligners and updates flags accordingly. That is the whole vibe check π«Ά.
πΈ SYNOPSIS πΈ
samtools reset [-o FILE] [-x,--remove-tag STR] [--keep-tag STR]
[--reject-PG pgid] [--no-RG] [--no-PG] [--dupflag] [...]
π DESCRIPTION π
Okay so what does it actually do? It removes the alignment information added by the aligner β¨. CIGAR and reference data are removed. Flags are updated as unmapped, non-duplicate and as not a proper pair π
.
If the alignment was in reverse direction, data and its quality values are reversed and complemented and the reverse flag is reset π. Supplementary and secondary alignment data are discarded β they do not make it to the output, periodt π.
Aux tags that will be retained in output can be controlled by keep-tag and remove-tag/-x π. These options take tags as comma separated lists.
Aux tags AS, CC, CG, CP, H1, H2, HI, H0, IH, MC, MD, MQ, NM, SA and TS are removed by default, this can be overridden using keep-tag. Yes, that list is long; keep it exact, bestie π.
PG and RG tags from input are written on the output by default β
. CO lines are not retained after this operation π«.
The sort order is unchanged, so users may consider combining this with samtools collate or sort -n if it is a requirement to group pairs of sequences together πΈ.
π OPTIONS π
One bullet per flag, zero skipped, we are thorough in this house π .
-o FILEβ Output file to which reset data is to be written. If not given, standard output will be used.-x STR,--remove-tag STRβ Read tag(s) to exclude from output (repeatable)[null]. This can be a single tag or a comma separated list. Alternatively the option itself can be repeated multiple times. If the list starts with a^then it is negated and treated as a request to remove all tags except those in STR. The list may be empty, so-x ^will remove all tags.--keep-tag STRβ This keeps only tags listed in STR and is directly equivalent to--remove-tag ^STR. Specifying an empty list will remove all tags. If both--keep-tagand--remove-tagare specified then--keep-taghas precedence.--reject-PG pgidβ The PG line which has the ID matchingpgidand all subsequent PG lines will be removed. If the option itself is absent, the default, all PG entries will be in output.--no-RGβ RG lines in input will be discarded with this option. By default, RG lines will be present in output. With this option, RG aux tags will also be discarded.--no-PGβ Do not add a@PGline to the header of the output file listing theresetcommand. By default the PG entry forresetwill be present in the output.--dupflagβ Keep the duplicate flag as it is. This option is absent by default and alignments are marked non-duplicates.--input-fmt-option OPT=VALβ Set the input format options.-O,--output-fmt FMT[,options]β Sets the format of the output file and any associated format-specific options. If this option is not present, the format is identified from the output file name extension.--output-fmt-option OPT=VALβ Set the output format options.-T FILE,--reference FILEβ A FASTA format reference file for cram files.-@,--threads Nβ This gives the number of worker threads to be used.
π§ EXAMPLES π§
Basic usage, to reset the data:
samtools reset -o out.bam in.bam
To keep aux tags RG and BC in the output:
samtools reset -o out.sam --keep-tag RG,BC in.bam
To discard PG entries from 'bwa_index' onwards,
samtools reset -o out.sam --reject-PG=bwa_index
To set output format for use within a pipeline:
samtools collate -O -u input.cram | \
samtools reset --output-fmt BAM,level=0 | \
myaligner -I bam -o out.bam
π AUTHOR π
Written by Vasudeva Sarma of the Wellcome Sanger Institute. iconic contribution, fr fr π.
π¦ SEE ALSO π¦
samtools(1)samtools-collate(1)- Samtools website:
<http://www.htslib.org/>
xoxo, this page is serving samtools-1.24, dated 9 July 2026 ππ«Ά
π¦ where this page comes from
- epel 10: samtools 1.24-2.el10_3 Β· MIT
- nixpkgs unstable: samtools 1.24
- Copyright (C) 2022 - 2024, 2026 Genome Research Ltd
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms