cellrank.pl.log_odds¶
- cellrank.pl.log_odds(adata, lineage_1, lineage_2=None, time_key='exp_time', backward=False, keys=None, threshold=None, threshold_color='red', layer=None, use_raw=False, size=2.0, cmap='viridis', alpha=0.8, ncols=None, fontsize=None, xticks_step_size=1, legend_loc='best', jitter=True, seed=None, figsize=None, dpi=None, save=None, show=True, **kwargs)[source]¶
Plot log-odds ratio between trajectories.
This plotting function is geared towards time-series datasets that have been analyzed using the
RealTimeKernel
. It visualizes log-odd ratios between different trajectories per cell, with the option to color in certain molecular features, like genes. This can be useful to detect and visualize fate-decisive genes.- Parameters:
adata (
AnnData
) – Annotated data object.lineage_1 (
str
) – The first lineage for which to compute the log-odds.lineage_2 (
Optional
[str
]) – The second lineage for which to compute the log-odds. IfNone
, use the rest of the lineages.time_key (
str
) – Key inobs
containing the experimental time.backward (
bool
) – Direction of the process.keys (
Union
[str
,Sequence
[str
],None
]) – Key inobs
orvar_names
.threshold (
Union
[float
,Sequence
,None
]) – Visualize whether total expression per cell is greater thanthreshold
. If aSequence
, it should be the same length askeys
.threshold_color (
str
) – Color to use when plotting thresholded expression values.layer (
Optional
[str
]) – Which layer to use to get expression values. IfNone
or'X'
, useX
.use_raw (
bool
) – Whether to accessraw
. IfTrue
,layer
is ignored.size (
float
) – Size of the dots.cmap (
str
) – Colormap to use for continuous variables inkeys
.fontsize (
Union
[float
,str
,None
]) – Size of the font for the title, x- and y-label.xticks_step_size (
Optional
[int
]) – Show only every other n-th tick on the x-axis. IfNone
, don’t show any ticks.legend_loc (
Optional
[str
]) – Position of the legend. IfNone
, do not show the legend.jitter (
Union
[bool
,float
]) – Amount of jitter to apply along x-axis.seed (
Optional
[int
]) – Seed forjitter
to ensure reproducibility.figsize (
Optional
[tuple
[float
,float
]]) – Size of the figure.save (
Union
[Path
,str
,None
]) – Filename where to save the plot.kwargs (
Any
) – Keyword arguments forstripplot()
.
- Return type:
- Returns:
: Nothing, just plots the figure. Optionally saves it based on
save
. Ifshow = False
, returns the axes object.