Learn R Programming

WGCNA (version 1.61)

newCorrelationOptions: Creates a list of correlation options.

Description

Convenience function to create a re-usable list of correlation options.

Usage

newCorrelationOptions(
      corType = c("pearson", "bicor"),
      maxPOutliers = 0.05,
      quickCor = 0,
      pearsonFallback = "individual",
      cosineCorrelation = FALSE,
      nThreads = 0,
      corFnc = if (corType=="bicor") "bicor" else "cor",
      corOptions = c(
        list(use = 'p', 
             cosine = cosineCorrelation, 
             quick = quickCor,
             nThreads = nThreads),
        if (corType=="bicor") 
           list(maxPOutliers = maxPOutliers, 
                pearsonFallback = pearsonFallback) else NULL))

Arguments

corType

Character specifying the type of correlation function. Currently supported options are "pearson", "bicor".

maxPOutliers

Maximum proportion of outliers for biweight mid-correlation. See bicor.

quickCor

Real number between 0 and 1 that controls the handling of missing data in the calculation of correlations. See bicor.

pearsonFallback

Specifies whether the bicor calculation should revert to Pearson when median absolute deviation (mad) is zero. Recongnized values are (abbreviations of) "none", "individual", "all". If set to "none", zero mad will result in NA for the corresponding correlation. If set to "individual", Pearson calculation will be used only for columns that have zero mad. If set to "all", the presence of a single zero mad will cause the whole variable to be treated in Pearson correlation manner (as if the corresponding robust option was set to FALSE).

cosineCorrelation

Logical: calculate cosine biweight midcorrelation? Cosine bicorrelation is similar to standard bicorrelation but the median subtraction is not performed.

nThreads

A non-negative integer specifying the number of parallel threads to be used by certain parts of correlation calculations. This option only has an effect on systems on which a POSIX thread library is available (which currently includes Linux and Mac OSX, but excludes Windows). If zero, the number of online processors will be used if it can be determined dynamically, otherwise correlation calculations will use 2 threads.

corFnc

Correlation function to be called in R code. Should correspoind to the value of corType above.

corOptions

A list of options to be supplied to the correlation function (in addition to appropriate arguments x and y).

Value

A list containing a copy of the input arguments. The output has class CorrelationOptions.