Skip to content

Differences from DiMA v5.0.9

DiMA v5.0.9 (dima-cli, tag v5.0.9 of the original repository, MIT licence) is the implementation published with the paper (Tharanga et al. 2025). The paper’s method is the specification of this implementation; it departs from v5.0.9 only where v5.0.9 departs from the paper, where a result was undefined or unstable, or where an engineering change leaves results unchanged. Results of v5.0.9 can be compared with DiMA’s at a relative tolerance of about 10 − 5 for incidences (v5.0.9 stores them in single precision) and statistically for entropies (v5.0.9’s correction is random).

TopicDiMA v5.0.9This implementationWhy
Entropy correctionone random subsample per grid point, unseeded, so every run differsthe exact expectation of the same procedurethe intercept’s mean without its resampling noise, reproducible (Rao 1945; Blackwell 1947); see the exact expectation
Negative interceptthe observed entropy reported for each random run whose intercept is negativethe expected intercept is never negative, so the rule never applies; any reported entropy below 0 would be an internal errorthe paper attributes negative values to too few resamples; applied per run, the rule raises the average at near-conserved positions; see the negative-intercept rule
Subsample sizesrounded down, ⌊ R N / 100 ⌋ rounded up, ⌈ R N / 100 ⌉ Fig. 2 (“Upperbound”)
Grid start ⌈ 100 T / N ⌉ in floating point ( T = 55 , N = 100 gives 56)exact integer arithmeticthe paper’s formula; identical for T = 30 and T = 100
Positions without supportentropy 0, as the paper’s “pseudo entropy” of 0 (Fig. 2; Methods)no entropy (null, NA), still tagged NSa deliberate departure from the paper as well: an unobserved value is missing, not zero; see positions without support
Ratios 0 / 0 0null (NA)a fully conserved position must not look like a position without data; see undefined ratios
Incidence precisionsingle precision (f32)double precision
Summary statisticsmean over all positions with NS counted as 0; highest entropy at the last maximum, 0-based; no lowest; a crash without positionsmean, lowest and highest over eligible positions, first position (1-based) and tie count, null when empty; v5.0.9’s mean kept as all_positions_summarythe paper reports statistics of positions with support above T ; see summaries
Default support threshold30100the paper’s text: “default is 100 sequences, arbitrarily defined”, repeated in its HIV-1 application (its Fig. 2 shows 30, v5.0.9’s default)
Default k9 for every alphabet9 for proteins, 27 for nucleotides27 nucleotides encode a 9-mer
Estimatorsthe correction onlythe correction (default), Chao–Wang–Jost, Miller–Madow, raw, and the sample coverage(Chao et al. 2013; Miller 1955; Chao & Jost 2012)
TopicDiMA v5.0.9This implementation
Thresholdany value, compared in single precisionabove 50% and at most 100%, compared exactly
Candidatesevery Index variant, tied ones includedone Index per position (guaranteed above 50%)
Joiningby text: when the end of the accumulated sequence overlaps the start of the next k-mer by at least one character, its last residue is appended, whatever the positionsby position: the next k-mer must overlap or abut the region and agree with it on every shared column; a disagreement starts a new region
Low supportnot reportedregions with positions of support ≤ T are flagged, and each reports an exact 95% Clopper–Pearson lower bound (Clopper & Pearson 1934); --hcs-eligible-only excludes such positions
No region[""]an empty list

On the HIV-1 pol DNA dataset at 70%, both give the same two regions. At 100%, v5.0.9 reports two conserved strings on the HIV-1 pol protein alignment and eight on the MERS-CoV spike gene, which include positions supported by only 2 or 3 sequences; DiMA reports the corresponding regions flagged, with lower bounds of 29.2% and 15.8%. See Historically conserved sequences.

