boxPlots: Draw parallel plots for top results in whole-genome-wide...

Description Usage Arguments Value Author(s) Examples

View source: R/plotFuncs.R

Description

Draw scatter plots for top results in whole-genome-wide analysis to test for the association of probes to a continuous-type phenotype variable.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
boxPlots(
  resFrame, 
  es, 
  col.resFrame = c("probeIDs", "stats", "pval", "p.adj"), 
  var.pheno = "sex", 
  var.probe = "TargetID", 
  var.gene = "Symbol", 
  var.chr = "Chr", 
  nTop = 20, 
  myylab = "expression level", 
  datExtrFunc = exprs, 
  fileFlag = FALSE, 
  fileFormat = "ps", 
  fileName = "boxPlots.ps")

Arguments

resFrame

A data frame stores testing results, which must contain columns that indicate probe id, test statistic, p-value and optionally adjusted p-value.

es

An ExpressionSet object that used to run the whole genome-wide tests.

col.resFrame

A vector of characters indicating column names of resFrame corresponding to probe id, test statistic, p-value and optionally adjusted p-value.

var.pheno

character. the name of continuous-type phenotype variable that is used to test the association of this variable to probes.

var.probe

character. the name of feature variable indicating probe id.

var.gene

character. the name of feature variable indicating gene symbol.

var.chr

character. the name of feature variable indicating chromosome number.

nTop

integer. indicating how many top tests will be used to draw the scatter plot.

myylab

character. indicating y-axis label.

datExtrFunc

name of the function to extract genomic data. For an ExpressionSet object, you should set datExtrFunc=exprs; for a MethyLumiSet object, you should set datExtrFunc=betas.

fileFlag

logic. indicating if plot should be saved to an external figure file.

fileFormat

character. indicating the figure file type. Possible values are “ps”, “pdf”, or “jpeg”. All other values will produce “png” file.

fileName

character. indicating figure file name (file extension should be specified). For example, you set fileFormat="pdf", then you can set fileName="test.pdf", but not fileName="test".

Value

Value 0 will be returned if no error occurs.

Author(s)

Weiliang Qiu <stwxq@channing.harvard.edu>, Brandon Guo <brandowonder@gmail.com>, Christopher Anderson <christopheranderson84@gmail.com>, Barbara Klanderman <BKLANDERMAN@partners.org>, Vincent Carey <stvjc@channing.harvard.edu>, Benjamin Raby <rebar@channing.harvard.edu>

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
25
26
27
28
29
30
31
32
33
34
35
  # generate simulated data set from conditional normal distribution
  set.seed(1234567)
  es.sim = genSimData.BayesNormal(nCpGs = 100, 
    nCases = 20, nControls = 20,
    mu.n = -2, mu.c = 2,
    d0 = 20, s02 = 0.64, s02.c = 1.5, testPara = "var",
    outlierFlag = FALSE, 
    eps = 1.0e-3, applier = lapply) 
  print(es.sim)

  res.limma = lmFitWrapper(
    es = es.sim, 
    formula = ~as.factor(memSubj), 
    pos.var.interest = 1,
    pvalAdjMethod = "fdr", 
    alpha = 0.05, 
    probeID.var = "probe", 
    gene.var = "gene", 
    chr.var = "chr", 
    verbose = TRUE)

  boxPlots(
    resFrame=res.limma$frame, 
    es=es.sim, 
    col.resFrame = c("probeIDs", "stats", "pval"), 
    var.pheno = "memSubj", 
    var.probe = "probe", 
    var.gene = "gene", 
    var.chr = "chr", 
    nTop = 20, 
    myylab = "expression level", 
    datExtrFunc = exprs, 
    fileFlag = FALSE, 
    fileFormat = "ps", 
    fileName = "boxPlots.ps")

iCheck documentation built on Nov. 8, 2020, 11:09 p.m.