grassp.tl.load_gmt

Contents

grassp.tl.load_gmt#

load_gmt(source=None, species='hsap', deduplicate_terms=True)[source]#

Resolve a gene-set source into a {term: [gene, ...]} dict.

Parameters:
source Union[str, Mapping[str, Sequence[str]], None] (default: None)

One of:

  • dict / mapping — returned as a plain {name: list(genes)} dict.

  • existing file path — parsed as GMT (tab-separated; column 0 = term name, column 1 = description/source and is discarded, columns 2+ = gene identifiers).

  • None or a non-path string — delegated to grassp.tools.enrichment._load_gmt() (uses the consolidated UniProt subcellular-location sets bundled with grassp, or a gseapy library name), if grassp is importable.

species str (default: 'hsap')

Passed through to grassp when source is None; one of "hsap", "mmus", "scer".

deduplicate_terms bool (default: True)

If True (default), collapse terms with identical gene membership (keeping the first-seen name); see grassp.tools.enrichment._deduplicate_gene_sets().

Return type:

dict[str, list[str]]

Returns:

dict[str, list[str]] Mapping of term name to list of gene identifiers.