Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions SAMtags.tex
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ \section{Standard tags}
{\tt MQ} & i & Mapping quality of the mate/next segment \\
{\tt NH} & i & Number of reported alignments that contain the query in the current record \\
{\tt NM} & i & Edit distance to the reference \\
{\tt OC} & Z & Original CIGAR \\
{\tt OP} & i & Original mapping position \\
{\tt OA} & Z & Original alignment \\
{\tt OC} & Z & Original CIGAR (deprecated; use {\tt OA} instead) \\
{\tt OP} & i & Original mapping position (deprecated; use {\tt OA} instead) \\
{\tt OQ} & Z & Original base quality \\
{\tt OX} & Z & Original unique molecular barcode bases \\
{\tt PG} & Z & Program \\
Expand Down Expand Up @@ -346,11 +347,30 @@ \subsection{Barcodes}
\subsection{Original data}

\begin{description}
Comment thread
yfarjoun marked this conversation as resolved.
\item[OA:Z:\tagregex{(\metavar{RNAME},\metavar{POS},\metavar{strand},\metavar{CIGAR},\metavar{MAPQ},\metavar{NM};)+}]
The original alignment information of the record prior to realignment or unalignment by a subsequent tool.
Each original alignment entry contains the following six field values from the original record, generally in their textual SAM representations, separated by commas (`{\tt ,}') and terminated by a semicolon (`{\tt ;}'):
{\sf RNAME}, which must be explicit (unlike {\sf RNEXT}, `{\tt =}' may not be used here);
1-based {\sf POS};
`{\tt +}' or `{\tt -}', indicating forward/reverse strand respectively (as per bit~0x10 of {\sf FLAG});
{\sf CIGAR};
{\sf MAPQ};
{\tt NM} tag value, which may be omitted (though the preceding comma must be retained).

In the presence of an existing {\tt OA} tag, a subsequent tool may append another set of original alignment information after the semicolon,
adding to---rather than replacing---the existing {\tt OA} information.

The {\tt OA} field is designed to provide record-level information that can be useful for understanding the provenance of the information in a record.
It is not designed to provide a complete history of the template alignment information.
In particular, realignments resulting in the the removal of Secondary or Supplementary records will cause the loss of all tags associated with those records, and may also leave the {\tt SA} tag in an invalid state.

\item[OC:Z:\tagvalue{cigar}]
Original CIGAR, usually before realignment.
Deprecated in favour of the more general {\tt OA}.

\item[OP:i:\tagvalue{pos}]
Original 1-based mapping position, usually before realignment.
Original 1-based {\sf POS}, usually before realignment.
Deprecated in favour of the more general {\tt OA}.

\item[OQ:Z:\tagvalue{qualities}]
Original base quality, usually before recalibration.
Expand Down Expand Up @@ -453,6 +473,11 @@ \section{Tag History}
\setlength{\parindent}{0pt}
\newcommand*{\gap}{\vspace*{2ex}}

\subsubsection*{January 2019}
Added the OA tag for recording original/previous alignment information.

Deprecated the OC and OP tags.

\subsubsection*{July 2018}

Clarified the calculation of NM score.
Expand Down