Learn R Programming

wrMisc (version 2.0.0)

sampNoDeMArrayLM: Locate Sample Index From Index Or Name Of Pair-Wise Comparisons In List Or MArrayLM-Object

Description

When multiple series of data are tested simultaneaously (eg using moderTestXgrp), multiple pairwise comparisons get performed. This function helps locating the groups of samples, eg respective mean-columns, corresponding to specific pairwise comparisons.

Usage

sampNoDeMArrayLM(
  MArrayObj,
  useComp = NULL,
  outTy = "index",
  groupSep = NULL,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Value

This function returns a numeric vector (length=2) with index indicating the columns of (replicate) mean-values corresponding to the comparison specified in useComp

Arguments

MArrayObj

(list or MArray-object) main input

useComp

(character or integer) index or name of pairwise-comparison to be addressed

outTy

(character) choose if just vector of indexes or list with $ind (with outTy="index"), vector of group-names (with outTy="names") or list with $ind and $GrpNames should get returned

groupSep

(NULL or character of length=1) separator for pair of names; if NULL a suitable separator (among '-','--','_','__','.',' ' and ' ') will be used

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

Details

As main input one gives a list or MArrayLM-object containing testing results from pairwise comparisons, and specific comparisons indicated by useComp to get located in the elements of mean-columns (lstMeans).

See Also

moderTestXgrp, this function gets used eg in MAplotW or VolcanoPlotW

Examples

Run this code
grp3 <- 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=""), paste0(grp3,c(1:2,1:3,1:3))))
if(requireNamespace("limma", quietly=TRUE)) {  # need limma installed...
  test8 <- moderTestXgrp(t8, grp3) 
  head(test8$p.value)         # all pairwise comparisons available
  sampNoDeMArrayLM(test8, 1)   
  unique(grp3)[sampNoDeMArrayLM(test8, 1)]
  head(test8$means[,sampNoDeMArrayLM(test8, 1)])
  head(test8$means[,sampNoDeMArrayLM(test8, "C-D")]) }
 

Run the code above in your browser using DataLab