torchcell.datasets.CodonFrequencyDataset
- class CodonFrequencyDataset(root: str, genome: SCerevisiaeGenome, transform: Callable[[...], Any] | None = None, pre_transform: Callable[[...], Any] | None = None)[source]
Bases:
BaseEmbeddingDatasetEmbedding 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).
- process() None[source]
Compute codon frequencies for each gene and save the collated dataset.
A gene whose CDS
compute_codon_frequencyrefuses (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.