Skip to main content

Crate dima_core

Crate dima_core 

Source
Expand description

DiMA core library: the sequence diversity dynamics analyser for viruses.

Implements the method of Tharanga S, Ünlü ES, Hu Y, Sjaugi MF, Çelik MA, Hekimoğlu H, Miotto O, Öncel MM, Khan AM. “DiMA: sequence diversity dynamics analyser for viruses”. Brief Bioinform 2025;26(1):bbae607, doi:10.1093/bib/bbae607.

Re-exports§

pub use analysis::Analysis;
pub use analysis::analyze;
pub use error::DimaError;
pub use error::Result;

Modules§

alphabet
Sequence alphabets: detection from residue composition and per-byte symbol classes.
analysis
Orchestration of an analysis: input → probe → normalisation → counting → statistics → summaries and provenance. Each step lives in its own module; this one only wires them.
citations
Bibliographic references: the single source for every citation surface.
config
Analysis parameters, their defaults and their validation.
control
Cancellation and progress shared between an analysis and its front end.
diagnostics
Typed, aggregated diagnostics: conditions that do not stop an analysis but that the user should know about (FastQC/Nextclade-style warnings recorded with the results).
engine
The streaming k-mer counter (D1).
entropy
Shannon entropy of the k-mer distribution at a position, and its bias-corrected estimators.
error
The library’s error type and its mapping to process exit classes.
hcs
Historically conserved sequences (HCS; Tharanga et al. 2025; D12, D44, D86).
header
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.
human
Human-readable numbers for messages: durations, sizes and counts, shared by the command line and the desktop app so both say the same thing (D104).
input
Opening an input and reading it as batches of raw FASTA records.
methods
A methods paragraph and the reference list of a run, for dima cite --from and the GUI’s “Export methods & references” (D89): built from the run’s recorded parameters and its run.references — and, when given, from the conserved sequences computed from it and their references — so it states exactly what was done and cites exactly what was used.
model
Typed analysis results and their JSON representation (schemas/results.schema.json).
normalise
Parallel normalisation of raw records into fixed-width rows of canonical residues.
output
Writing and reading results (D10, D22, D28, D31, D50, D61; findings E2, E11, F4, P4).
position
Turns the counts of one position into its result: support class, entropy estimate, sample coverage, diversity motifs, incidences and per-variant metadata.
provenance
The deterministic provenance of a run (run in the results) and its diagnostics.
run_report
The run report (D103): how a run went, written to a separate JSON file (schemas/run-report.schema.json) so that the results stay byte-identical across runs.
stats
Support classes, diversity motifs and incidences of a position (Tharanga et al. 2025; motif definitions after Hu et al. 2013 and Khan et al. 2008).
summary
Run-level summaries (D11, D32, D42, D43, D88).
validation
The first-batch probe shared by the analysis and the GUI’s pre-check (D40, D85).