printClusterAssignments: Writes samples to file based on community detection group...

View source: R/functions-getResults.R

printClusterAssignmentsR Documentation

Writes samples to file based on community detection group assignments

Description

Takes vector of cluster assignments and phemdObj containing sample names and writes sample groups to file

Usage

printClusterAssignments(cluster_assignments, obj, dest, overwrite = FALSE)

Arguments

cluster_assignments

Vector containing group assignments for each sample

obj

phemdObj object containing sample names in @snames slot

dest

Path to existing directory where output should be saved

overwrite

Boolean representing whether or not to overwrite contents of "dest" with output of printClusterAssignments

Details

Order of samples in obj@snames is assumed to be the same as the order of group assignments in cluster_assignments

Value

None

Examples


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)
printClusterAssignments(cluster_assignments, my_phemdObj_final, '.', overwrite=TRUE)


wschen/phemd documentation built on Oct. 1, 2024, 4:45 a.m.