roast_cor: to Excel

View source: R/roast_cor.R

roast_corR Documentation

to Excel

Description

Test association of gene sets to phenotype using rotation testing with roast using limma functions mroast or fry. It returns a data frame with statistics per gene set, and writes this to an Excel file. The Excel file links to CSV files, which contain statistics per gene set. See example in vignette of roast_contrasts.

Usage

roast_cor(
  object,
  G,
  feat.tab = NULL,
  name = NA,
  phenotype = NULL,
  design = NULL,
  fun = c("fry", "mroast"),
  set.statistic = "mean",
  weights = NA,
  gene.weights = NULL,
  trend = FALSE,
  block = NULL,
  correlation = NULL,
  prefix = NULL,
  adjust.method = "BH",
  min.nfeats = 3,
  max.nfeats = 1000,
  alternative = c("two.sided", "less", "greater"),
  nrot = 999,
  check.names = TRUE,
  pwy.nchar = 199,
  seed = 0
)

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.

G

Gene set list as returned from read_gmt.

feat.tab

Table of feature (e.g. gene) statistics that the Excel table can link to.

name

Name for the folder and Excel file that get written. Set to NA to avoid writing output.

phenotype

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

design

Design matrix of the experiment, with rows corresponding to samples and columns to coefficients to be estimated.

fun

Function to use, either fry or mroast.

set.statistic

Summary set statistic. Possibilities are "mean", "floormean", "mean50", or "msq". Only for mroast.

weights

Non-negative observation weights. Can be a numeric matrix of individual weights of same size as the object, or a numeric vector of sample weights with length ncol(object), or a numeric vector of gene weights with length equal to nrow(object). Set to NULL to ignore object$weights. weights=NA (with length one) doesn't pass weights to limma.

gene.weights

Numeric vector of directional (positive or negative) genewise weights. These represent each gene's contribution to pathways. They are not for precision weights, from weights. This vector must have length equal to nrow(object). Only for mroast.

trend

Logical; should an intensity-trend be allowed for the prior variance? Default is that the prior variance is constant.

block

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

correlation

Inter-duplicate or inter-technical replicate correlation. Must be given if ndups>1 or !is.null(block).

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

min.nfeats

Minimum number of features (e.g. genes) needed in a gene set for testing.

max.nfeats

Maximum number of features (e.g. genes) needed in a gene set for testing.

alternative

Alternative hypothesis; must be one of "two.sided", "greater" or "less". "greater" corresponds to positive association, "less" to negative association.

nrot

Number of rotations used to estimate the p-values for mroast.

check.names

Logical; should names(grp)==rownames(object) be checked? Ignored if is.null(design) and add.means is FALSE.

pwy.nchar

Numeric maximum number of characters allowed in pathway name.

seed

Integer seed to set for reproducility if fun="mroast", since mroast uses random simulations. Ignored if fun="fry".

Details

Pathway (i.e. gene set) names are altered to be valid filenames in Windows and Linux. Numeric columns are rounded to 8 significant figures.

This function does not accept ndups nor spacing, because we found that these arguments do not impact limma::mroast nor limma::fry.

Value

Data frame of gene set statistics.

See Also

roast_contrasts.


jdreyf/ezlimma documentation built on March 3, 2024, 4:23 a.m.