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_rateis the baseline rate, andperturb_rateis 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 byrgv.tl.markov_density_screening()), computesdelta_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 inadata.uns[key]['tf_hits'].- Parameters:
adata (anndata.AnnData) – AnnData holding the screening results in
adata.uns[key]. Updated in place withadata.uns[key]['tf_hits'].threshold (float, optional) – Magnitude cut-off on
delta_success_rate: a TF is a hit whendelta_success_rate < -threshold(depletion) ordelta_success_rate > threshold(increased density). TFs with|delta_success_rate| <= thresholdare excluded from both plots. Default0.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.unsunder 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. DefaultFalse.
- Returns:
: None
The hit TFs are stored in
adata.uns[key]['tf_hits'].