troutpy.pl.diffusion_results#
- troutpy.pl.diffusion_results(sdata, x_col='mean_displacement', y_col='-log_ks_pval', non_control_probes=None, label_top_n_x=0, label_top_n_y=0, label_bottom_n_x=0, label_bottom_n_y=0, y_logscale=False, title=None, palette='troutpy', save=False, figures_path='', custom_plot_filename=None)#
Scatter plot of two diffusion metrics per probe, colored by control-probe status.
- Parameters:
sdata (
SpatialData) – SpatialData object containing anxrna_metadatatable whose.varholds the diffusion metrics and a booleancontrol_probecolumn.x_col (
str(default:'mean_displacement')) – Column insdata["xrna_metadata"].varto plot on the x-axis.y_col (
str(default:'-log_ks_pval')) – Column insdata["xrna_metadata"].varto plot on the y-axis.non_control_probes (
Optional[list[str]] (default:None)) – If provided, probes are kept only if they are flagged as control probes or their name is in this list.label_top_n_x (
int(default:0)) – Number of probes with the highestx_colvalues to label.label_top_n_y (
int(default:0)) – Number of probes with the highesty_colvalues to label.label_bottom_n_x (
int(default:0)) – Number of probes with the lowestx_colvalues to label.label_bottom_n_y (
int(default:0)) – Number of probes with the lowesty_colvalues to label.y_logscale (
bool(default:False)) – Whether to plot the y-axis on a log scale.title (
Optional[str] (default:None)) – Custom title for the plot.palette (
str(default:'troutpy')) – Two-color palette name, resolved viatroutpy.pl.get_palette(), used for control vs. non-control probes."default"uses a hardcoded crimson/blue pair.save (
bool(default:False)) – Whether to save the figure tofigures_pathinstead of showing it.figures_path (
str(default:'')) – Directory to save the figure in, ifsaveisTrue.custom_plot_filename (
Optional[str] (default:None)) – Custom filename for the saved figure. IfNone, defaults tof"diffusion_results_{x_col}_vs_{y_col}.pdf".
- Return type:
- Returns:
None