Optional alignment fields, called auxiliary tags.
A tag name is a two-byte binary taken from the file. This module does not
convert that name to an atom. The type code stays a one-byte binary as
well: A, c, C, s, S, i, I, f, Z, H, or B.
Numeric and float values keep the little-endian bytes from the file in
:raw so a BAM round trip does not re-encode a float and change its bits.
Array values are %{element_type: type, values: list}.
SAM text writes integers with type i and lets the BAM encoder pick the
narrowest integer code that fits.
Summary
Functions
Decodes the auxiliary blob that follows the qualities in one BAM record.
Encodes tags into a BAM auxiliary blob.
Formats one tag as a SAM optional field.
Parses one SAM optional field, such as NM:i:2 or XA:B:i,1,2.
Chooses the narrowest BAM integer code for a SAM i value.
Types
Functions
@spec decode(binary(), BAM.Limits.t(), :strict | :permissive) :: {:ok, [t()]} | {:error, BAM.Error.t()}
Decodes the auxiliary blob that follows the qualities in one BAM record.
@spec encode([t()]) :: {:ok, binary()} | {:error, BAM.Error.t()}
Encodes tags into a BAM auxiliary blob.
@spec format_sam(t()) :: {:ok, binary()} | {:error, BAM.Error.t()}
Formats one tag as a SAM optional field.
@spec parse_sam(binary()) :: {:ok, t()} | {:error, BAM.Error.t()}
Parses one SAM optional field, such as NM:i:2 or XA:B:i,1,2.
@spec smallest_integer(integer()) :: <<_::8>>
Chooses the narrowest BAM integer code for a SAM i value.