troutpy.pl.urna_vs_source_score#
- troutpy.pl.urna_vs_source_score(sdata, y_var='extracellular_proportion', y_label=None, title=None, grid=False, saving_path=None, lfc_thresh=2, x_thresh=None, y_thresh=None, top_x_genes=None, bottom_x_genes=None, top_y_genes=None, bottom_y_genes=None, color='#1ad6b4', point_size=2, figsize=(6, 6), xlim=(0.5, 1.1), ylim=None, filename=None)#
Plot a per-gene Y-axis variable from
xrna_metadata.varagainst the mean source score.Genes are first filtered by
logfoldchange_over_noiseand can optionally be labeled based on coordinate thresholds and/or rank (top/bottom genes along either axis).- Parameters:
sdata (
SpatialData) – Spatial data object containingsource_scoreandxrna_metadatatables.y_var (
str(default:'extracellular_proportion')) – Column name fromsdata["xrna_metadata"].varto plot on the y-axis.y_label (
Optional[str] (default:None)) – Custom label for the y-axis. IfNone, defaults to"uRNA proportion"for"extracellular_proportion", otherwise defaults toy_var.title (
Optional[str] (default:None)) – Title to display at the top of the plot.grid (
bool(default:False)) – Whether to show background grid lines.saving_path (
Optional[str] (default:None)) – Directory to save the plot in. IfNone, the plot is not saved.lfc_thresh (
float(default:2)) – Minimumlogfoldchange_over_noisefor a gene to be included.x_thresh (
Optional[float] (default:None)) – If set, genes with a mean source score below this value are labeled.y_thresh (
Optional[float] (default:None)) – If set, genes withy_varabove this value are labeled.top_x_genes (
Optional[int] (default:None)) – Number of genes with the highest mean source score to label.bottom_x_genes (
Optional[int] (default:None)) – Number of genes with the lowest mean source score to label.top_y_genes (
Optional[int] (default:None)) – Number of genes with the highesty_varto label.bottom_y_genes (
Optional[int] (default:None)) – Number of genes with the lowesty_varto label.color (
str(default:'#1ad6b4')) – Color of the scatter points.point_size (
float(default:2)) – Size of the scatter points.figsize (
tuple[float,float] (default:(6, 6))) – Size of the figure.xlim (
tuple[float,float] |None(default:(0.5, 1.1))) – x-axis limits.ylim (
Optional[tuple[float,float]] (default:None)) – y-axis limits.filename (
Optional[str] (default:None)) – Filename to save the plot as. Defaults tof"scatter_{y_var}_vs_source_score.pdf".
- Return type:
- Returns:
None