Base qualities.
BAM stores one byte per base. The byte is a Phred score, not the
printable SAM character. A score of 0xFF in every byte means the
qualities are missing, which SAM writes as *.
SAM text can represent scores 0 through 93, because the stored character
is score + 33 and must fall in the printable range ! through ~.
A BAM file may contain a higher score. Formatting such a record as SAM
returns an error so the score is not silently clamped. The raw bytes stay
on the alignment either way.
Summary
Functions
Parses a SAM QUAL field into raw BAM bytes.
True when every byte is 0xFF, including the empty binary.
Expands a missing QUAL into length bytes of 0xFF.
Formats raw BAM qualities as a SAM QUAL field.
Functions
@spec from_sam(binary()) :: {:ok, :missing | binary()} | {:error, BAM.Error.t()}
Parses a SAM QUAL field into raw BAM bytes.
* becomes an empty marker. Callers that know l_seq expand * to
l_seq bytes of 0xFF. A parsed string here is the scores themselves.
True when every byte is 0xFF, including the empty binary.
@spec missing_bytes(non_neg_integer()) :: binary()
Expands a missing QUAL into length bytes of 0xFF.
@spec to_sam(binary()) :: {:ok, binary()} | {:error, BAM.Error.t()}
Formats raw BAM qualities as a SAM QUAL field.