episcanpy.api.pp.load_metadata

episcanpy.api.pp.load_metadata(adata, metadata_file, path='', separator=';', remove_index_str=None)

Load observational metadata in adata.obs. Input metadata file as csv/txt and the adata object to annotate.

first raw of the metadata file is considered as a header first column contain the cell name

adata: initial AnnData object

metadata_file: csv file containing as a first column the cell names and in the

rest of the columns any king of metadata to load

path: pathe to the metadata file

separator: ‘;’ or ” “, character used to split the columns

remove_index_str: a list of string to be removed in the index of AnnData object. Default value is None. For example, if the index is [‘/path/to/file1.txt’,’/path/to/file2.txt’] and remove_index_str = [‘/path/to/’,’.txt’], then the index of AnnData object will be changed to [‘file1’,’file2’]

Returns

Annotated AnnData