getCellProp: getCellProp

View source: R/analyseTree.R

getCellPropR Documentation

getCellProp

Description

getCellProp

Usage

getCellProp(phylo, clusters, samples, classes, excl_top_node_parent = TRUE)

Arguments

phylo

a phylogram with tip.labels corresponding to cell types/cluster contained in 'clusters' vector

clusters

a vector representing the cell type or cluster of each cell (can be character or numeric). If numeric, cluster names need to be consecutive starting from 1.

samples

a vector identifying the patient each cell belongs to

classes

a vector containing the patient outcome/class each cell belongs to

excl_top_node_parent

a boolean indicating whether the for cell types with the highest node as their parent

Value

a dataframe containing proportions calculated for each sample

Examples

library(SingleCellExperiment)
data(COVIDSampleData)

sce <- DeBiasi_COVID_CD8_samp
exprs <- t(assay(sce, "exprs"))
clusters <- colData(sce)$cluster_id
classes <- colData(sce)$condition
samples <- colData(sce)$sample_id

clust_tree <- getClusterTree(exprs,
                             clusters,
                             hierarchy_method="hopach")

prop_df <- getCellProp(clust_tree$clust_tree,
                        clusters=clusters,
                        samples=samples,
                        classes=classes)

adam2o1o/treekoR documentation built on June 2, 2023, 11:42 p.m.