BAM tags¶
Every per-read tag FiberHMM writes. Intervals are 0-based in the
molecular frame (in MA strings the start is
written 1-based). The meaning of the scores is explained in
Annotations and scores.
Footprint calls¶
Written by fiberhmm-call (also --hmm-only),
fiberhmm-recall-tfs/-recall-nucs, and the joint recall of
fiberhmm-pair/fiberhmm-merge --recall. Since 3.3.0 they write MA/AQ
(and AN) only; the legacy ns/nl/nq and as/al are written only
with --legacy-tags, for FiberBrowser ≤ 3.1.0 (blank read rows without
them), fibertools ≤ 0.12 and old scripts. FiberHMM, fibertools 0.13+ and
FiberBrowser 3.1.1+ read MA. Every FiberHMM reader takes
nucleosome and MSP calls from MA (else fibertools Ma) and reads the
legacy tags only when a record has no nuc/msp group
(Shared defaults).
| Tag | Type | Content |
|---|---|---|
ns / nl |
B:I |
with --legacy-tags: nucleosome starts / lengths; with --downstream-compat also TF calls |
as / al |
B:I |
with --legacy-tags: MSP starts / lengths (fiberhmm-call --hmm-only --keep-msps keeps the input's, with their aq) |
nq |
B:C |
with --legacy-tags, one byte per ns entry: with nucleosome recall the LLR ×10 (0 = unresolved); otherwise the HMM posterior mean ×255 (--scores), the input's nq, or 0 |
MA |
Z |
molecular annotations (groups below) |
AQ |
B:C |
quality bytes of every MA annotation, in MA order |
AN |
Z |
one name per MA annotation (. for unnamed); written when a call wraps a circular origin (fhw_*), for strand-rescue roles, consensus class tokens, or when preserved groups carry names |
hl |
i |
1 on reads written by fiberhmm-apply --harmonize-legacy-tags before 3.3 (no longer written): ns/nl hold only the nucleosomes of the MA view, not every HMM footprint, so fiberhmm-recall-tfs/-nucs refuse the read. A later run removes it only when it replaces ns/nl (call, recall, duplex joint recall); a run that leaves ns/nl in place, such as an MA-only write, keeps it |
FiberHMM writes no MSP quality score (since 3.3.0; fiberhmm-apply --scores
in 3.2.1 and older used to write its MSP posterior as aq). An MSP quality is fibertools FIRE:
the fire group of Ma/MA, or fibertools ≤ 0.12's aq. A command that
rewrites MSPs removes any aq and fibertools Ma/Aq/An it finds,
keeps fire groups only when they still match the MSPs exactly, and declares
@CO FIBERHMM-ANNOTATION-CONTRACT:v2
(Header declarations).
FiberHMM also reads fibertools-rs 0.13+ Ma/Aq/An tags (same spec,
always molecular frame) as input; it never writes them, and a command that
copies them into MA removes them. See
Coordinate frames.
Without --legacy-tags (the default) a run writes only MA/AQ and removes
any ns/nl/nq/as/al/aq from the records it rewrites, so stale
legacy tags never sit beside a new MA; --no-legacy-tags is accepted as a
deprecated no-op. --downstream-compat writes TF calls into ns/nl and no
MA/AQ/AN. Records a run skips are written without this run's call tags;
DddA island groups are kept.
MA groups¶
| Group | AQ bytes |
Written by | Meaning |
|---|---|---|---|
nuc.QQQ |
nq, el, er |
nucleosome recall (fiberhmm-call default, recall-nucs, duplex recall) |
recalled nucleosomes |
nuc.Q |
nq |
recall-tfs, call --no-recall-nucs |
nucleosomes without recall |
msp. |
— | all callers | methylase-sensitive patches |
tf.QQQ |
tq, el, er |
all callers | TF / Pol II and other sub-nucleosomal footprints |
ddda_mcg. |
— | fiberhmm-tag-m5c, fiberhmm-call-m5c --tag-bam |
whole CpG island, confidently methylated on this molecule |
ddda_ucg. |
— | same | whole CpG island, confidently unmethylated (the CpG-aware recall whitelist) |
deam+ / deam- |
— | fiberhmm-pair merge |
CT- and GA-source aligned coverage of a joint duplex molecule |
nuc_sr.QQQ, tf_sr.QQQ |
q0, q1, q2 |
fiberhmm-strand-rescue-annotate |
strand-rescue shadow layers (Strand rescue) |
tf_sr.QQQQQ |
as above plus fi, fq |
fiberhmm-tag-consensus |
family slot (0 = unassigned) and assignment confidence ×255 |
tf_consensus.QQQQQQ |
tq, fi, fq, op, sq, q0 |
fiberhmm-consensus, fiberhmm-transfer |
native TF calls labelled with their class (Consensus) |
tf_recaller.QQQQQQ |
tq, fi, tier, q0, lr, rr |
fiberhmm-consensus --bam-recaller-layer |
the lattice recaller's own class calls |
tf_cross_consensus.QQQQQQ |
as tf_consensus |
fiberhmm-consensus --engine staged_native_families (XCR) |
deprecated staged engine |
fp_NAME.QQQ |
tq, cw, ef |
fiberhmm-footprint --out-bam |
motif footprinted by a FiberHMM call: call tq, conservative width, edge flag (Motif footprints) |
fpneg_NAME.Q |
reason |
fiberhmm-footprint --out-bam |
motif eligible (in an MSP) but not footprinted |
fpcls.QQQ |
state, p, tier |
fiberhmm-scan (fp) |
per (footprint class, molecule): membership state, class posterior ×255, tier; AN = hit id (Scanning) |
nfrvar.QQ |
state, p |
fiberhmm-scan (nfr) |
per (NFR or NFR variant, molecule): open/closed and P(variant) ×255; AN = hit id |
nfrmol.QQQQ |
openness, n_nfr, longest_linker (2 bytes) |
fiberhmm-scan (nfr) |
one whole-molecule interval with per-molecule scalars (scan format) |
Nucleosome groups¶
Written by the nuc module of fiberhmm-scan (and fiberhmm.nuc.tags), in
molecular coordinates (Nucleosomes). Each is
declared in MA-TYPES:v1 and in a @CO FIBERHMM-SCAN-MA:v1: contract line.
| Group | AQ bytes |
One interval per | Meaning |
|---|---|---|---|
nucsz.QQQQ |
coarse, reserved, posterior, z | footprint (nucleosome and TF calls) | coarse code in bits 0–3 (0 can't tell, 1 short, 2 mono, 3 long, 4 multi2, 5 multi3+, 6 edge-truncated), +16 for a TF call or a footprint overlapping one; reserved, always 0 (a named size class before 3.2.0; FiberHMM assigns no named nucleosome classes); posterior ×255; 20 z + 128 (255 = missing) |
nucseg.QQQ (version 2) |
code, posterior or 10 × LLR, q̂ − 100 or count | segment, or event | segment rows (partition): 1 regular, 2 disordered, 3 low-information, 4 undetermined; event rows (overlay): 16 undersized run, 17 missing nucleosome |
nucreg.QQ (version 1) |
score, period − 100 | regularity tile (step-wide, centred on a window centre; tiles never overlap) | 1 + round(clip((score + 2) / 10, 0, 1) × 254) (0 = no score) with score = log2 FFT peak power at 140–260 bp over the median power at 50–1000 bp; local repeat length − 100 (0 = none). Parameters in the contract line |
nucpatch.QQQ (version 1, --nucpatch) |
mean score, period − 100, flags | regularity patch (snapped edges) | mean tile score in the nucreg score byte; median tile period − 100 (0 = none); flags bit 0/1 open at the molecular start/end, bit 2/3 start/end snapped to a nucleosome boundary, bit 4 a low-regularity patch. Parameters and the reference median's source in the contract line |
nucgeo (state group, --nucpatch, BED units) |
state, reason | (shared geometry, record) | state 1 carries, 2 absent, 3 no call or not spanned; reason 1 carries, 2 absent, 3 no call, 4 not spanned, 5 partial (carries only a geometry folded into this one; state 2); AN is the nuc.geometry hit id |
nucmol (version 2, 27 Q bytes) |
the molecule scalars | record (1-L) |
nrl, regularity, spectral_snr, gap_cv, lambda_acc, rho_read, n_dyads, n_short, n_mono, n_long, n_multi, n_cant_tell, reg_fraction, disordered_fraction, undetermined_fraction, undersized_fraction, n_missing, flags, and the calls digest (calls_digest_hi/_lo); codecs in the contract line |
nucsz and nucseg AN names are <group>@<digest>_<index> (nucmol holds
the digest in its last four bytes; nucreg names are
nucreg@<digest>.<params8>_<index>, with the first 8 hex of the regularity
parameters' digest, so a reader can tell rows made with other settings; nucpatch names are
nucpatch@<digest>.<params8>_<index>, the 8 hex covering the patch and regularity parameters and the
reference median): the digest is over the call lengths and
the gaps between consecutive calls, so it survives fiberhmm-lift. A reader
ignores the groups when the digest no longer matches the record's calls. Every writer that regenerates nuc/msp/tf drops
them.
The strand field of every FiberHMM group is ., except the duplex
coverage groups of fiberhmm-pair, whose strand is + (deam+, CT source)
or - (deam-, GA source). ddda_mcg+/- and
ddda_mcg_hemi+/- from older experimental per-CpG callers are still read
but no longer written.
Quality bytes¶
| Byte | Scale |
|---|---|
tq |
min(255, round(10 × LLR)); 23 points = one order of magnitude in likelihood ratio |
nq |
as tq for recalled nucleosomes (0 = unresolved) |
el, er |
round(255 × max(0, 1 − ambiguity_bp / 30)), molecular left / right edge |
q0, q1, q2 (strand rescue) |
linear 0–255 probabilities; see Strand rescue |
fi |
family / class slot, 1–255 (0 = none) |
fq |
assignment confidence ×255 (0 = unavailable in consensus exports) |
op |
informative opportunities in the call |
sq |
DAF core protection ceiling of the molecule (1 + LLR × 10) |
q0 (consensus) |
lattice recaller: the molecule's EM class posterior ×255; staged engine: the class's share of the call's evidence ×255 |
tier |
1 core, 2 edge, 3 loose |
lr, rr |
left / right edge-range width in bp (0 = exact edge), saturated at 255 |
DAF tags¶
| Tag | Type | Writer | Content |
|---|---|---|---|
st |
Z |
fiberhmm-daf-encode |
conversion flavour: CT or GA; SEQ then carries Y/R codes. fiberhmm-call's one-pass DAF path derives the flavour internally and does not write it, except on --chimeras split pieces of R/Y-encoded records, which are re-encoded for their own strand with a new st |
di |
i |
fiberhmm-dedup, integrated dedup |
duplicate-cluster id, on every member of a cluster of two or more |
ds |
i |
same | cluster size (copies of the molecule in the input) |
xc |
Z |
fiberhmm-call |
local lowercase tag: strand_swap identifies DAF strand-swap evidence meeting the run's chimera_min_seg / chimera_purity thresholds in @PG DS (with the opt-in strict detector, also its chimera_min_baseq, chimera_min_span, chimera_multi_switch and chimera_error_mask settings); paired with SAM QC-fail 0x200, including supplementary/secondary records. split marks a piece written by --chimeras split (either detector), with xi:i (piece index), xn:Z (original read name) and xb:B:i (breakpoint gaps); unmapped and paired (0x1) records are never split and are flagged whole instead; see Split mode |
xq |
i |
fiberhmm-call |
original QC-fail state before setting xc:Z:strand_swap: 0 means FiberHMM set 0x200; 1 means it was already set. Cleanup preserves pre-existing QC failures. |
Duplicates are also flagged 0x400 (standalone --flag-only, and the
integrated default); a collapse keeps only the representative, which keeps
di/ds.
Duplex pairing tags¶
| Tag | Type | On | Content |
|---|---|---|---|
mt |
A |
source reads | P pair member, U had candidates but failed, . no opposite-flavour candidate |
mp |
Z |
pair members | the mate's query name |
pm |
A |
pair members, joint molecule | route: S sequence, D sequence-free model (F: pre-3.0 footprint pairer) |
pa |
A |
sequence pairs | R reciprocal, C constrained 2×2 |
sb |
i |
sequence pairs | shared reference-A/T bases |
sd |
i |
sequence pairs | differences at those bases |
sr |
i |
sequence pairs | difference rate ×1,000,000 |
sg |
i |
sequence pairs | assignment margin ×1,000,000 |
mc |
i |
sequence pairs (optional) | nucleosome dyad correlation ×1000 |
dm |
i |
model pairs | decision score ×1000 |
mg |
i |
model pairs | reciprocal decision margin ×1000 |
mv |
Z |
model pairs | model identifier |
cs |
Z |
joint molecule | source names, <ct_name>;<ga_name> |
dc |
i |
joint molecule | deamination count (C→T and G→A) |
bc |
i |
joint molecule | source-base conflicts written as N |
The joint molecule (<ct_name>.cs) has no mt/mp and carries its route's
evidence tags.
Lift tags¶
Written by fiberhmm-lift (SAM user space).
| Tag | Type | Content |
|---|---|---|
Yq |
i |
MAPQ of the source alignment (kept as the record's MAPQ) |
Yp |
Z |
source locus, <contig>:<1-based POS>:<+/->; marks a lifted record |
Yf, Yh |
i, Z |
source FLAG and hard clips; between stash and repair only |
Yo |
i |
1 on a repaired supplementary with no lifted primary; 0x800 is kept |
Yu |
Z |
why a record could not be lifted (no_projection, contig_not_in_map, ...); only in the --unlifted BAM, whose records keep their source coordinates |
Tags FiberHMM reads¶
| Tag | Used for |
|---|---|
MM/ML (or Mm/Ml) |
m6A (A+a, T-a), 5mC and dU calls; ?-mode unlisted bases are unknown, not unmodified |
MD |
DAF deaminations when SEQ has no R/Y |
MN |
detects hard-clipped records whose MM/ML cannot match SEQ |
st |
DAF flavour of R/Y-encoded reads |
HP, PS |
copied by fiberhmm-extract --haplotype-fields |
ns/nl/as/al, MA/AQ/AN |
input footprints for recall, extraction, QC and every downstream command |
Yo:i:1 in a repaired fiberhmm-lift BAM marks a supplementary retained
without a lifted primary. Its 0x800 flag is preserved; Yp:Z still records
the source locus. Ordinary supplementaries have no Yo tag. Unrecoverable
hard-clipped input orphans are excluded before lifting.