Papers
Topics
Authors
Recent
Search
2000 character limit reached

CA-MER: Chaos Game-Based k-MER Representation

Updated 7 July 2026
  • CA-MER is a unified framework for encoding DNA k-mer statistics via Chaos Game Representation, harmonizing geometric and compositional data.
  • It establishes a bijection between FCGR pixels and k-mers through precise grid partitioning and closed-form expressions.
  • The framework leverages dihedral symmetries and nucleotide permutations to enhance interpretation in synthetic reconstruction and machine-learning applications.

CA-MER, short for Chaos-game-based kk-MER representations, denotes the use of Chaos Game Representation (CGR) and Frequency CGR (FCGR) as encodings of DNA kk-mer statistics. In the formal framework established for DNA over Σ={A,C,G,T}\Sigma=\{A,C,G,T\}, a CGR discretized at resolution 2k×2k2^k\times 2^k is mathematically equivalent to the FCGR of order kk, and vectorization of that FCGR is exactly the kk-mer frequency vector up to a fixed bijection between pixels and kk-mers. CA-MER therefore unifies geometric visualization, histogram-based image representations, and classical compositional statistics within a single mathematical object (He et al., 27 Jun 2025).

1. Formal definition of CGR in the CA-MER framework

For the nucleotide alphabet Σ={A,C,G,T}\Sigma=\{A,C,G,T\}, CGR is defined on an axis-aligned square centered at the origin with side length $2$: {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}. The four vertices are assigned nucleotides by

kk0

Given a DNA sequence kk1, its CGR is the sequence of points kk2 defined by

kk3

Each base is therefore plotted at the midpoint between the previous point and the vertex associated with that base. In this formulation, CGR is an iterative affine map rather than a purely heuristic image-generation procedure.

A key object is the last point of the CGR of a word kk4, denoted kk5. If kk6 and kk7 with kk8, then the coordinates of the last point admit the closed form

kk9

This expression is central because it turns the recursive geometry of CGR into an explicit combinatorial encoding of Σ={A,C,G,T}\Sigma=\{A,C,G,T\}0-mers.

2. FCGR as discretized CGR and as a Σ={A,C,G,T}\Sigma=\{A,C,G,T\}1-mer count array

For a fixed order Σ={A,C,G,T}\Sigma=\{A,C,G,T\}2, the CGR square is partitioned into a uniform Σ={A,C,G,T}\Sigma=\{A,C,G,T\}3 grid. A grid cell of order Σ={A,C,G,T}\Sigma=\{A,C,G,T\}4 with indices Σ={A,C,G,T}\Sigma=\{A,C,G,T\}5 is centered at

Σ={A,C,G,T}\Sigma=\{A,C,G,T\}6

with matrix indexing convention Σ={A,C,G,T}\Sigma=\{A,C,G,T\}7 from top to bottom and Σ={A,C,G,T}\Sigma=\{A,C,G,T\}8 from left to right. The FCGR of order Σ={A,C,G,T}\Sigma=\{A,C,G,T\}9 is then the histogram

2k×2k2^k\times 2^k0

so FCGR is exactly the point density of CGR on the 2k×2k2^k\times 2^k1 grid.

For each 2k×2k2^k\times 2^k2-mer 2k×2k2^k\times 2^k3, the corresponding CGR cell 2k×2k2^k\times 2^k4 is the open square centered at 2k×2k2^k\times 2^k5 with side 2k×2k2^k\times 2^k6. The framework establishes three structural facts: 2k×2k2^k\times 2^k7 is the center of 2k×2k2^k\times 2^k8; the cells 2k×2k2^k\times 2^k9 for distinct kk0 are disjoint; and there are exactly kk1 such cells. Proposition 1 proves that these cells coincide with the grid partition: each kk2-mer corresponds to exactly one FCGR pixel, and each pixel corresponds to exactly one kk3-mer (He et al., 27 Jun 2025).

The central theorem states that for any sequence kk4 and any kk5-mer kk6 with kk7,

kk8

Thus the number of occurrences of kk9 in the sequence is exactly the number of CGR points falling in the cell associated with kk0. Combined with the bijection between kk1-mers and pixels, this yields Corollary 4: the FCGR matrix kk2 obtained by discretizing kk3 at resolution kk4 is exactly the array of kk5-mer counts. The same result also implies that no CGR point lies on a cell boundary, so the use of open cells is unambiguous.

A common misconception is that FCGR images at fixed order kk6 necessarily contain information beyond classical kk7-mer composition. In this framework they do not: at order kk8, FCGR, discretized CGR, and the kk9-mer count vector are exact reformulations of one another.

