standardise_obs: Prepare metadata

View source: R/standardise_obs.R

standardise_obsR Documentation

Prepare metadata

Description

Standardise metadata for any single-cell object.

Usage

standardise_obs(
  obj,
  save_path = NULL,
  species,
  standardise_species = TRUE,
  method = "gprofiler",
  level_cols = list(),
  extra_metadata = NULL,
  return_obs = FALSE,
  verbose = TRUE
)

Arguments

obj

A single-cell object supported by scKirby. See converters for a table of all supported conversions.

save_path

Path to save the modified obj to.

species

The name of the species that the single-cell obj came from. Can be provided as the scientific name (e.g. "Mus musculus") or common name (e.g. "mouse").

standardise_species

Standardise the name using map_species.

method

R package to use for gene mapping:

  • "gprofiler" : Slower but more species and genes.

  • "homologene" : Faster but fewer species and genes.

  • "babelgene" : Faster but fewer species and genes. Also gives consensus scores for each gene mapping based on a several different data sources.

level_cols

Names of metadata columns that indicate the hierarchically organized cell type annotation levels. Each level can be a combination of other columns, e.g.: list(level1="organ", level2=c("celltype"), level3=c("organ","celltype"))

extra_metadata

Extra metadata to add to obs. Can be a:

  • NULL : No extra metadata will be added (default).

  • data.frame : With the same number of rows as observations (samples) in obj. NOTE: We assumed the rows of the extra_metadata data.frame are in the same order as the observations (samples) in obj

  • list : A named list with a single entry per element, to be applied to all observation.

return_obs

Return just standardised obs instead of the entire obj.

verbose

Print messages.

Examples

obj <- example_obj()
obj2 <- standardise_obs()

bschilder/scKirby documentation built on April 22, 2024, 12:13 a.m.