multi_cor: Test correlation of each row of an object to each column of...

View source: R/multi_cor.R

multi_corR Documentation

Test correlation of each row of an object to each column of pheno.tab

Description

Test correlation of each row of an object to each column of pheno.tab using one of Pearson's, Kendall's, or Spearman's correlation methods, or limma regression in limma_cor. See examples in vignette.

Usage

multi_cor(
  object,
  pheno.tab,
  method = c("pearson", "spearman", "kendall", "limma"),
  reorder.rows = TRUE,
  prefix = NULL,
  block = NULL,
  correlation = NULL,
  adjust.method = "BH",
  covariates = NULL,
  check.names = TRUE,
  limma.cols = c("AveExpr", "P.Value", "adj.P.Val", "logFC")
)

Arguments

object

Matrix-like data object containing log-ratios or log-expression values, with rows corresponding to features (e.g. genes) and columns to samples. Must have row names that are non-duplicated and non-empty.

pheno.tab

Matrix-like data object with columns as sample phenotypes, with nrow(pheno.tab)==ncol(object).

method

Character string indicating which association is to be used for the test. One of "pearson", "spearman", "kendall", from cor.test or "limma" for limma_cor.

reorder.rows

Logical, should rows be reordered by p-value?

prefix

Character string to add to beginning of column names. NULL does not add a prefix.

block

Vector specifying a blocking variable on the samples. Has length = ncol(object). Must be NULL if ndups > 1.

correlation

Numeric vector of inter-duplicate or inter-technical replicate correlations. Must be given if !is.null(block). Its length should be the same as the number of columns of pheno.tab.

adjust.method

Method used to adjust the p-values for multiple testing. Options, in increasing conservatism, include "none", "BH", "BY", and "holm". See p.adjust for the complete list of options. A NULL value will result in the default adjustment method, which is "BH".

covariates

If method="limma", numeric vector or matrix of covariates to include in limma_cor design matrix.

check.names

Logical; should rownames(pheno.tab)=colnames(object) be checked?

limma.cols

If method="limma", cols from limma_cor to include.

Details

Each column of pheno.tab is tested independently. Arguments covariates, block, and correlation only apply if method="limma". When each individual pheno.tab column is tested, if some samples have NAs for that column, those samples are omitted for that column only.

Value

Data frame with several statistical columns corresponding to each phenotype and one row per feature.


jdreyf/ezlimma documentation built on Sept. 16, 2024, 2:08 a.m.