torchcell.graph.GeneGraph

class GeneGraph(*, name: str, graph: Graph, max_gene_set: GeneSet)[source]

Bases: ModelStrictArbitrary

Graph with genes as nodes, wrapping an nx.Graph.

classmethod validate_genes_in_graph(graph: Graph, info: ValidationInfo) → Graph[source]

Validate that all nodes in the graph are in the max_gene_set.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].