Description Usage Arguments Details Value References Examples
Performs nonparametric inference on rows of y
for
various experimental designs. See References for details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
y 
a SummarizedExperiment containing the inferential replicate matrices of medianratioscaled TPM as assays 'infRep1', 'infRep2', etc. 
x 
the name of the condition variable. A factor with two levels for a two group analysis (possible to adjust for covariate or matched samples, see next two arguments) 
cov 
the name of the covariate for adjustment.
If provided a stratified Wilcoxon in performed.
Cannot be used with 
pair 
the name of the pair variable, which should be the
number of the pair. Can be an integer or factor.
If specified, a signed rank test is used
to build the statistic. All samples across 
interaction 
logical, whether to perform a test of an interaction
between 
nperms 
the number of permutations. if set above the possible number of permutations, the function will print a message that the value is set to the maximum number of permutations possible 
estPi0 
logical, whether to estimate pi0 
qvaluePkg 
character, which package to use for qvalue estimation,

pc 
pseudocount for finite estimation of 
nRandomPairs 
the number of random pseudopairs (only used with

fast 
an integer, toggles different methods based on speed
( 
returnNulls 
logical, only return the 
quiet 
display no messages 
interaction:
The interaction tests are different than the
other tests produced by swish
, in that they focus on a difference
in the log2 fold change across levels of x
when comparing
the two levels in cov
. If pair
is specified, this
will perform a Wilcoxon rank sum test on the two groups
of matched sample LFCs. If pair
is not included, multiple
random pairs of samples within the two groups are chosen,
and again a Wilcoxon rank sum test compared the LFCs across groups.
fast:
'0' involves recomputing ranks of the inferential replicates for
each permutation, '1' (default) is roughly 10x faster by avoiding
recomputing ranks for each permutation.
The fast
argument is only relevant for the following three
experimental designs: (1) two group Wilcoxon, (2) stratified Wilcoxon, e.g.
cov
is specified, and (3) the paired interaction test,
e.g. pair
and cov
are specified. For paired design and
general interaction test, there are not fast/slow alternatives.
a SummarizedExperiment with metadata columns added:
the statistic (either a centered Wilcoxon MannWhitney
or a signed rank statistic, aggregated over inferential replicates),
a log2 fold change (the median over inferential replicates,
and averaged over pairs or groups (if groups, weighted by sample size),
the local FDR and qvalue, as estimated by the samr
package.
The citation for swish
method is:
Anqi Zhu, Avi Srivastava, Joseph G Ibrahim, Rob Patro, Michael I Love "Nonparametric expression analysis using inferential replicate counts" Nucleic Acids Research (2019). https://doi.org/10.1093/nar/gkz622
The swish
method builds upon the SAMseq
method,
and extends it by incorporating inferential uncertainty, as well
as providing methods for additional experimental designs (see vignette).
For reference, the publication describing the SAMseq
method is:
Jun Li and Robert Tibshirani "Finding consistent patterns: A nonparametric approach for identifying differential expression in RNASeq data" Stat Methods Med Res (2013). https://doi.org/10.1177/0962280211428386
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  library(SummarizedExperiment)
set.seed(1)
y < makeSimSwishData()
y < scaleInfReps(y)
y < labelKeep(y)
y < swish(y, x="condition")
# histogram of the swish statistics
hist(mcols(y)$stat, breaks=40, col="grey")
cols = rep(c("blue","purple","red"),each=2)
for (i in 1:6) {
arrows(mcols(y)$stat[i], 20,
mcols(y)$stat[i], 10,
col=cols[i], length=.1, lwd=2)
}
# plot inferential replicates
plotInfReps(y, 1, "condition")
plotInfReps(y, 3, "condition")
plotInfReps(y, 5, "condition")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.