get_hclust: Cluster scRNA-Seq data hierarchically, within the input...

View source: R/get_hclust.R

get_hclustR Documentation

Cluster scRNA-Seq data hierarchically, within the input lables/cell types

Description

Basically, we use a 3 step approach: Iteratively go through all cell types available. Within one cell type: 1. Get the 'n.features.pre.pca' by 'feature.select.metric.FUN' 2. Calculate PCA, select n PCs such that 'perc.sd.in.pca' of the datas sd is explained 3. Use the PCA, to embedd the data in a 2D UMAP 4. Calculate the hierachical clustering in the UMAP (via R package "uwot") space

Usage

get_hclust(
  sc.counts,
  sc.pheno,
  cell.type.column,
  sample.name.column,
  n.features.pre.pca = 4000,
  feature.select.metric.FUN = sd,
  perc.sd.in.pca = 0.8,
  verbose = TRUE,
  linkage.method = "average"
)

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)'

n.features.pre.pca

1 < integer , number of features selected prior to PCA

feature.select.metric.FUN

function, that ranks the features of 'sc.counts'. Given a numeric vector, the function must return a single numeric. We pick the top features prior to PCA.

perc.sd.in.pca

0 < numeric <= 1. As many principal components are picked, such that at least 'perc.sd.in.pca' standard deviation of the data is explained

verbose

logical, should information about the process be printed.

linkage.method

string, passed to hclust as 'method'. There, it says: the agglomeration method to be used. This should be (an unambiguous abbreviation of) one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC).

Value

list of hclust() objects for all cell types


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