fix_celltype_names: Fix celltype names

View source: R/fix_celltype_names.R

fix_celltype_namesR Documentation

Fix celltype names

Description

Make sure celltypes don't contain characters that could interfere with downstream analyses. For example, the R package MAGMA.Celltyping cannot have spaces in celltype names because spaces are used as a delimiter in later steps.

Usage

fix_celltype_names(
  celltypes,
  replace_chars = "[-]|[.]|[ ]|[//]|[\\/]",
  make_unique = TRUE
)

Arguments

celltypes

Character vector of celltype names.

replace_chars

Regex string of characters to replace with "_" when renaming columns.

make_unique

Make all entries unique.

Value

Fixed celltype names.

Examples

ct <- c("microglia", "astryocytes", "Pyramidal SS")
ct_fixed <- fix_celltype_names(celltypes = ct)

NathanSkene/EWCE documentation built on Nov. 3, 2024, 8:16 a.m.