regvelo.tools.compute_TF_regulon¶
- regvelo.tools.compute_TF_regulon(adata, rgv_model, cluster_key, TF, TERMINAL_STATES, threshold=0.4, n_states=7, n_samples=50, n_cells=30, solver='direct')[source]¶
Scan each candidate TF’s regulon (targets and regulators) and save scores.
For every TF in
TF, extracts the inferred GRN weights from the trained model, identifies that TF’s targets and regulators abovethreshold(by absolute weight), and runsrgv.tl.regulation_scanningfor both edge sets, returning the per-edge coefficient tables keyed by TF.- Parameters:
adata (anndata.AnnData) – AnnData used to train
rgv_model. Must containuns["skeleton"](the prior-GRN adjacency) whose row/column labels name targets/regulators.rgv_model (str) – Path to a saved, trained RegVelo model directory (as produced by
REGVELOVI.save). Loaded viaREGVELOVI.load(rgv_model, adata)to access the inferred GRN, and passed as-is torgv.tl.regulation_scanning.cluster_key (str) –
adata.obscolumn used as the cluster label during scanningTF (str or list of str) – Candidate transcription factor(s) to scan.
TERMINAL_STATES (list of str) – Terminal-state labels passed to
rgv.tl.regulation_scanning.threshold (float, optional) – Absolute GRN-weight cutoff for retaining an edge as a target/regulator. Default
0.4.n_states (int, optional) – Number of macrostates used by
regulation_scanning. Default7.n_samples (int, optional) – Number of samples drawn per scan. Default
50.n_cells (int, optional) – Number of cells per macrostate, passed to
rgv.tl.regulation_scanning. Default30.solver (str, optional) – Linear solver passed to
rgv.tl.regulation_scanning. Default"direct".
- Returns:
: coef_targets, coef_regulators: dict of str to DataFrame
Per-TF target and regulator coefficient tables, keyed by TF, to be passed as the
coef_targets/coef_regulatorsarguments ofregvelo.pl.plot_TF_regulon().