% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getPairwiseSetup.R
\name{getPairwiseSetup}
\alias{getPairwiseSetup}
\title{Extract Pairwise Testing Setup}
\usage{
getPairwiseSetup(
  pwGrpNa,
  grpNa = NULL,
  sep = NULL,
  combPwSep = "combine1",
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)
}
\arguments{
\item{pwGrpNa}{(character) the names of pairwise-testing (ie 'concatenated' \code{pwGrpNa} using the separator \code{sep} )}

\item{grpNa}{(character) the names of the groups of replicates (ie conditions) used to test}

\item{sep}{(NULL or character, length=1) if not \code{NULL} the character-vector (of length=1) given will be used to split \code{grpNa} using \code{stringsplit()}}

\item{combPwSep}{(character) sequence of separators for building combined names; may be combPwSep='combine1' or 'combine2'; will be used in pwSeparatorList()}

\item{silent}{(logical) suppress messages}

\item{debug}{(logical) additional messages for debugging}

\item{callFrom}{(character) allow easier tracking of messages produced}
}
\value{
This function returns a list with $ind with matrix of indexes to (sorted) \code{pwGrpNa} for each pairwise comparison; 
  $pwGrpNames with matrix of \code{pwGrpNa} for each pairwise comparison;  
  $sep for the separator found ; $pwGrpNa which recapitulates (sorted) \code{pwGrpNa} as factor
}
\description{
This function allows extacting, checking and combinig elements defining labels for pairwise comparisons.
}
\details{
This function was designed to support functions exploiting pairwise testing results like plotting functions for Volcano-Plots etc.

Initially the function will check if the object given as argument \code{pwGrpNa} is an MAarrayLM-objects object and/or was created using \code{moderTestXgrp}. 
If yes, the function will try to extract names of groups, pairwise combinations and separator used from $setup, if present.
If no $setup found this function will check through several elements in MAarrayLM-objects to gather all elements needed.

2) The separator \code{sep} is given and exact matches at both sides will be searched.
However, if the character(s) from \code{sep} do appear inside \code{pwGrpNa} no matches will be found.

If some \code{pwGrpNa} are not found in \code{grpNa} this will be marked as NA.  

Finally, if no testing result is given as input, basic parameters group-names, pairwise names and the separator to be used can be combined into a list.
}
\examples{
grp3 <- 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=""), paste0(grp3, c(1:2,1:3,1:3))))
test1 <- moderTestXgrp(t8, grp3)  
getPairwiseSetup(test1)



}
\seealso{
(for running multiple pair-wise test) \code{\link{moderTestXgrp}}, \code{\link{convPairwiseSetup}}, \code{\link{presenceFilt}}, \code{\link{getPWseparator}}, \code{\link{indexGroupsFromPW}}, 
  (used underneith:) \code{\link[base]{grep}}, \code{\link[base]{strsplit}}
}
