Expand description
FASTA header metadata: |-separated fields named by --header-format (Tharanga et al.
2025, “Metadata”), cleaned once and interned so the engine only handles small integers.
- Format. Field names are trimmed and NFC-normalised, and must be non-empty and unique;
--metadata-fields(default: all fields) must name a subset of them. - Split first. The whole header line after
>is split on|before any cleaning, so cleaning can never create or remove a delimiter. - Encoding (D48). Invalid UTF-8 is an error in strict mode (with the record and byte); permissive and report modes replace it with U+FFFD and count the replacements.
- Value cleaning (D59). Remove format characters (General_Category Cf, e.g. zero-width spaces and bidirectional marks) and control characters except TAB; trim Unicode White_Space; normalise to NFC (UAX #15; W3C charmod-norm); an empty value becomes the fill value. Interior text is never changed. Every change is counted.
- Mismatches (D18). A header whose field count differs from the format is an error in strict mode (all headers are read first and the first 20 offenders are listed); in permissive and report modes its values become the fill value and a diagnostic is raised.
- Diagnostics. Near-duplicate values (equal after case folding, whitespace collapsing and NFKC), missing-like tokens (kept literally; INSDC missing-value vocabulary and common NA spellings) and identifier-like fields (every value unique).
Structs§
- Clean
Stats - Cleaning counters (D59), mergeable in input order.
- Header
Position - Where a header is in the input, for messages.
- Header
Spec - Validated header format: field names, stratified fields and fill value.
- Header
Stats - Header-processing counters for one batch (or the whole run), mergeable in input order.
- Value
Dictionary - Interned header values: each distinct (field, value) pair gets a small integer id.
Functions§
- clean_
value - Cleans one header value (D59): remove Cf and Cc-except-TAB, trim White_Space, NFC; an empty
result becomes
fill. - cleaning_
diagnostic - Diagnostic summarising value cleaning, if anything was changed.
- cleaning_
record - Provenance of the cleaning (D59, D97).
- identifier_
diagnostic - Diagnostic for stratified fields whose values were all distinct in the probe (likely identifiers such as accessions), which multiply the metadata held per variant.
- mismatch_
error - The error raised in strict mode when headers do not match the format.
- parse_
header - Parses one header (the bytes after
>) into the cleaned values of the stratified fields. - split_
format - Splits a
--header-formatstring such asAccession|Host|Yearinto names. - value_
diagnostics - Diagnostics about the values of the stratified fields: missing-like tokens and near-duplicates, per field.