test_dPDUI: do test for dPDUI

View source: R/22.test_dPDUI.R

test_dPDUIR Documentation

do test for dPDUI

Description

do test for dPDUI

Usage

test_dPDUI(
  eset,
  sqlite_db,
  outdir = getInPASOutputDirectory(),
  method = c("limma", "fisher.exact", "singleSample", "singleGroup"),
  normalize = c("none", "quantiles", "quantiles.robust", "mean", "median"),
  design,
  contrast.matrix,
  coef = 1,
  robust = FALSE,
  ...
)

Arguments

eset

An object of UTR3eSet. It is an output of get_UTR3eSet()

sqlite_db

A path to the SQLite database for InPAS, i.e. the output of setup_sqlitedb().

outdir

A character(1) vector, a path with write permission for storing InPAS analysis results. If it doesn't exist, it will be created.

method

A character(1), indicating the method for testing dPDUI. It can be "limma", "fisher.exact", "singleSample", or "singleGroup"

normalize

A character(1), indicating the normalization method. It can be "none", "quantiles", "quantiles.robust", "mean", or "median"

design

a design matrix of the experiment, with rows corresponding to samples and columns to coefficients to be estimated. Defaults to the unit vector meaning that the samples are treated as replicates. see stats::model.matrix(). Required for limma-based analysis.

contrast.matrix

a numeric matrix with rows corresponding to coefficients in fit and columns containing contrasts. May be a vector if there is only one contrast. see limma::makeContrasts(). Required for limma-based analysis.

coef

column number or column name specifying which coefficient or contrast of the linear model is of interest. see more limma::topTable(). default value: 1

robust

A logical(1) vector, indicating whether the estimation of the empirical Bayes prior parameters should be robustified against outlier sample variances.

...

other arguments are passed to lmFit

Details

if method is "limma", design matrix and contrast is required. if method is "fisher.exact", gp1 and gp2 is required.

Value

An object of UTR3eSet, with the last element testRes containing the test results in a matrix.

Author(s)

Jianhong Ou, Haibo Liu

See Also

run_singleSampleAnalysis(), run_singleGroupAnalysis(), run_fisherExactTest(), run_limmaAnalysis()

Examples

library(limma)
path <- system.file("extdata", package = "InPAS")
load(file.path(path, "eset.MAQC.rda"))
tags <- colnames(eset@PDUI)
g <- factor(gsub("\\..*$", "", tags))
design <- model.matrix(~ -1 + g)
colnames(design) <- c("Brain", "UHR")
contrast.matrix <- makeContrasts(
  contrasts = "Brain-UHR",
  levels = design
)
res <- test_dPDUI(
  eset = eset,
  sqlite_db,
  method = "limma",
  normalize = "none",
  design = design,
  contrast.matrix = contrast.matrix
)

haibol2016/InPAS documentation built on March 30, 2022, 10:30 a.m.