celldancer.adata_to_df_with_embed

celldancer.adata_to_df_with_embed(adata, us_para=['Mu', 'Ms'], cell_type_para='celltype', embed_para='X_umap', save_path='cell_type_u_s_sample_df.csv', gene_list=None)

Convert adata to pandas.DataFrame format and save it as csv file with embedding info.

Parameters
  • adata (anndata._core.anndata.AnnData) – The adata to be transferred.

  • us_para (list (default: [‘Mu’,’Ms’])) – The attributes of the two count matrices of pre-mature (unspliced) and mature (spliced) abundances from adata.layers. By default, splice and unsplice columns (the two count matrices of spliced and unspliced abundances) are obtained from the [‘Ms’, ‘Mu’] attributes of adata.layers.

  • cell_type_para (str (default: ‘celltype’)) – The attribute of cell type to be obtained from adata.obs. By default, cell type information is obtained from [‘celltype’] column of adata.obs.

  • embed_para (str (default: ‘X_umap’)) – The attribute of embedding space to be obtained from adata.obsm. It represents the 2-dimensional representation of all cells. The embedding1 and embedding2 columns are obtained from [‘X_umap’] attribute of adata.obsm.

  • save_path (str (default: ‘cell_type_u_s_sample_df.csv’)) – Path to save the result of transferred csv file.

  • gene_list (list (default: None)) – Specific gene(s) to be transfered.

Returns

raw_data – pandas DataFrame with columns gene_name, unsplice, splice, cellID, clusters, embedding1, embedding2.

Return type

pandas.DataFrame