reorder_genes-ClusterSet-method: Reorder genes in a ClusterSet object.

reorder_genes,ClusterSet-methodR Documentation

Reorder genes in a ClusterSet object.

Description

Reorder genes in a ClusterSet object according to various ordering rules.

Usage

## S4 method for signature 'ClusterSet'
reorder_genes(
  object = NULL,
  order_by = c("gene_names", "hclust", "correlation"),
  method = c("pearson", "maximum", "manhattan", "canberra", "binary", "euclidean",
    "abspearson", "correlation", "abscorrelation", "spearman", "kendall"),
  link = c("average", "single", "complete", "ward", "mcquitty", "median", "centroid",
    "centroid2"),
  nb_proc = 2
)

Arguments

object

A ClusterSet object.

order_by

A character string specifying the ordering rule. Default is "gene_names" which reorder genes in alphanumerical order. If 'hclust', hierarchical clustering is applied. If 'correlation' the gene as ordered based on there similarity with the cluster center.

method

The distance measure to be used order_by=='hclust'.

link

The agglomeration method to be used if order_by=='hclust'.

nb_proc

The number of processor to be used if order_by=='hclust'.

Value

ClusterSet-class object

Examples

# Set verbosity to 1 to display info messages only.
set_verbosity(1)
# load a dataset
load_example_dataset('7871581/files/pbmc3k_medium_clusters')
                       
# Reorder genes using hierarchical clustering
pbmc3k_medium_clusters <- reorder_genes(pbmc3k_medium_clusters, order_by = "hclust")

# Plot heatmap of gene clusters
plot_heatmap(pbmc3k_medium_clusters)

# Reorder and plot
plot_heatmap(reorder_genes(pbmc3k_medium_clusters[1,], 
                           order_by = "gene_names"), 
             label_size = 5)


dputhier/dbfmcl documentation built on Dec. 20, 2024, 1:59 a.m.