3. Pixel assignment, binary decoding, and lexicographic order

The correspondence between kk0-mers and FCGR pixels can be expressed geometrically or combinatorially. In the geometric form, if kk1 with kk2, the associated pixel indices are

kk3

Taken over all kk4, this produces a bijection between the kk5 pixels of the FCGR and the kk6 possible kk7-mers.

The paper also introduces a base-4 lexicographic indexing of kk8-mers using

kk9

and

Σ={A,C,G,T}\Sigma=\{A,C,G,T\}0

This induces the lexicographic order Σ={A,C,G,T}\Sigma=\{A,C,G,T\}1. If the pixel coordinates satisfy

Σ={A,C,G,T}\Sigma=\{A,C,G,T\}2

with Σ={A,C,G,T}\Sigma=\{A,C,G,T\}3, then Lemma 5 gives the inverse decoding rule

Σ={A,C,G,T}\Sigma=\{A,C,G,T\}4

The pixel indices therefore determine the Σ={A,C,G,T}\Sigma=\{A,C,G,T\}5-mer directly from the binary expansions of Σ={A,C,G,T}\Sigma=\{A,C,G,T\}6 and Σ={A,C,G,T}\Sigma=\{A,C,G,T\}7.

Proposition 6 further states that if Σ={A,C,G,T}\Sigma=\{A,C,G,T\}8 is the Σ={A,C,G,T}\Sigma=\{A,C,G,T\}9-mer with lexicographic index $2$0, then $2$1. This means that vectorization of FCGR in any consistent scan order is a re-ordering of the classical $2$2-mer frequency vector. The geometric image and the compositional vector differ only by indexing convention (He et al., 27 Jun 2025).

4. Dihedral symmetries and nucleotide permutations

Because CGR is defined on a square, its natural symmetry group is the dihedral group $2$3, consisting of four rotations and four reflections. The framework makes this correspondence explicit by mapping the geometric symmetries of the square to a subgroup $2$4 of nucleotide permutations. Examples include

$2$5

with analogous definitions for the remaining elements of $2$6. Each permutation is extended to words by monoid morphism.

Theorem 7 states that for words $2$7 and one of these eight permutations $2$8,

$2$9

