retrieve#

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.

Examples

import scanpy as sc
from lets_plot import *

import cellestial as cl

data = sc.read_h5ad("data/pbmc3k_pped.h5ad")
umap = cl.umap(data,key="CD14",axis_type="arrow",color_high="red")

cl.retrieve(umap).head()
shape: (5, 34)
Barcodesamplen_genes_by_countslog1p_n_genes_by_countstotal_countslog1p_total_countspct_counts_in_top_50_genespct_counts_in_top_100_genespct_counts_in_top_200_genespct_counts_in_top_500_genestotal_counts_mtlog1p_total_counts_mtpct_counts_mttotal_counts_ribolog1p_total_counts_ribopct_counts_ribototal_counts_hblog1p_total_counts_hbpct_counts_hbn_genesdoublet_scorepredicted_doubletleidenleiden_res_0.02leiden_res_0.50leiden_res_2.00cell_type_lvl1X_PCA1X_PCA2X_TSNE1X_TSNE2X_UMAP1X_UMAP2CD14
strcati32f64f32f32f64f64f64f64f32f32f32f32f32f32f32f32f32i64f64boolcatcatcatcatcatf32f32f32f32f32f32f32
"AAACCCAAGGATGGCT-1""s1d1"21037.6515968663.09.06693242.72192159.66755269.74489279.348955460.06.1333985.3099383650.08.20275642.13320917.02.8903720.19623721030.036113false"0""0""0""0""Lymphocytes"-2.698756-1.97092334.229698-30.396513-0.7587099.419350.0
"AAACCCAAGGCCTAGA-1""s1d1"39168.27308112853.09.46141135.84377244.2620452.37687762.7635571790.07.4905313.926711719.07.45007913.3743158.04.0775380.45125739120.183381false"2""1""1""1""Monocytes"-5.0511049.427238-9.45950365.0664981.472651-2.3618040.375316
"AAACCCAAGTGAGTGC-1""s1d1"6836.5279581631.07.39756256.28448862.59963270.38626688.77989581.06.3664735.62231863.04.1588833.86266113.02.6390570.7970576830.04532false"3""2""2""2""Erythroid"-2.535384-1.728063-63.691681-6.7060053.40767316.2633710.0
"AAACCCACAAGAGGCT-1""s1d1"43308.37355417345.09.76111727.6621538.42029448.90170162.023638780.06.6605754.4969733936.08.27817422.69241744.03.8066630.25367543280.04532false"5""0""3""3""Lymphocytes"-3.8464531.094153-40.50571157.683064-0.0565423.4952220.0
"AAACCCACATCGTGGC-1""s1d1"3255.786897555.06.32076849.9099159.45945977.477477100.0159.05.07517428.64864726.03.2958374.68468526.03.2958374.6846853230.016181false"6""0""4""4""Lymphocytes"0.211629-1.380853-26.950605-43.669479-5.4132158.5375830.0