torchcell.datasets.CodonFrequencyDataset

class CodonFrequencyDataset(root: str, genome: SCerevisiaeGenome, transform: Callable[[...], Any] | None = None, pre_transform: Callable[[...], Any] | None = None)[source]

Bases: BaseEmbeddingDataset

Embedding dataset of CDS codon-frequency vectors per gene.

static parse_genome(genome: SCerevisiaeGenome | None) → ParsedGenome | None[source]

Extract the gene set into a picklable ParsedGenome (None if no genome).

initialize_model() → None[source]

Return None; codon frequencies need no embedding model.

process() → None[source]

Compute codon frequencies for each gene and save the collated dataset.

A gene whose CDS compute_codon_frequency refuses (empty, length not a multiple of three, or a base other than A/T/G/C) is excluded from the dataset. Each skip is logged at WARNING with the gene id and the refusal message, and the total is logged once at the end.