Learn R Programming

WGCNA (version 1.27-1)

matchLabels: Relabel module labels to best match the given reference labels

Description

Given a source and reference vectors of module labels, the function produces a module labeling that is equivalent to source, but individual modules are re-labeled so that modules with significant overlap in source and reference have the same labels.

Usage

matchLabels(source, reference, pThreshold = 5e-2)

Arguments

source
a vector or a matrix of reference labels. The labels may be numeric or character.
reference
a vector of reference labels.
pThreshold
threshold of Fisher's exact test for considering modules to have a significant overlap.

Value

  • A vector (if the input source labels are a vector) or a matrix (if the input source labels are a matrix) of the new labels.

Details

Each column of source is treated separately. Source and reference labels are assumed to be of the same type, that is noth should be either numeric or character. If the labels are character, they are assumed to be color labels such as the ones returned by standardColors.

The function calculates the overlap of the source and reference modules using Fisher's exact test. It then attempts to relabel source modules such that modules with the highest overlap with the reference modules have the same color. Where this is not possible (for example because one reference module has the highest overlap with two source modules), the source modules will be relabeled using labels that are not present among the reference labels.

See Also

standardColors