View source: R/getPairwiseSetup.R
| getPairwiseSetup | R Documentation |
This function allows extacting, checking and combinig elements defining labels for pairwise comparisons.
getPairwiseSetup(
pwGrpNa,
grpNa = NULL,
sep = NULL,
combPwSep = "combine1",
silent = FALSE,
debug = FALSE,
callFrom = NULL
)
pwGrpNa |
(character) the names of pairwise-testing (ie 'concatenated' |
grpNa |
(character) the names of the groups of replicates (ie conditions) used to test |
sep |
(NULL or character, length=1) if not |
combPwSep |
(character) sequence of separators for building combined names; may be combPwSep='combine1' or 'combine2'; will be used in pwSeparatorList() |
silent |
(logical) suppress messages |
debug |
(logical) additional messages for debugging |
callFrom |
(character) allow easier tracking of messages produced |
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 pwGrpNa is an MAarrayLM-objects object and/or was created using 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 sep is given and exact matches at both sides will be searched.
However, if the character(s) from sep do appear inside pwGrpNa no matches will be found.
If some pwGrpNa are not found in 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.
This function returns a list with $ind with matrix of indexes to (sorted) pwGrpNa for each pairwise comparison;
$pwGrpNames with matrix of pwGrpNa for each pairwise comparison;
$sep for the separator found ; $pwGrpNa which recapitulates (sorted) pwGrpNa as factor
(for running multiple pair-wise test) moderTestXgrp, convPairwiseSetup, presenceFilt, getPWseparator, indexGroupsFromPW,
(used underneith:) grep, strsplit
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.