novae.plot
novae.plot.domains(adata, obs_key=None, slide_name_key=None, cell_size=10, ncols=4, fig_size_per_slide=(5, 5), na_color='#ccc', show=False, **kwargs)
Show the Novae spatial domains for all slides in the AnnData
object.
Info
Make sure you have already your Novae domains assigned to the AnnData
object. You can use model.assign_domains(...)
to do so.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData | list[AnnData]
|
An |
required |
obs_key |
str | None
|
Name of the key from |
None
|
slide_name_key |
str | None
|
Key of |
None
|
cell_size |
int | None
|
Size of the cells or spots. |
10
|
ncols |
int
|
Number of columns to be shown. |
4
|
fig_size_per_slide |
tuple[int, int]
|
Size of the figure for each slide. |
(5, 5)
|
na_color |
str
|
Color for cells that does not belong to any domain (i.e. cells with a too small neighborhood). |
'#ccc'
|
show |
bool
|
Whether to show the plot. |
False
|
**kwargs |
int
|
Additional arguments for |
{}
|
Source code in novae/plot/_spatial.py
novae.plot.domains_proportions(adata, obs_key=None, figsize=(2, 5))
Show the proportion of each domain in the slide(s).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData | list[AnnData]
|
One |
required |
obs_key |
str | None
|
The key in |
None
|
figsize |
tuple[int, int]
|
Matplotlib figure size. |
(2, 5)
|
Source code in novae/plot/_bar.py
novae.plot.pathway_scores(adata, pathways, obs_key=None, return_df=False, figsize=(10, 5), min_pathway_size=4, **kwargs)
Show a heatmap of pathway scores for each domain.
Info
Currently, this function only supports one slide per call.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
An |
required |
pathways |
dict[str, list[str]] | str
|
Either a dictionary of pathways (keys are pathway names, values are lists of gane names), or a path to a GSEA JSON file. |
required |
obs_key |
str | None
|
Key in |
None
|
return_df |
bool
|
Whether to return the DataFrame. |
False
|
figsize |
tuple[int, int]
|
Matplotlib figure size. |
(10, 5)
|
min_pathway_size |
int
|
Minimum number of known genes in the pathway to be considered. |
4
|
Returns:
Type | Description |
---|---|
DataFrame | None
|
A DataFrame of scores per domain if |
Source code in novae/plot/_heatmap.py
novae.plot.paga(adata, obs_key=None, **paga_plot_kwargs)
Plot a PAGA graph.
Info
Currently, this function only supports one slide per call.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
An AnnData object. |
required |
obs_key |
str | None
|
Name of the key from |
None
|
**paga_plot_kwargs |
int
|
Additional arguments for |
{}
|
Source code in novae/plot/_graph.py
novae.plot.spatially_variable_genes(adata, obs_key=None, top_k=5, show=False, cell_size=10, min_positive_ratio=0.05, return_list=False, **kwargs)
Plot the most spatially variable genes (SVG) for a given AnnData
object.
Info
Currently, this function only supports one slide per call.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
An |
required |
obs_key |
str | None
|
Key in |
None
|
top_k |
int
|
Number of SVG to be shown. |
5
|
show |
bool
|
Whether to show the plot. |
False
|
cell_size |
int
|
Size of the cells or spots ( |
10
|
min_positive_ratio |
float
|
Genes whose "ratio of cells expressing it" is lower than this threshold are not considered. |
0.05
|
return_list |
bool
|
Whether to return the list of SVG instead of plotting them. |
False
|
**kwargs |
int
|
Additional arguments for |
{}
|
Returns:
Type | Description |
---|---|
None | list[str]
|
A list of SVG names if |