regvelo.plotting.plot_TF_success_rate

regvelo.plotting.plot_TF_success_rate(adata, threshold=0.1, output_dir='.', key='markov_density_screening', save=False)[source]

Rank TFs by how their knockout affects differentiation to the terminal states.

The success rate measures how well cells reach the terminal states in the Markov density simulation: ctrl_rate is the baseline rate, and perturb_rate is the rate after a TF is knocked out in silico. Their relative change,

delta_success_rate = perturb_rate / ctrl_rate - 1,

quantifies whether the knockout disrupts normal differentiation toward the terminal states. A negative value means fewer cells complete the trajectory after knockout (the TF is required for normal differentiation), while a positive value means more cells reach the terminal states (the knockout promotes differentiation).

This function reads the per-TF result table from adata.uns[key]['dd_score_by_TF'] (populated by rgv.tl.markov_density_screening()), computes delta_success_rate, and draws two ranking plots: the strongest depletion hits (delta_success_rate < -threshold, differentiation impaired) and the strongest increased-density hits (delta_success_rate > threshold, differentiation promoted). The hit TFs shown across both plots are stored in adata.uns[key]['tf_hits'].

Parameters:
  • adata (anndata.AnnData) – AnnData holding the screening results in adata.uns[key]. Updated in place with adata.uns[key]['tf_hits'].

  • threshold (float, optional) – Magnitude cut-off on delta_success_rate: a TF is a hit when delta_success_rate < -threshold (depletion) or delta_success_rate > threshold (increased density). TFs with |delta_success_rate| <= threshold are excluded from both plots. Default 0.1.

  • output_dir (str, optional) – Directory to write the depletion/increase hit SVGs into when save=True. Default "." (current working directory).

  • key (str, optional) – Key in adata.uns under which the screening results are stored. Default "markov_density_screening".

  • save (bool, optional) – Whether to also write the ranking figures to SVG in output_dir. Default False.

Returns:

: None

The hit TFs are stored in adata.uns[key]['tf_hits'].