limma_pcor: Test partial correlation of each row of an object to a...

View source: R/limma_pcor.R

limma_pcorR Documentation

Test partial correlation of each row of an object to a phenotype vector

Description

Test partial correlation of each row of an object to a phenotype vector given covariates. The approach here is to estimate the residuals of regressing each of object and phenotype on cbind(1, covariates), and then to test the correlation of the residuals, with the appropriate degrees of freedom.

Usage

limma_pcor(
  object,
  phenotype,
  covariates,
  fam = "gaussian",
  reorder.rows = TRUE,
  prefix = NULL,
  adjust.method = "BH",
  check.names = TRUE,
  cols = c("t", "P.Value")
)

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.

phenotype

Numeric vector of sample characteristics (e.g. phenotypes or treatments). Should be same length as ncol(object).

covariates

Numeric vector with one element per sample or matrix-like object with rows corresponding to samples and columns to covariates to be adjusted for.

fam

Character string of family to use in generalized linear model of Y. The default "gaussian" reduces to the usual linear regression model. See stats::family.

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.

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".

check.names

Logical; should names(phenotype)==rownames(object) be checked?

cols

Columns of topTable output to include. Possibilities include "logFC", "AveExpr", "z", "t", "P.Value", "adj.P.Val", "B". Some of these column names are then changed here. If logFC is specified, FC will automatically also be given.

Details

covariates should not include the regression intercept, but when called from hitman, it should include the exposure.

Estimating the residuals corresponding to object is analogous to removeBatchEffect, and several lines of code are adapted from that function.

Value

Data frame.


jdreyf/Hitman documentation built on April 12, 2025, 1:35 p.m.