Split AnnData object by levels in a specified meta data trait
splitAnnData.Rd
splitAnnData
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.data
considering the Seurat object, oradata.obs
considering 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 oflevels
will be made and written out into .h5ad files.- conda_env
character, if not
NULL
this named conda environment is used to perform the split. (Default: 'scicsr'). IfNULL
, no conda environment will be used, the program assumes the python packagesscanpy
andscvelo
are installed in the local python)