TopicDiMA v5.0.9This implementationWhy
Line-wrapped FASTAlines joined after trimming their endsall white space inside sequence lines ignoredFASTA files are commonly wrapped; formatting must not change results
Lines before the first recordany line, even a blank one, stops the programblank and white-space-only lines skipped; anything else is an error with its line and columnthey carry no data; MAFFT, Clustal Omega and EMBOSS, which these pages recommend, skip them too
Casecase-sensitive (a and A differ)folded to upper case, count reportedsoft-masked and lower-case alignments are common
Alphabetnot detecteddetected with Easel’s rules, or set with --alphabet (Eddy 2011)no false calls; asks when undetermined
T and Udifferent symbolsone symbol, spelled per alphabeta mixed T/U file is a formatting artefact
Protein U and Oexcludedresiduesselenocysteine and pyrrolysine are encoded amino acids (Böck et al. 1991; Srinivasan et al. 2002)
Nucleotide X and Iresiduesambiguity codes, excludednot one of A, C, G, T/U (Cornish-Bowden 1985)
. * # $ and spaces between residuesresiduesgap, stop, frameshift, stop: excluded; spaces ignoredLANL and Easel symbol conventions (Los Alamos HIV Sequence Database 2009; Eddy 2011)
Other characters (digits, punctuation)residuesan error (strict) or excluded with a warninga digit or stray symbol is never a residue
TopicDiMA v5.0.9This implementation
Field valuessplit on |, trimmed, empty ones filledsplit on |, invisible characters removed, Unicode white space trimmed, NFC-normalised, empty ones filled (UAX #15)
Wrong number of fieldsthe program stops with an assertion failurestrict: an error listing the first 20 headers; permissive: their fields get the fill value, with a warning
Identifier-like and missing-like valuesnot detectedwarnings with counts, examples and a remedy
Records counted for a variant’s metadatathe header at the variant’s index among all records, although the index counts only the records with a valid k-mer at that position: when an earlier record has none there, the values of other records are countedthe headers of the records that carry the variant
Query nameUnknown Querythe input file name without its extensions

The paper’s Fig. 1C was made with v5.0.9 and shows this shift: its host chart for the Index variant of MERS-CoV spike position 25 gives Homo sapiens 81 of 129 sequences and “others” 3, where the records that carry the variant give 80 and 4 (the other hosts agree).

The JSON keys of v5.0.9 are kept (query_name, support_threshold, low_support_count, highest_entropy, results, position, low_support, entropy, support, distinct_variants_count, distinct_variants_incidence, total_variants_incidence, diversity_motifs, sequence, count, incidence, motif_short, motif_long, metadata). New keys add what v5.0.9 left implicit: positions are 1-based, the method and fallback of each entropy, the observed entropy, the sample coverage, the summaries described above, and the full provenance of the run (run: parameters with their origin, input checksum, alphabet decision, validation, diagnostics and references). See JSON outputs.

  • Blackwell D. Conditional Expectation and Unbiased Sequential Estimation. The Annals of Mathematical Statistics. 1947;18(1):105-110. doi:10.1214/aoms/1177730497 ↩︎
  • Böck A, Forchhammer K, Heider J, Leinfelder W, Sawers G, Veprek B, Zinoni F. Selenocysteine: the 21st amino acid. Molecular Microbiology. 1991;5(3):515-520. doi:10.1111/j.1365-2958.1991.tb00722.x ↩︎
  • Chao A, Jost L. Coverage-based rarefaction and extrapolation: standardizing samples by completeness rather than size. Ecology. 2012;93(12):2533-2547. doi:10.1890/11-1952.1 ↩︎
  • Chao A, Wang YT, Jost L. Entropy and the species accumulation curve: a novel entropy estimator via discovery rates of new species. Methods in Ecology and Evolution. 2013;4(11):1091-1100. doi:10.1111/2041-210X.12108 ↩︎
  • Clopper CJ, Pearson ES. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika. 1934;26(4):404-413. doi:10.1093/biomet/26.4.404 ↩︎
  • Cornish-Bowden A. Nomenclature for incompletely specified bases in nucleic acid sequences: recommendations 1984. Nucleic Acids Research. 1985;13(9):3021-3030. doi:10.1093/nar/13.9.3021 ↩︎
  • Eddy SR. Accelerated Profile HMM Searches. PLoS Computational Biology. 2011;7(10):e1002195. doi:10.1371/journal.pcbi.1002195 ↩︎ 1 2
  • Los Alamos HIV Sequence Database. Codes and Symbols in Sequence Alignments. Los Alamos National Laboratory; 2009. https://www.hiv.lanl.gov/content/sequence/HelpDocs/IUPAC.html ↩︎
  • Miller GA. Note on the bias of information estimates. In: Information Theory in Psychology: Problems and Methods (Quastler H, ed.), Free Press, Glencoe, IL. 1955. p. 95-100. ↩︎
  • Rao CR. Information and the accuracy attainable in the estimation of statistical parameters. Bulletin of the Calcutta Mathematical Society. 1945;37:81-91. ↩︎
  • Srinivasan G, James CM, Krzycki JA. Pyrrolysine Encoded by UAG in Archaea: Charging of a UAG-Decoding Specialized tRNA. Science. 2002;296(5572):1459-1462. doi:10.1126/science.1069588 ↩︎
  • 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. Briefings in Bioinformatics. 2025;26(1):bbae607. doi:10.1093/bib/bbae607 ↩︎
  • UAX #15. Whistler K. Unicode Standard Annex #15: Unicode Normalization Forms. The Unicode Consortium; 2025. https://www.unicode.org/reports/tr15/tr15-57.html ↩︎