clusterGenes: Clusters genes by pseudotime trend.

Description Usage Arguments Value Examples

View source: R/clustering.R

Description

This function takes a matrix of expression values and performs k-means clustering on the genes.

Usage

1
2
clusterGenes(expr_matrix, k, method = function(x) {     as.dist((1 -
  cor(Matrix::t(x)))/2) }, ...)

Arguments

expr_matrix

A matrix of expression values to cluster together. Rows are genes, columns are cells.

k

How many clusters to create

method

The distance function to use during clustering

...

Extra parameters to pass to pam() during clustering

Value

a pam cluster object

Examples

1
2
3
4
5
6
7
8
## Not run: 
full_model_fits <- fitModel(HSMM[sample(nrow(fData(HSMM_filtered)), 100),],  
   modelFormulaStr="~sm.ns(Pseudotime)")
expression_curve_matrix <- responseMatrix(full_model_fits)
clusters <- clusterGenes(expression_curve_matrix, k=4)
plot_clusters(HSMM_filtered[ordering_genes,], clusters)

## End(Not run)

monocle documentation built on Nov. 8, 2020, 5:06 p.m.