add_subtype_pheno: add subtype pheno

View source: R/add_subtype_pheno.R

add_subtype_phenoR Documentation

add subtype pheno

Description

Use a hierarchical clustering of the input labels, to generate finer subtype labels. The basic steps are: 1. use the get_hclust function to hierarchically cluster the data within the cell types. (or use the provided hclust.obj) 2. cluster the data multiple times, with different depth (as indicated by 'avg.profiles.per.subcluster.vec') 3. provide the clustering labels as columns in sc.pheno, and return it.

Usage

add_subtype_pheno(
  sc.counts,
  sc.pheno,
  cell.type.column = "cell_type",
  sample.name.column = "sample.name",
  new.subtype.column = "subtype",
  hclust.obj = NA,
  n.clusters = c(1, 2, 4, 8),
  verbose = TRUE,
  ...
)

Arguments

sc.counts

count matrix, features as rows, scRNA-Seq profiles as columns

sc.pheno

data.frame. scRNA-Seq profiles as rows. Must have 'cell.type.column' and 'sample.name.column'

cell.type.column

string, column of 'sc.pheno' holding the input cell type labels. Within these entries, the clustering is done.

sample.name.column

string, column of the 'colnames(sc.counts)'

new.subtype.column

string, pattern of the new column, where the subtype information is stored

hclust.obj

'hclust' object, or NA. If you already calculated a hclust, object pass it here. Alternatively, we call the get_hclust function.

n.clusters

integer vector of clustering depths (number of subclusters created for each cell type), default c(1, 2, 4, 8). This means that in the finest clustering, each celltype will be split in 8 subtypes, in the next step each will be split in 4 subtypes, ...

verbose

logical, should information about the process be printed.

...

arguments that are passed to get_hclust

Value

data.frame sc.pheno, with added subtype column


MarianSchoen/DMC documentation built on Aug. 2, 2022, 3:05 p.m.