sampNoDeMArrayLM: Locate Sample Index From Index Or Name Of Pair-Wise...

View source: R/sampNoDeMArrayLM.R

sampNoDeMArrayLMR Documentation

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 samples, ie mean-columns, corresponding to a specific pairwise comparison.

Usage

sampNoDeMArrayLM(
  MArrayObj,
  useComp,
  groupSep = "-",
  lstMeans = "means",
  lstP = c("BH", "FDR", "p.value"),
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Arguments

MArrayObj

(list or MArray-object) main input

useComp

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

groupSep

(character, length=1) separator for paitr of names

lstMeans

(character, length=1) the list element containing the individual sample names, typically the matrix containing the replicate-mean values for each type of sample, the column-names get used

lstP

(character, length=1) the list element containing all pairwise comparisons performed, the column-names get 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 contain the pairwise comparisons and a specific comparison indicated by useComp to get located in the element of mean-columns (lstMeans) among all pairwise comparisons.

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

See Also

moderTestXgrp, this function gets used eg in MAplotW or VolcanoPlotW

Examples

grp <- factor(rep(LETTERS[c(3,1,4)],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="")))
if(requireNamespace("limma", quietly=TRUE)) {  # need limma installed...
  test8 <- moderTestXgrp(t8, grp) 
  head(test8$p.value)         # all pairwise comparisons available
  sampNoDeMArrayLM(test8,1)
  head(test8$means[,sampNoDeMArrayLM(test8,1)])
  head(test8$means[,sampNoDeMArrayLM(test8,"C-D")]) }


wrMisc documentation built on Sept. 11, 2024, 6:10 p.m.