DoTest: Apply two-sample t-test for each row of input data matrix.

Description Usage Arguments Details Value See Also Examples

View source: R/DoTest.R

Description

DoTest applies two-sample t-test for each row of input data matrix. P-values are adjusted using Benjamini–Hochberg procedure.

Usage

1
DoTest(data, pheno)

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.

pheno

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 DoTest, for example, Normal-0; Cancer-1.

Details

This function computes the t-statistic from two-sample comparisons which assumes normality in data. If sample size is too small, it is better to perform a moderated t-test using empirical Bayes method (eBayes).

Value

A table with rows for all genes (ranked by significance) and columns of t-statistic, p-value, adjusted p-value (default to Benjamini–Hochberg procedure).

See Also

pairComp for applying a moderated t-test for input data matrix, eBayes for Bayes method.

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
DoTest(data = data.m, pheno = class.v)

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