torchcell.graph.filter_by_contained_genes

filter_by_contained_genes(G_go: DiGraph, n: int, gene_set: set[str]) → DiGraph[source]

Return a new graph with nodes removed that contain fewer than n genes.

The original graph is not modified.

Parameters:
  • G_go – Input Gene Ontology graph

  • n – Minimum number of genes that must be contained in a GO term’s subtree

  • gene_set – Set of genes to filter against (can be None)

Returns:

A new filtered copy of the graph