retrieve#

API pages include interactive (HTML) plots that would possibly not render correctly on a mobile device.

retrieve(plot: PlotSpec | SupPlotsSpec, index: int = 0) DataFrame#

Retrieves the dataframe from a PlotSpec or SupPlotsSpec using the index.

Parameters:
  • plot (PlotSpec | SupPlotsSpec) – The plot to retrieve the dataframe from.

  • index (int, default 0) – The index of the figure to retrieve the dataframe from.

Returns:

DataFrame – The dataframe utilized in the plot.

Raises:
  • TypeError – If the plot is not a PlotSpec or SupPlotsSpec object.

  • ValueError – If no DataFrame can be retrieved from the plot.

Examples

import scanpy as sc
from lets_plot import *

import cellestial as cl

data = cl.datasets.pbmc3k(cache_directory="data")
umap = cl.umap(data,key="CD14",axis_type="arrow",color_high="red")

cl.retrieve(umap).head()
shape: (5, 8)
BarcodeX_PCA1X_PCA2X_TSNE1X_TSNE2X_UMAP1X_UMAP2CD14
strf32f32f32f32f32f32f32
"AAACCCAAGGATGGCT-1"-2.698756-1.97092334.229698-30.396513-0.7587099.419350.0
"AAACCCAAGGCCTAGA-1"-5.0511049.427238-9.45950365.0664981.472651-2.3618040.375316
"AAACCCAAGTGAGTGC-1"-2.535384-1.728063-63.691681-6.7060053.40767316.2633710.0
"AAACCCACAAGAGGCT-1"-3.8464531.094153-40.50571157.683064-0.0565423.4952220.0
"AAACCCACATCGTGGC-1"0.211629-1.380853-26.950605-43.669479-5.4132158.5375830.0