tacco.utils.anndata2dataframe

anndata2dataframe(adata, obs_name=None, var_name=None, obs_keys=None, var_keys=None)[source]

Creates a long form DataFrame from an AnnData.

Parameters:
  • adata – A AnnData.

  • obs_name – The name of the obs column in the dataframe. If None, tries to use adata.obs.index.name.

  • var_name – The name of the var column in the dataframe. If None, tries to use adata.var.index.name.

  • obs_keys – The names of the obs columns to include in the dataframe.

  • var_key – The names of the var columns to include in the dataframe.

Returns:

A long form DataFrame.