decoupler.pl.order_targets#
- decoupler.pl.order_targets(adata, net, source, order, score='score_ulm', label=None, nbins=100, top=10, pos_cmap='Reds', neg_cmap='Blues', color_score='#88c544', vmin=None, vmax=None, **kwargs)#
Plot a source score, together with its targets readouts, along a continuous ordered process such as pseudotime.
- Parameters:
- adata
AnnData Annotated data matrix with observations (rows) and features (columns).
- net
DataFrame Dataframe in long format. Must include
sourceandtargetcolumns, and optionally aweightcolumn.- source
str Which source from
netto show.- order
str The name of the column in
adata.obsto consider for ordering.- score
str(default:'score_ulm') adata.obsmkey where enrichment scores are stored.- label
str|None(default:None) The name of the column in
adata.obsto consider for coloring the grouping. By defaultNone.- nbins
int(default:100) Number of bins to use.
- top
int(default:10) How many targets to show ranked by their standard deviation along the ordered process.
- pos_cmap
str(default:'Reds') Colormap for targets with positive weights.
- net_cmap
Colormap for targets with negative weights.
- color_score
str(default:'#88c544') Color used to plot the enrichment score.
- vmin
int|float(default:None) Minimum value to color.
- vmax
int|float(default:None) Minimum value to color.
- ax
An existing
matplotlib.axes._axes.Axesinstance to plot on. IfNone, a new figure and axes will be created.- figsize
Size of the figure in inches as (width, height).
- dpi
Dots per inch for the figure resolution.
- return_fig
If
True, plotting methods should return the figure object instead of showing it.- save
If set, path to save the plot automatically to a file.
- adata
- Return type:
- Returns:
If
return_fig=True, returnsmatplotlib.figure.Figureinstance.
Example
import decoupler as dc adata, net = dc.ds.toy(pstime=True) dc.mt.ulm(adata, net, tmin=3) dc.pl.order_targets( adata=adata, net=net, label="group", source="T1", order="pstime", )