where the right-hand side applies the corresponding {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.0 symmetry matrix to every CGR point. Geometric transformations of the CGR are therefore in one-to-one correspondence with specific renamings of nucleotides (He et al., 27 Jun 2025).

This result has two immediate consequences. First, the set of all CGR images of DNA sequences is closed under the eight square symmetries. Second, orientation normalization of CGR images can be interpreted as choosing a canonical representative in the {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.1-orbit, which is equivalent to fixing a canonical nucleotide labeling. A plausible implication is that image-level data augmentation by rotations or reflections is not generically label-preserving unless the downstream task is invariant under the corresponding nucleotide permutation.

The same symmetry principle extends to avoided {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.2-mers. If a sequence avoids a unique {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.3-mer {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.4 and a nucleotide permutation {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.5 is applied, then the transformed sequence avoids {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.6. In CGR terms, a symmetry that moves a hole corresponding to {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.7 yields a hole corresponding to {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.8.

5. Inverse CA-MER: reconstruction from prescribed {(x,y)∣−1<x<1,  −1<y<1}.\{(x,y)\mid -1 < x < 1,\; -1 < y < 1\}.9-mer distributions

The inverse direction of CA-MER starts from a target kk00-mer distribution or FCGR and reconstructs a DNA sequence with matching or approximately matching kk01-mer statistics. Using the base-4 indexing above, the kk02-mer frequency vector of a sequence kk03 is

kk04

and the empirical kk05-mer distribution is

kk06

These distributions must satisfy marginal consistency constraints arising from kk07-mer overlaps. For each kk08-mer kk09,

kk10

The reconstruction algorithm builds a De Bruijn multigraph of order kk11. Vertices are the kk12-mers appearing as prefixes or suffixes of kk13-mers with positive target count, and each kk14-mer kk15 with prefix kk16 and suffix kk17 contributes kk18 parallel edges from kk19 to kk20. Any Eulerian path in this multigraph corresponds to a sequence whose kk21-mer counts match the edge multiplicities. Exact realizability requires the integer balance condition

kk22

at every vertex, together with strong connectivity of the nonzero-edge subgraph.

Given kk23, sequence length kk24, and a target distribution kk25 satisfying the marginal constraints, the algorithm proceeds by scaling kk26 to pseudo-counts kk27, building the De Bruijn multigraph, computing the vertex imbalance

kk28

adding artificial edges along paths of length at most kk29 to balance the graph, optionally adding up to kk30 additional edges to ensure strong connectivity, constructing an Eulerian cycle with Hierholzer’s algorithm, and finally decoding the cycle into a DNA sequence (He et al., 27 Jun 2025).

Theorem 8 gives the approximation guarantee. If kk31, kk32, and kk33 satisfies the marginal constraints, then whenever

kk34

there exists an algorithm outputting a sequence kk35 whose empirical kk36-mer distribution kk37 satisfies

kk38

The error arises from rounding and from artificial balancing edges; the bound shows that any marginal-consistent kk39-mer distribution can be approximated to arbitrary precision by a sufficiently long synthetic sequence.

6. Synthetic CGR generation, empirical evaluation, and machine-learning use

Because the framework proves the equivalence

kk40

the reconstruction algorithm directly enables controllable synthesis of FCGR and CGR images. One specifies a target kk41-mer distribution kk42, reconstructs a sequence kk43 with kk44, and then computes kk45 or kk46. By the core equivalence theorem, the resulting image matches the target pixelwise kk47-mer statistics (He et al., 27 Jun 2025).

Two classes of experiments are reported. In template-based reconstruction from real genomes, the study samples a kk48k-bp fragment for each of kk49 species from each major kingdom, computes empirical kk50-mer distributions for kk51, reconstructs sequences, and measures total variation distance between original and reconstructed distributions. The reported errors are small and below the theoretical kk52 across kingdoms. In de-novo reconstruction, points are sampled from the relevant sub-polytope of kk53 satisfying the marginal constraints by a hit-and-run MCMC method. For kk54, sequences are reconstructed with

kk55

using kk56, and the observed reconstruction errors are all kk57.

The practical complexity is also stated explicitly. Building the De Bruijn multigraph is kk58; balancing and adding artificial edges is kk59 in the worst case; Eulerian cycle construction is kk60; and sequence generation is kk61. For moderate kk62, specifically kk63, and kk64, the reported web implementation runs in kk65 s and kk66 MB RAM on a laptop.

The machine-learning motivation is downstream analysis on FCGR or CGR images, including CNN-based taxonomic classification and contrastive or self-supervised approaches. The data specifically notes applications to CNN-based taxonomic classifiers using FCGR/CGR images, citing Rizzo 2016, Safoury and Hussein 2019, Avila Cartes et al. 2023, and DeepMicrobes-style architectures, as well as contrastive or self-supervised settings such as DeLUCS and CGRclust. Within this setting, synthetic reconstructions can preserve species-specific genomic signatures at the level of kk67-mer bias patterns while varying local sequence content.

7. Scope, interpretive consequences, and limitations of CA-MER

The theoretical significance of CA-MER is that it turns CGR and FCGR from visually motivated encodings into rigorously characterized representations of kk68-mer composition. At fixed order kk69, any numerical method operating on FCGR images is, in the strict sense established here, a method on kk70-mer frequencies. This suggests that convolutional filters learned on FCGR images should be interpreted as detectors of local structure in the ordered arrangement of kk71-mer counts rather than as exploiting information absent from the underlying kk72-mer vector (He et al., 27 Jun 2025).

The framework also clarifies the geometric semantics of CGR patterns. Fractal-looking regions, empty cells, and dense regions are no longer merely descriptive image features: each pixel corresponds to a specific kk73-mer, and absence or over-representation of that pixel corresponds to low or high count of that kk74-mer. Likewise, square symmetries are not arbitrary image manipulations but exact realizations of nucleotide permutations.

At the same time, the representational limits are explicit. For a given kk75, CA-MER ignores all structure beyond kk76-mer counts. Higher-order dependencies, longer motifs, and structural features are therefore not captured by the representation. Reconstruction is not unconstrained: marginal consistency must hold or be enforced, and sufficiently large sequence length is needed to obtain the stated approximation guarantees. The dimension kk77 also grows rapidly with kk78, so although FCGR has fixed size independent of sequence length, high-resolution CA-MER becomes increasingly expensive as kk79 increases.

Within those assumptions, CA-MER is a reversible representation up to approximation and length requirements. That reversibility supports controlled perturbation of genomic signatures, generation of synthetic FCGR/CGR images with prescribed statistics, and direct analysis of how changes in kk80-mer composition affect downstream alignment-free classification and representation learning.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to CA-MER.