umap
umap ¶
umap(
data,
color=None,
layer=None,
useRaw=False,
log=False,
label="umap",
cmap="vlag",
palette=None,
alpha=0.8,
figsize=(5, 5),
s=None,
ncols=None,
tightLayout=False,
outputDir=None,
fileName="umap.pdf",
show=True,
returnData=False,
returnFig=False,
dpi=300,
transparent=False,
sdataTable=None,
**kwargs
)
Scatter a UMAP embedding, coloured by obs columns or markers.
Reads the embedding from adata.obsm[label], which
sp.tl.umap writes. Pass a list to color for a grid of
panels, one per key. Numeric keys get a continuous colormap and a colourbar;
categorical keys get a discrete palette and a legend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
(AnnData | SpatialData | str, required)
|
The cell table. An |
required |
color
|
str | list
|
What to colour by. Each entry is looked up in |
None
|
layer
|
str
|
Which matrix to read marker values from. |
None
|
useRaw
|
bool
|
Read marker values from |
False
|
log
|
bool
|
Apply |
False
|
label
|
str
|
Key in |
'umap'
|
cmap
|
str
|
Colormap for numeric keys. |
'vlag'
|
palette
|
str
|
Matplotlib colormap name used to build the discrete palette for
categorical keys. Defaults to |
None
|
alpha
|
float
|
Point opacity. |
0.8
|
figsize
|
tuple
|
Size of a single panel in inches. |
(5, 5)
|
s
|
float
|
Point size. Defaults to 5. |
None
|
ncols
|
int
|
Panels per row. Defaults to |
None
|
tightLayout
|
bool
|
Call |
False
|
fileName
|
str
|
File name for the saved figure. The extension decides the format. |
'umap.pdf'
|
outputDir
|
str
|
Directory to save the figure in. When |
None
|
show
|
bool
|
Call |
True
|
returnData
|
bool
|
Return the |
False
|
returnFig
|
bool
|
Return |
False
|
dpi
|
int
|
Resolution of the saved figure. |
300
|
transparent
|
bool
|
Save with a transparent background. |
False
|
sdataTable
|
str
|
Which |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
result |
None | DataFrame | tuple
|
|