scanpy.pl.umap参数设置
scanpy.pl.umap(adata, *, color=None, gene_symbols=None, use_raw=None, sort_order=True, edges=False, edges_width=0.1,
edges_color='grey', neighbors_key=None, arrows=False, arrows_kwds=None, groups=None, components=None, layer=None,
projection='2d', scale_factor=None, color_map=None, cmap=None, palette=None, na_color='lightgray', na_in_legend=True,
size=None, frameon=None, legend_fontsize=None, legend_fontweight='bold', legend_loc='right margin',
legend_fontoutline=None, vmax=None, vmin=None, vcenter=None, norm=None, add_outline=False, outline_width=(0.3, 0.05),
outline_color=('black', 'white'), ncols=4, hspace=0.25, wspace=None, title=None, show=None, save=None, ax=None,
return_fig=None, **kwargs)
Scatter plot in UMAP basis.
Parameters
adata : AnnData
Annotated data matrix.
color : str | Sequence[str] | None (default: None)
Keys for annotations of observations/cells or variables/genes, e.g., 'ann1' or ['ann1', 'ann2'].
gene_symbols : str | None (default: None)
Column name in .var DataFrame that stores gene symbols. By default var_names refer to the index column of the .var DataFrame. Setting this option allows alternative names use_raw : bool | None (default: None)
Use .raw attribute of adata for coloring with gene expression. If None, defaults to True if layer isn’t provided and adata.raw is present.
layer : str | None (default: None)
Name of the AnnData object layer that wants to be plotted. By default adata.raw.X is plotted. If use_raw=False is set, then adata.X is plotted. If layer is set to a valid layer name edges : bool (default: False)
Show edges.
edges_width : float (default: 0.1)
Width of edges.
edges_color : str | Sequence[float] | Sequence[str] (default: 'grey')
Color of edges. See draw_networkx_edges().
neighbors_key : str | None (default: None)
Where to look for neighbors connectivities. If not specified, this looks .obsp[‘connectivities’] for connectivities (default storage place ighbors). If specified, this looks .o arrows : bool (default: False)
Show arrows (deprecated in favour of scvelo.pl.velocity_embedding).
arrows_kwds : Mapping | None (default: None)
Passed to quiver()
fontweight属性bold
sort_order : bool (default: True)
For continuous annotations used as color parameter, plot data points with higher values on top of others.
groups : str | None (default: None)
Restrict to a few categories in categorical observation annotation. The default is not to restrict to any groups.
components : str | Sequence[str] (default: None)
For instance, ['1,2', '2,3']. To plot all available components use components='all'.
projection : {‘2d’, ‘3d’} (default: '2d')
Projection of plot (default: '2d').
legend_loc : str (default: 'right margin')
Location of legend, either 'on data', 'right margin' or a valid keyword for the loc parameter of Legend.
legend_fontsize : int | float | {‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’} | None (default: None)
Numeric size in pt or string describing the size. See set_fontsize().
legend_fontweight : int | {‘light’, ‘normal’, ‘medium’, ‘semibold’, ‘bold’, ‘heavy’, ‘black’} (default: 'bold')
Legend font weight. A numeric value in range 0-1000 or a string. Defaults to 'bold' if legend_loc == 'on data', otherwise to 'normal'. See set_fontweight().
legend_fontoutline : int | None (default: None)
legend_fontoutline : int | None (default: None)
Line width of the legend font outline in pt. Draws a white outline using the path effect withStroke.
size : float | Sequence[float] | None (default: None)
Point size. If None, is automatically computed as 120000 / n_cells. Can be a sequence containing the size for each cell. The order should be the same as in adata.obs.
color_map : Colormap | str | None (default: None)
Color map to use for continous variables. Can be a name or a Colormap instance (e.g. "magma”, "viridis" ividis), see get_cmap(). If None, the value Param palette : str | Sequence[str] | Cycler | None (default: None)
Colors to use for plotting categorical annotation groups. The palette can be a valid ListedColormap name ('Set2', 'tab20', …), a Cycler object, a dict mapping categories to colo na_color : str | Tuple[float, …] (default: 'lightgray')
Color to use for null or masked values. Can be anything matplotlib accepts as a color. Used for all points if color=None.
na_in_legend : bool (default: True)
If there are missing values, whether they get an entry in the legend. Currently only implemented for categorical legends.
frameon : bool | None (default: None)
Draw a frame around the scatter plot. Defaults to value set in set_figure_params(), defaults to True.
title : str | Sequence[str] | None (default: None)
Provide title for panels either as string or list of strings, e.g. ['title1', 'title2', ...].
vmin : str | float | (Sequence[float]) → float | Sequence[Union[str, float, Callable[[Sequence[float]], float]]] | None (default: None)
The value representing the lower limit of the color scale. Values smaller than vmin are plotted with the same color as vmin. vmin can be a number, a string, a function or None vmax : str | float | (Sequence[float]) → float | Sequence[Union[str, float, Callable[[Sequence[float]], float]]] | None (default: None)
The value representing the upper limit of the color scale. The format is the same as for vmin.
vcenter : str | float | (Sequence[float]) → float | Sequence[Union[str, float, Callable[[Sequence[float]], float]]] | None (default: None)
The value representing the center of the color scale. Useful for diverging colormaps. The format is the same as for vmin. Example: sc.pl.umap(adata, color=’TREM2’, vcenter= add_outline : bool | None (default: False)
If set to True, this will add a thin border around groups of dots. In some situations this can enhance the aesthetics of the resulting image
outline_color : Tuple[str, str] (default: ('black', 'white'))
Tuple with two valid color names used to adjust the add_outline. The first color is the border color (default: black), while the second color is a gap color between the border co outline_width : Tuple[float, float] (default: (0.3, 0.05))
Tuple with two width numbers used to adjust the outline. The first value is the width of the border color as a fraction of the scatter dot size (default: 0.3). The second value is w ncols : int (default: 4)
Number of panels per row.
wspace : float | None (default: None)
Adjust the width of the space between multiple panels.
hspace : float (default: 0.25)
Adjust the height of the space between multiple panels.
return_fig : bool | None (default: None)
Return the matplotlib figure.
kwargs
Arguments to pass to matplotlib.pyplot.scatter(), for instance: the maximum and minimum values (e.g. vmin=-2, vmax=5).
show : bool | None (default: None)
Show the plot, do not return axis.
save : bool | str | None (default: None)
If True or a str, save the figure. A string is appended to the default filename. Infer the filetype if ending on {'.pdf', '.png', '.svg'}.
ax : Axes | None (default: None)
A matplotlib axes object. Only works if plotting a single component.
Return type
Axes | List[Axes] | None
Returns
If show==False a Axes or a list of it.
Examples
import scanpy as sc

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。