|
42 | 42 |
|
43 | 43 | \section{Standard tags} |
44 | 44 |
|
| 45 | +All optional fields follow the {\tt TAG:TYPE:VALUE} format |
| 46 | +where {\tt TAG} is a two-character string that matches {\tt /[A-Za-z][A-Za-z0-9]/}. |
| 47 | +In an optional field, {\tt TYPE} is a single case-sensitive letter which |
| 48 | +defines the format of {\tt VALUE}: |
| 49 | +\begin{center}\small |
| 50 | +\begin{tabular}{cll} |
| 51 | +\hline |
| 52 | +{\bf Type} & {\bf Regexp matching {\tt VALUE}} & {\bf Description} \\ |
| 53 | +\hline |
| 54 | +A & {\tt [!-\char126]} & Printable character \\ |
| 55 | +i & {\tt [-+]?[0-9]+} & Signed integer\footnotemark\\ |
| 56 | +f & {\tt [-+]?[0-9]*\char92.?[0-9]+([eE][-+]?[0-9]+)?} & Single-precision floating number \\ |
| 57 | +Z & {\tt [\,\,\,!-\char126]*} & Printable string, including space\\ |
| 58 | +H & {\tt ([0-9A-F][0-9A-F])*} & Byte array in the Hex format\footnotemark\\ |
| 59 | +B & {\tt [cCsSiIf](,[-+]?[0-9]*\char92.?[0-9]+([eE][-+]?[0-9]+)?)*} & Integer or numeric array\\ |
| 60 | +\hline |
| 61 | +\end{tabular} |
| 62 | +\addtocounter{footnote}{-1} |
| 63 | +\footnotetext{The number of digits in an integer optional field is not |
| 64 | +explicitly limited in SAM. However, BAM can represent values in the |
| 65 | +range~$[-2^{31},2^{32})$, so in practice this is the realistic range |
| 66 | +of values for SAM's `{\tt i}' as well.} |
| 67 | +\stepcounter{footnote} |
| 68 | +\footnotetext{For example, the six-character Hex string `{\tt 1AE301}' represents the byte array $[{\tt 0x1a},{\tt 0xe3},{\tt 0x1}]$.} |
| 69 | +\end{center} |
| 70 | +For an integer or numeric array (type `{\tt B}'), the first letter indicates the type of numbers |
| 71 | +in the following comma separated array. The letter can be one of `{\tt cCsSiIf}', corresponding to |
| 72 | +{\tt int8\_t} (signed 8-bit integer), {\tt uint8\_t} (unsigned 8-bit integer), {\tt int16\_t}, {\tt uint16\_t}, {\tt int32\_t}, {\tt uint32\_t} |
| 73 | +and {\tt float}, respectively.\footnotemark\@ During import/export, the element type |
| 74 | +may be changed if the new type is also compatible with the array. |
| 75 | +\footnotetext{Explicit typing eases format parsing and helps to reduce the file size when SAM is converted to BAM.} |
| 76 | + |
| 77 | +\vspace*{1em} |
45 | 78 | Predefined standard tags are listed in the following table and described |
46 | 79 | in greater detail in later subsections. |
47 | | -Optional fields are usually displayed as {\tt TAG:TYPE:VALUE}; the {\it type\/} |
48 | | -may be one of |
49 | | -{\tt A} (character), |
50 | | -{\tt B} (general array), |
51 | | -{\tt f} (real number), |
52 | | -{\tt H} (hexadecimal array), |
53 | | -{\tt i} (integer), |
54 | | -or |
55 | | -{\tt Z} (string). |
56 | 80 |
|
57 | 81 | \begin{center}\small |
58 | 82 | % This table is sorted alphabetically |
|
0 commit comments