Learn R Programming

wrProteo (version 2.0.0.2)

extractTestingResults: Extract Results From Moderated t-tests

Description

This function allows convenient access to results produced using the functions moderTest2grp or moderTestXgrp. The user can define the threshold which type of multiple testing correction should be used (as long as the multiple testing correction method was actually performed as part of testing).

Usage

extractTestingResults(
  stat,
  compNo = 1,
  statTy = "BH",
  thrsh = 0.05,
  FCthrs = 1.5,
  annotCol = c("Accession", "EntryName", "GeneName"),
  nSign = 6,
  addTy = c("allMeans"),
  filename = NULL,
  fileTy = "csvUS",
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Value

This function returns a data.frame or matrix (if no annotation added) with values (and annotation) conform to fiter criteria

Arguments

stat

('MArrayLM'-object or list) Designed for the output from moderTest2grp or moderTestXgrp

compNo

(integer) the comparison number/index to be used

statTy

(character) the multiple-testing correction type to be considered when looking for significant changes with threshold thrsh (depends on which have been run initially with moderTest2grp or moderTestXgrp)

thrsh

(numeric) the threshold to be applied on statTy for the result of the statistcal testing (after multiple testing correction)

FCthrs

(numeric) Fold-Change threshold given as Fold-change and NOT log2(FC), default at 1.5 (for filtering at M-value =0.585)

annotCol

(character) column-names from the annotation to be included

nSign

(integer) number of significant digits whe returning results

addTy

(character) additional groups of columns to add ("allMeans", "all" or "slim") in addition; if addTy="slim" only the FDR- and FC-columns directly concerned will be extracted/displayed

filename

(character) optional (path and) file-name for exporting results to csv-file

fileTy

(character) file-type to be used with argument filename, may be 'csvEur' or 'csvUS'

silent

(logical) suppress messages

debug

(logical) display additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

Details

The number of columns returned can be modulated using the argument addTy. addTy='slim' gives the fewest columns, only FDR and FC of current comparison specified in argument compNo will be returned. addTy='all' results in a rather exaustive collection of columns (incluing annotation data, if present), while default 'allMeans' gives a compromise

See Also

testRobustToNAimputation, moderTestXgrp or moderTest2grp

Examples

Run this code
grp <- factor(rep(LETTERS[4:2],c(2,3,3)))
set.seed(2017); t8 <- matrix(round(rnorm(208*8,10,0.4),2), ncol=8,
  dimnames=list(paste(letters[],rep(1:8,each=26),sep=""), paste(grp,c(1:2,1:3,1:3),sep="")))
t8[3:6,1:2] <- t8[3:6,1:2] +3                    # augment lines 3:6 (c-f) 
t8[5:8,c(1:2,6:8)] <- t8[5:8,c(1:2,6:8)] -1.5    # lower lines 
t8[6:7,3:5] <- t8[6:7,3:5] +2.2                  # augment lines 
## expect to find C/A in c,d,g, (h)
## expect to find C/D in c,d,e,f
## expect to find A/D in f,g,(h) 
library(wrMisc)     # for testing we'll use this package
test8 <- moderTestXgrp(t8, grp) 
extractTestingResults(test8)
extractTestingResults(test8, compNo=c("B-C"))

extractTestingResults(test8, addTy="all")
extractTestingResults(test8, addTy="slim")

Run the code above in your browser using DataLab