Split AnnData object by levels in a specified meta data trait
splitAnnData.RdsplitAnnData splits a AnnData object by a given metadata column and write out the splitted data subsets into separate .h5ad files.
Arguments
- anndata_file
filename pointing to the AnnData file.
- split.by
column name in the metadata (i.e. in
SeuratObj@meta.dataconsidering the Seurat object, oradata.obsconsidering the AnnData object) indicating distinct levels to split the AnnData.- levels
vector of values which can be found in the column given by
split.by. Subsets of the Anndata by each value oflevelswill be made and written out into .h5ad files.- conda_env
character, if not
NULLthis named conda environment is used to perform the split. (Default: 'scicsr'). IfNULL, no conda environment will be used, the program assumes the python packagesscanpyandscveloare installed in the local python)