DEGseq (version 1.26.0)

samWrapper: samWrapper: A Wrapper (with some modification) of the functions in the package samr to identify differentially expressed genes for the RNA-seq data from two groups of paired or unpaired samples.

Description

This function is a wrapper of the functions in samr. It is used to identify differentially expressed genes for two sets of samples with multiple replicates or two groups of samples from different individuals (e.g. disease samples vs. control samples). For the advanced users, please see samr http://cran.r-project.org/web/packages/samr/index.html for detail.

Usage

samWrapper(geneExpFile1, geneCol1=1, expCol1=2, measure1=rep(1, length(expCol1)),
           geneExpFile2, geneCol2=1, expCol2=2, measure2=rep(2, length(expCol2)),
           header=TRUE, sep="", paired=FALSE, s0=NULL, s0.perc=NULL, nperms=100, 
           testStatistic=c("standard","wilcoxon"), max.qValue=1e-3, min.foldchange=0,
           logged2=FALSE, output)

Arguments

geneExpFile1
file containing gene expression values for group1.
geneCol1
gene id column in geneExpFile1.
expCol1
expression value columns in geneExpFile1. See the example.
measure1
numeric vector of outcome measurements for group1. like c(1,1,1...) when paired=FALSE, or like c(-1,-2,-3,...) when paired=TRUE.
geneExpFile2
file containing gene expression values for group2.
geneCol2
gene id column in geneExpFile2.
expCol2
expression value columns in geneExpFile2. See the example.
measure2
numeric vector of outcome measurements for group2. like c(2,2,2...) when paired=FALSE, or like c(1,2,3,...) when paired=TRUE.
header
a logical value indicating whether geneExpFile1 and geneExpFile2 contain the names of the variables as its first line. See ?read.table.
sep
the field separator character. If sep = "" (the default for read.table) the separator is white space, that is one or more spaces, tabs, newlines or carriage returns. See ?read.table.
paired
a logical value indicating whether the samples are paired.
s0
exchangeability factor for denominator of test statistic; Default is automatic choice.
s0.perc
percentile of standard deviation values to use for s0; default is automatic choice; -1 means s0=0 (different from s0.perc=0, meaning s0=zeroeth percentile of standard deviation values= min of sd values.
nperms
number of permutations used to estimate false discovery rates.
testStatistic
test statistic to use in two class unpaired case. Either "standard" (t-statistic) or "wilcoxon" (Two-sample wilcoxon or Mann-Whitney test). recommend "standard".
max.qValue
the max qValue desired; shoube be
min.foldchange
the minimum fold change desired; should be >1. default is zero, meaning no fold change criterion is applied.
logged2
a logical value indicating whether the expression values are logged2.
output
the output file.

References

Tusher,V., and et al. (2001): Significance analysis of microarrays applied to the ionizing radiation response PNAS 98, 5116-5121. Tibshirani,R, and et al.: samr http://cran.r-project.org/web/packages/samr/index.html. A more complete description is given in the SAM manual at http://www-stat.stanford.edu/~tibs/SAM.

See Also

DEGexp, DEGseq, GeneExpExample1000, GeneExpExample5000.

Examples

Run this code
## If the data files are collected in a zip archive, the following
  ## commands will first extract them to the temporary directory.
  
  geneExpFile <- system.file("extdata", "GeneExpExample1000.txt", package="DEGseq")
  set.seed(100)
  geneExpFile1 <- geneExpFile 
  geneExpFile2 <- geneExpFile
  output <- file.path(tempdir(), "samWrapperOut.txt")
  exp <- readGeneExp(file=geneExpFile, geneCol=1, valCol=c(7,9,12,15,18))
  exp[30:35,]
  exp <- readGeneExp(file=geneExpFile, geneCol=1, valCol=c(8,10,11,13,16))
  exp[30:35,]
  samWrapper(geneExpFile1=geneExpFile1, geneCol1=1, expCol1=c(7,9,12,15,18), measure1=c(-1,-2,-3,-4,-5),
             geneExpFile2=geneExpFile2, geneCol2=1, expCol2=c(8,10,11,13,16), measure2=c(1,2,3,4,5),
             nperms=100, min.foldchange=2, max.qValue=1e-4, output=output, paired=TRUE)
  cat("output:", output, "")

Run the code above in your browser using DataLab