torchcell.datasets.GraphEmbeddingDataset
- class GraphEmbeddingDataset(root: str, graph: Graph, model_name: str | None = None, transform: Callable[[...], Any] | None = None, pre_transform: Callable[[...], Any] | None = None, categorical_features: dict[str, Any] | None = None)[source]
Bases:
BaseEmbeddingDatasetNode-feature embeddings derived from an SGD gene graph.
Builds per-gene feature vectors (length, molecular weight, pI, expression, coordinates) plus chromosome and pathway categorical indices, optionally min-max normalized per the selected
model_name.- property processed_file_names: list[str]
Return the processed tensor and categorical-feature filenames.
- process() None[source]
Build node feature tensors and save them with categorical metadata.
A feature that is None is filled with that feature’s median; a value of 0 is a value and is kept. Chromosome and pathway indices are positions in the SORTED vocabulary of every value in the graph, so one category maps to one index and the indices do not depend on
PYTHONHASHSEED. Min-max normalization refuses a constant feature (ConstantFeatureError) rather than storing 0 / 0 = NaN, and a gene whose chromosome is None raisesMissingChromosomeError. On the cached SGDG_gene(6,607 genes) no feature has a 0 and none is constant and none lacks a chromosome (issue #518), so only the categorical indices differ from the old builds, and no consumer reads them.