1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
'\" t
.TH samtools-reset 1 "12 September 2024" "samtools-1.21" "Bioinformatics tools"
.SH NAME
samtools reset \- removes the alignment information added by aligners and updates flags accordingly
.\"
.\" Copyright (C) 2022 - 2024 Genome Research Ltd.
.\"
.\" Author: Vasudeva Sarma <vasudeva.sarma@sanger.ac.uk>
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a
.\" copy of this software and associated documentation files (the "Software"),
.\" to deal in the Software without restriction, including without limitation
.\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
.\" and/or sell copies of the Software, and to permit persons to whom the
.\" Software is furnished to do so, subject to the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
.\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
.\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
.\" DEALINGS IN THE SOFTWARE.
.
.\" For code blocks and examples (cf groff's Ultrix-specific man macros)
.de EX
. in +\\$1
. nf
. ft CR
..
.de EE
. ft
. fi
. in
..
.
.SH SYNOPSIS
.PP
samtools reset
.RB [ -o
.IR FILE "]"
.RB [ -x,--remove-tag
.IR STR "]"
.RB [ --keep-tag
.IR STR "]"
.RB [ --reject-PG
.IR pgid ]
.RB "["--no-RG "] [" --no-PG "]
.RB [ --dupflag ]
.RB [...]
.SH DESCRIPTION
.PP
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.
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.
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 \fBsamtools collate\fR or \fBsort -n\fR if it is a requirement to group pairs of sequences together.
.SH OPTIONS
.TP 8
.BI -o\ FILE
Output file to which reset data is to be written. If not given, standard output will be used.
.TP 8
.BI "-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 \fISTR\fR. The list may be
empty, so \fB-x ^\fR will remove all tags.
.TP
.BI "--keep-tag " STR
This keeps \fIonly\fR tags listed in \fISTR\fR and is directly equivalent
to \fB--remove-tag ^\fR\fISTR\fR. Specifying an empty list will remove
all tags. If both \fB--keep-tag\fR and \fB--remove-tag\fR are
specified then \fB--keep-tag\fR has precedence.
.TP 8
.BI "--reject-PG " pgid
The PG line which has the ID matching \fIpgid\fR and all subsequent PG lines will be removed. If the option itself is absent, the default,
all PG entries will be in output.
.TP 8
.BI "--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.
.TP 8
.BI "--no-PG"
Do not add a @PG line to the header of the output file listing the \fBreset\fR command.
By default the PG entry for reset will be present in the output.
.TP 8
.BI "--dupflag"
Keep the duplicate flag as it is. This option is absent by default and alignments are marked non-duplicates.
.TP
.BI -@,--thread\ N
This gives the number of worker threads to be used.
.TP
.BI -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.
.SH EXAMPLES
Basic usage, to reset the data:
.EX 2
samtools reset -o out.bam in.bam
.EE
To keep aux tags RG and BC in the output:
.EX 2
samtools reset -o out.sam --keep-tag RG,BC in.bam
.EE
To discard PG entries from 'bwa_index' onwards,
.EX 2
samtools reset -o out.sam --reject-PG=bwa_index
.EE
To set output format for use within a pipeline:
.EX 2
samtools collate -O -u input.cram | \\
samtools reset --output-fmt BAM,level=0 | \\
myaligner -I bam -o out.bam
.EE
.SH AUTHOR
.PP
Written by Vasudeva Sarma of the Wellcome Sanger Institute.
.SH SEE ALSO
.IR samtools (1),
.IR samtools-collate (1)
.PP
Samtools website: <http://www.htslib.org/>
|