Learn R Programming

DGCA (version 1.0.3)

getCors: Compute matrices necessary for differential correlation calculation.

Description

As a first step in the standard DGCA workflow, this function reads in a design matrix and an input matrix, splits the input matrix by the named groups defined in the design matrix, and outputs a list of matrices (correlation matrix, correlation significance matrix, and number of samples matrix) to be used by downstream parts of the analysis.

Usage

getCors(inputMat, design, inputMatB = NULL, impute = FALSE,
  corrType = "pearson")

Value

A corMats S4 class object, containing a list of matrices from each group, the design matrix, and a character vector of options.

Arguments

inputMat

The matrix (or data.frame) of values (e.g., gene expression values from an RNA-seq or microarray study) that you are interested in analyzing. The rownames of this matrix should correspond to the identifiers whose correlations and differential correlations you are interested in analyzing, while the columns should correspond to the rows of the design matrix and should be separable into your groups.

design

A standard model.matrix created design matrix. Rows correspond to samples and colnames refer to the names of the conditions that you are interested in analyzing. Only 0's or 1's are allowed in the design matrix. Please see vignettes for more information.

inputMatB

Optional, secondary input matrix that allows you to calculate correlation and differential correlation for the rows between inputMat and imputMatB.

impute

A binary variable specifying whether values should be imputed if there are missing values. Note that the imputation is performed in the full input matrix (i.e., prior to subsetting) and uses k-nearest neighbors.

corrType

The correlation type of the analysis, limited to "pearson" or "spearman". Default = "pearson".

Examples

Run this code
data(darmanis); data(design_mat); darmanis_subset = darmanis[1:30, ]
cors_res = getCors(inputMat = darmanis_subset, design = design_mat)

Run the code above in your browser using DataLab