getSampleCelltypeFreqs: Returns cell subtype distribution for each sample as a table

Description Usage Arguments Value Examples

View source: R/functions-getResults.R

Description

Returns cell subtype distribution for each single-cell sample along with (optional) final inhibitor cluster assignment

Usage

1
getSampleCelltypeFreqs(myobj, cluster_assignments = NULL)

Arguments

myobj

phemdObj object containing expression data for each sample in 'data' slot

cluster_assignments

Vector of cluster assignments to be included as additional column in output table (optional)

Value

Data frame representing relative frequencies of each cell subtype along with (optional) final inhibitor cluster assignment for each single-cell sample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
my_phemdObj <- createDataObj(all_expn_data, all_genes, as.character(snames_data))
my_phemdObj_lg <- removeTinySamples(my_phemdObj, 10)
my_phemdObj_lg <- aggregateSamples(my_phemdObj_lg, max_cells=1000)
my_phemdObj_monocle <- embedCells(my_phemdObj_lg, data_model = 'gaussianff', sigma=0.02, maxIter=2)
my_phemdObj_monocle <- orderCellsMonocle(my_phemdObj_monocle)
my_phemdObj_final <- clusterIndividualSamples(my_phemdObj_monocle)
my_phemdObj_final <- generateGDM(my_phemdObj_final)
my_EMD_mat <- compareSamples(my_phemdObj_final)
cluster_assignments <- groupSamples(my_EMD_mat, distfun = 'hclust', ncluster=4)
getSampleCelltypeFreqs(my_phemdObj_final, cluster_assignments)

phemd documentation built on Nov. 8, 2020, 8:15 p.m.