pairComp: Do differential gene/microRNA expression analysis

Description Usage Arguments Details Value See Also Examples

View source: R/pairComp.R

Description

pairComp uses functions in limma package to easily compute the moderated t-statistics and p-values from differential gene/microRNA expression tests comparing between different phenotypes even when sample size is small.

Usage

1
pairComp(data, class, padj = "fdr")

Arguments

data

A matrix, the normalized gene/microRNA expression dataset, should be a numeric matrix, with rows referring to genes/microRNAs and columns to samples.

class

A vector of sample phenotypes. Sample phenotype in a scientific research could be treatment/control, normal/cancer or smoker/non-smoker. Different phenotypes should each be encoded as 0/1 when inputting to pairComp, for example, Normal-0; Cancer-1.

Details

This function computes the moderated t-statistic for users using empirical Bayes method, it is especially useful when the sample size is too small to perform parametric tests.

Given a normalized gene expression or DNA methylation data matrix and a vector indicating sample phenotype, LimmaFn first fits a linear model using lmFit, then it refits the model and do comparisons between any two different phenotypes with contrasts.fit, finally it estimates moderated t-statistics for each comparison from the fitted model using empirical Bayes method (eBayes) and output the result from the topTable function.

Note that doing the contrasts.fit step will not make a difference if you do comparison between two different sample status (treatment/control). However, When there are more than two sample status in your data set, this step will do comparison between every two status. And resulted summary tables will be stored in a list.

Value

A table with rows for all genes (ranked by significance) and columns of log2 fold-change, average expression, moderated t-statistic, p-value, adjusted p-value (default to Benjamini–Hochberg procedure). The table is the output of topTable function.

See Also

lmFit for fitting a linear model, contrasts.fit for refitting, eBayes for Bayes method, topTable for the output table.

Examples

1
2
3
4
5
6
7
8
# prepare your normalized data matrix
data.m <- matrix(rnorm(120), nrow = 20, ncol = 6)

# prepare the phenotype info (0-control; 1-treatment)
class.v <- c(0, 0, 0, 1, 1, 1)

# run function
lim.o <- pairComp(data = data.m, class = class.v)

YC3/mirNet documentation built on Sept. 3, 2020, 3:25 a.m.