jointScoreTestsWrapper: Wrapper function to test for equality of mean or variance...

Description Usage Arguments Value Author(s) References Examples

Description

Wrapper function to test for equality of mean or variance simultaneously by using score tests.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
jointScoreTestsWrapper(
  es, 
  grpVar = "group", 
  meanTestFunc = scoreTestMean,
  varTestFunc = AWvarTest,
  esFlag = "es", 
  pvalAdjMethod = "fdr", 
  alpha = 0.05, 
  nTop = 20, 
  probeID.var = "ProbeID", 
  gene.var = "Symbol", 
  chr.var = "Chromosome", 
  applier = lapply, 
  verbose = FALSE)

Arguments

es

An ExpressionSet object storing gene expression/DNA methylation data, phenotype data, and feature annotation.

grpVar

character string. The name of the phenotype variable indicating arrays' group membership. 0 means control and 1 means case.

meanTestFunc

A user-defined function to test for equal mean. Available functions provided by diffMeanVar package include: scoreTestMean. The function should contain 2 and only 2 inputs: value and group, where group is a binary vector indicating if a subject is a case (group=1) or control (group=0) and value is a continuous-type variable. The goal of the function is to test if the mean of value for cases is the same as that for controls. The function should return a list object containing at least 2 elements: stat and pval. For each probe stored in es, the function will be applied to test if the probe is differentially expressed between cases and controls.

varTestFunc

A user-defined function to test for equality of variance. Available functions provided by diffMeanVar package include: iAWvar.BF, iAWvar.Levene, iAWvar.TrimMean, AWvarTest, BFTest, FTest, LeveneTest, and TrimMeanLeveneTest. The function should contain 2 and only 2 inputs: value and group, where group is a binary vector indicating if a subject is a case (group=1) or control (group=0) and value is a continuous-type variable. The goal of the function is to test if the variance of value for cases is the same as that for controls. The function should return a list object containing at least 2 elements: stat and pval. For each probe stored in es, the function will be applied to test if the probe is differentially variable between cases and controls.

esFlag

character string. Indicating if es is an ExpressionSet object or MethylSet object. The program will use exprs function to extract gene expression data or use betas function to extract methylation data.

pvalAdjMethod

character string. Indicating which p-value adjustment will be used to control for multiple testing.

alpha

numeric. Cutoff for p-value or adjusted p-value to determine if a probe is diferentially variable.

nTop

integer. Specifying the number of top probes to be displayed if verbose=TRUE

probeID.var

character string. Feature annotation variable indicating probe ID.

gene.var

character string. Feature annotation variable indicating gene symbol.

chr.var

character string. Feature annotation variable indicating chromosome number.

applier

function name to do apply operation.

verbose

logical. Indicating if intermediate results should be output to screen.

Value

A list of 2 elements. The first element frame is unsorted data frame; the second element frame.s is a sorted data frame object storing the analysis results and containing the following columns: probe (probe id), stat (test statistic), pval (raw p-value), p.adj (adjusted p-value), gene (gene symbol), chr (chromosome number), and pos (position of a probe in unsorted data frame).

The data frame is sorted based on the descending order of the absolute value of the test statistic.

Author(s)

Xuan Li <lixuan0759@mathstat.yorku.ca>, Weiliang Qiu <stwxq@channing.harvard.edu>, Yuejiao Fu <yuejiao@mathstat.yorku.ca>, Xiaogang Wang <stevenw@mathstat.yorku.ca>

References

Li X, Qiu W, Morrow J, DeMeo DL, Weiss ST, Fu Y, Wang X. (2015) A Comparative Study of Tests for Homogeneity of Variances with Application to DNA Methylation Data. PLoS ONE 10(12): e0145295. PMID: 26683022

Qiu W, Li X, Morrow J, DeMeo DL, Weiss ST, Wang X, Fu Y. New Score Tests for Equality of Variances in the Application of DNA Methylation Data Analysis [Version 2]. Insights Genet Genomics. (2017) 1: 3.2

Li X, Qiu W, Fu Y, Wang X. (2017) Robust Joint Score Tests in the Application of DNA Methylation Data Analysis. In submission.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  
    # generate simulated data set from t distribution
    set.seed(1234567)
    es.sim = genSimData.tDistr(nCpGs = 100, nCases = 20, nControls = 20,
      df0 = 10, ncp0 = 0, df1 = 6, ncp1 = 2.393, testPara = "both",
      eps = 1.0e-3, applier = lapply) 
    print(es.sim)
    
    res.jointScoreTestsWrapper = jointScoreTestsWrapper(
      es = es.sim,
      grpVar = "memSubj",
      meanTestFunc = scoreTestMean,
      varTestFunc = AWvarTest,
      esFlag = "es", 
      pvalAdjMethod = "fdr",
      alpha = 0.05,
      nTop = 20,
      probeID.var = "probe",
      gene.var = "gene",
      chr.var = "chr",
      applier=lapply,
      verbose=TRUE)

  

diffMeanVar documentation built on May 2, 2019, 2:54 a.m.