rapids_singlecell.dcg.query_set#

rapids_singlecell.dcg.query_set(features, net, alternative='greater', n_bg=20000, ha_corr=0.5, tmin=5, verbose=False, *, background=None)[source]#

Test a list of features for overlap with each feature set in a network.

Parameters:
features Iterable[str]

Selected names; deduplicated, including names absent from the network.

net DataFrame

source/target sets; weights ignored, duplicate pairs rejected.

alternative Literal['greater', 'less', 'two-sided'] (default: 'greater')

Fisher test alternative: 'greater' for enrichment, 'less' for depletion, or 'two-sided' for either direction.

n_bg int | float | None (default: 20000)

Integer-truncated background size; must fit each query-set union. None or zero uses the union of query and pruned network targets.

background Iterable[str] | None (default: None)

Background names, deduplicated, containing all selected features. Its size replaces n_bg; other network targets are removed before tmin.

ha_corr int | float (default: 0.5)

Haldane-Anscombe correction for log odds ratios; p-values are unaffected.

tmin int | float (default: 5)

Minimum targets per source within the background, before query overlap.

verbose bool (default: False)

Whether to log progress.

Return type:

DataFrame

Returns:

DataFrame with columns source, stat (natural log corrected odds ratio), pval (Fisher p-value), and padj (Benjamini-Hochberg adjusted p-value), sorted by padj and then pval. Includes zero-overlap sets.