Plotting¶
-
picturedrocks.plot.
genericplot
(celldata, coords, **scatterkwargs)¶ Generate a figure for some embedding of data
This function supports both 2D and 3D plots. This may be used to plot data for any embedding (e.g., PCA or t-SNE). For example usage, see code for pcafigure.
Parameters: - celldata (anndata.AnnData) – data to plot
- coords (numpy.ndarray) – (N, 2) or (N, 3) shaped coordinates of the embedded data
- **scatterkwargs – keyword arguments to pass to
Scatter
orScatter3D
in plotly (dictionaries are merged recursively)
-
picturedrocks.plot.
genericwrongplot
(celldata, coords, yhat, labels=None, **scatterkwargs)¶ Plot figure with incorrectly classified points highlighted
This can be used with any 2D or 3D embedding (e.g., PCA or t-SNE). For example code, see pcawrongplot.
Parameters: - celldata (anndata.AnnData) – data to plot
- coords (numpy.ndarray) – (N, 2) or (N, 3) shaped array with coordinates to plot
- yhat (numpy.ndarray) – (N, 1) shaped array of predicted y values
- labels (list, optional) – list of axis titles
- **scatterkwargs – keyword arguments to pass to
Scatter
orScatter3D
in plotly (dictionaries are merged recursively)
-
picturedrocks.plot.
pcafigure
(celldata, **scatterkwargs)¶ Make a 3D PCA figure for an AnnData object
Parameters: - celldata (anndata.AnnData) – data to plot
- **scatterkwargs – keyword arguments to pass to
Scatter
orScatter3D
in plotly (dictionaries are merged recursively)
-
picturedrocks.plot.
pcawrongplot
(celldata, yhat, **scatterkwargs)¶ Generate a 3D PCA figure with incorrectly classified points highlighted
Parameters: - celldata (anndata.AnnData) – data to plot
- yhat (numpy.ndarray) – (N, 1) shaped array of predicted y values
- **scatterkwargs – keyword arguments to pass to
Scatter
orScatter3D
in plotly (dictionaries are merged recursively)
-
picturedrocks.plot.
plotgeneheat
(celldata, coords, genes, hide_clusts=False, **scatterkwargs)¶ Generate gene heat plot for some embedding of AnnData
This generates a figure with multiple dropdown options. The first option is “Clust” for a plot similar to genericplot, and the remaining dropdown options correspond to genes specified in genes. When celldata.genes is defined, these drop downs are labeled with the gene names.
Parameters: - celldata (anndata.AnnData) – data to plot
- coords (numpy.ndarray) – (N, 2) or (N, 3) shaped coordinates of the embedded data (e.g., PCA or tSNE)
- genes (list) – list of gene indices or gene names
- hide_clusts (bool) – Determines if cluster labels are ignored even if they are available
-
picturedrocks.plot.
umapfigure
(adata, **scatterkwargs)¶