Skip to content

Commit

Permalink
update BAM cigar field as per samtools#40 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkj committed Nov 2, 2017
1 parent e4ef421 commit 5262b5d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions SAMv1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,12 @@ \subsection{The BAM format}
\footnotetext{With 16 bits, {\sf n\_cigar\_op} can keep at most 65535 {\sf
CIGAR} operations in BAM files. For an alignment with more {\sf CIGAR}
operations, BAM stores the real {\sf CIGAR}, in its binary form, to the {\tt
CG} optional tag of type `{\tt B,I}', and sets the {\sf CIGAR} to `{\tt kS}' as
a placeholder, where `{\tt k}' is the length of {\sf SEQ} and `{\tt S}' the
soft-clipping {\sf CIGAR} operator (i.e. in the binary form, {\sf
n\_cigar\_op}=1 and {\sf cigar}={\tt [k\char60\char60 4\char124{4}]}).
CG} optional tag of type `{\tt B,I}', and sets the {\sf CIGAR} to `{\tt kSmN}'
as a placeholder, where `{\tt k}' is the length of {\sf SEQ}, `{\tt S}' the
soft-clipping {\sf CIGAR} operator, `{\tt m}' is the length of the alignment on
the reference, and `{\tt N}' the skipped reference {\sf CIGAR} operator (i.e.
in the binary form, {\sf n\_cigar\_op}=2 and {\sf cigar}={\tt [k\char60\char60
4\char124{4}, m\char60\char60 4\char124{3}]}).
This workaround is applied to BAM files \emph{only}. SAM and CRAM files are not
affected. If tag {\tt CG} is present, BAM parsing libraries are expected to
seamlessly update {\sf n\_cigar\_op} and {\sf cigar} with the real {\sf CIGAR}
Expand Down

0 comments on commit 5262b5d

Please sign in to comment.