regvelo.plotting.plot_TF_regulon

regvelo.plotting.plot_TF_regulon(adata, rgv_model, cluster_key, TF, terminal_state_to_plot, coef_targets, coef_regulators, n_hits=10, device='cpu')[source]

Plot a TF’s regulon ranking, regulatory network, and cell-resolved weights.

Loads rgv_model, builds the inferred GRN and the mixed GRN (prior adata.uns['skeleton'] x inferred), and for both edge directions (targets of the TF and regulators of the TF) draws, for terminal_state_to_plot:

  • a ranking plot of the top n_hits regulon edges (by coefficient score), and

  • the corresponding signed regulatory-network diagram, once using the mixed GRN and once using the inferred GRN to sign the edges.

Finally, it draws per-cell GRN-weight UMAPs (via plot_grn_weight()) for the inferred-GRN top-hit targets and top-hit regulators.

Parameters:
  • adata (anndata.AnnData) – AnnData used to train rgv_model. Must contain uns["skeleton"] (the prior-GRN adjacency) and a UMAP embedding. Updated in place with the per-cell edge-weight columns added by plot_grn_weight().

  • rgv_model (str) – Path to a saved, trained RegVelo model directory (as produced by REGVELOVI.save). Loaded via REGVELOVI.load(rgv_model, adata) and used to infer the GRN.

  • cluster_key (str) – adata.obs column passed to rgv.tl.inferred_grn (the GRN grouping).

  • TF (str) – The transcription factor of interest. Must be a key of both coef_targets and coef_regulators and a gene in adata.var_names.

  • terminal_state_to_plot (str) – The single terminal state to rank edges for. Must match a column name in the coefficient tables in coef_targets/coef_regulators.

  • coef_targets (dict of str to DataFrame) – Per-TF target and regulator coefficient tables, keyed by TF, as returned by regvelo.tl.compute_TF_regulon().

  • coef_regulators (dict of str to DataFrame) – Per-TF target and regulator coefficient tables, keyed by TF, as returned by regvelo.tl.compute_TF_regulon().

  • n_hits (int, optional) – Number of top edges to show per ranking plot / network. Default 10.

  • device (str, optional) – Device used for GRN inference (e.g. "cuda:0" or "cpu"). Default "cpu".

Return type:

None

Returns:

: None

Figures are drawn (ranking plots, network diagrams, and weight UMAPs); no value is returned.