set (clustergram)

Set property of clustergram object

Syntax

set(CGobj)
set(CGobj, 'PropertyName')
set(CGobj, 'PropertyName', PropertyValue)
set(CGobj, 'Property1Name', Property1Value, 'Property2Name', Property2Value, ...)

Arguments

CGobjClustergram object created with the function clustergram.
PropertyNameProperty name for a clustergram object.

Description

    Note:   You cannot set the properties of a clustergram object if you created it using the Export Group to Workspace command in the Clustergram window.

set(CGobj) displays possible values for all properties that have a fixed set of property values in CGobj, a clustergram object.

set(CGobj, 'PropertyName') displays possible values for a specific property that has a fixed set of property values in CGobj, a clustergram object.

set(CGobj, 'PropertyName', PropertyValue) sets the specified property of CGobj, a clustergram object.

set(CGobj, 'Property1Name', Property1Value, 'Property2Name', Property2Value, ...) sets the specified properties of CGobj, a clustergram object.

Properties of a Clustergram Object

PropertyDescription
RowLabelsVector of numbers or cell array of text strings to label the rows in the dendrogram and heat map. Default is a vector of values 1 through M, where M is the number of rows in Data, the matrix of data used by the clustergram function to create the clustergram object.
ColumnLabelsVector of numbers or cell array of text strings to label the columns in the dendrogram and heat map. Default is a vector of values 1 through N, where N is the number of columns in Data, the matrix of data used by the clustergram function to create the clustergram object.
Standardize

Numeric value that specifies the dimension for standardizing the values in Data, the matrix of data used to create the clustergram object. The standardized values are transformed so that the mean is 0 and the standard deviation is 1 in the specified dimension. Choices are:

  • 'column' or 1 — Standardize along the columns of data.

  • 'row' or 2 — Standardize along the rows of data.

  • 'none' or 3 (default) — Do not standardize.

Cluster

Numeric value that specifies the dimension for clustering the values in Data, the matrix of data used to create the clustergram object. Choices are:

  • 1 — Cluster rows of data only.

  • 2 — Cluster columns of data only.

  • 3 — Cluster rows of data, then cluster columns of row-clustered data.

RowPdist

String that specifies the distance metric to pass to the pdist function (Statistics Toolbox™ software) to use to calculate the pairwise distances between rows. For information on choices, see the pdist function.

    Note:   If the distance metric requires extra arguments, then RowPdistValue is a cell array. For example, to use the Minkowski distance with exponent P, you would use {'minkowski', P}.

ColumnPdist

String that specifies the distance metric to pass to the pdist function (Statistics Toolbox software) to use to calculate the pairwise distances between columns. For information on choices, see the pdist function.

    Note:   If the distance metric requires extra arguments, then ColumnPdistValue is a cell array. For example, to use the Minkowski distance with exponent P, you would use {'minkowski', P}.

LinkageString or two-element cell array of strings that specifies the linkage method to pass to the linkage function (Statistics Toolbox software) to use to create the hierarchical cluster tree for rows and columns. If a two-element cell array of strings, the first element is used for linkage between rows, and the second element is used for linkage between columns. For information on choices, see the linkage function.
DendrogramScalar or two-element numeric vector or cell array that specifies the 'colorthreshold' property to pass to the dendrogram function (Statistics Toolbox software) to create the dendrogram plot. If a two-element numeric vector or cell array, the first element is for the rows, and the second element is for the columns. For more information, see the dendrogram function.
OptimalLeafOrderProperty to enable or disable the optimal leaf ordering calculation, which determines the leaf order that maximizes the similarity between neighboring leaves. Choices are true (enable) or false (disable).

    Tip   Disabling the optimal leaf ordering calculation can be useful when working with large data sets because this calculation uses a large amount of memory and can be very time consuming.

LogTransControls the log2 transform of Data, the matrix of data used to create the clustergram object, from natural scale. Choices are true or false.
Colormap

Either of the following:

  • M-by-3 matrix of RGB values

  • Name or function handle of a function that returns a colormap, such as redgreencmap or redbluecmap

DisplayRange

Positive scalar that specifies the display range of standardized values.

For example, if you specify redgreencmap for the 'ColorMap' property, pure red represents values ≥ DisplayRange, and pure green represents values ≤ –DisplayRange.

SymmetricProperty to force the color scale of the heat map to be symmetric around zero. Choices are true or false.
Ratio

Either of the following:

  • Scalar

  • Two-element vector

It specifies the ratio of space that the row and column dendrograms occupy relative to the heat map. If Ratio is a scalar, it is used as the ratio for both dendrograms. If Ratio is a two-element vector, the first element is used for the ratio of the row dendrogram width to the heat map width, and the second element is used for the ratio of the column dendrogram height to the heat map height. The second element is ignored for one-dimensional clustergrams.

Impute

Any of the following:

  • Name of a function that imputes missing data.

  • Handle to a function that imputes missing data.

  • Cell array where the first element is the name of or handle to a function that imputes missing data and the remaining elements are property name/property value pairs used as inputs to the function.

RowMarkers

Optional structure array for annotating the groups (clusters) of rows determined by the clustergram function. Each structure in the array represents a group of rows and contains the following fields:

  • GroupNumber — Number to annotate the row group.

  • Annotation — String specifying text to annotate the row group.

  • Color — String or three-element vector of RGB values specifying a color, which is used to label the row group. For more information on specifying colors, see colorspec. If this field is empty, default is 'blue'.

ColumnMarkers

Optional structure array for annotating groups (clusters) of columns determined by the clustergram function. Each structure in the array represents a group of rows and contains the following fields:

  • GroupNumber — Number to annotate the column group.

  • Annotation — String specifying text to annotate the column group.

  • Color — String or three-element vector of RGB values specifying a color, which is used to label the column group. For more information on specifying colors, see colorspec. If this field is empty, default is 'blue'.

Examples

  1. Load the MAT-file, provided with the Bioinformatics Toolbox™ software, that contains filtered yeast data. This MAT-file includes three variables: yeastvalues, a matrix of gene expression data, genes, a cell array of GenBank® accession numbers for labeling the rows in yeastvalues, and times, a vector of time values for labeling the columns in yeastvalues.

    load filteredyeastdata
    
  2. Create a clustergram object and display the dendrograms and heat map from the gene expression data in the first 30 rows of the yeastvalues matrix and standardize along the rows of data.

    cgo = clustergram(yeastvalues(1:30,:),'Standardize','row')
    
    Clustergram object with 30 rows of nodes and 7 column of nodes.

  3. Use the set method and the genes and times vectors to add meaningful row and column labels to the clustergram.

    set(cgo,'RowLabels',genes(1:30),'ColumnLabels',times)

  4. Reset the colormap of the heat map to redbluecmap.

    set(cgo,'Colormap',redbluecmap);
    

See Also

| | |

Was this topic helpful?