signedRankSumTest: An implementation of the Wilcox rank sum test / Mann-Whitney...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/wilcox_score-methods.R

Description

This test evaluates whether the mean rank of statistics of gene set members is greater or less than the mean rank of the remaining statistic values. It extends the rankSumTestWithCorrelation function from the 'limma' package by taking into account the 'sign' of gene set members by reversing the ranks of down-regulated genes.

Usage

1
2
  signedRankSumTest(statistics, index.up, index.down = NULL,
  input.is.ranks=FALSE, correlation=0, df = Inf, adjust.ties=TRUE) 

Arguments

statistics

numeric vector giving values of the test statistic.

index.up

an index vector such that statistics[index.up] contains the values of the statistic for the up-regulated genes.

index.down

an index vector such that statistics[index.down] contains the values of the statistic for the down-regulated genes.

correlation

numeric scalar, average correlation between cases in the test group. Cases in the second group are assumed independent of each other and the first group.

df

degrees of freedom which the correlation has been estimated.

adjust.ties

logical: correct for ties ?

input.is.ranks

logical: is 'statistics' a vector of ranks ? If FALSE (default), ranks are computed. If FALSE, 'statistics' is assumed to represent ranks and is used directly.

Details

Please see the rankSumTestWithCorrelation function from the limma package for details.

Value

Numeric vector containing U-statistic, z-score and p-value.

Author(s)

Thomas Sandmann

References

Wu, D, and Smyth, GK (2012). Camera: a competitive gene set test accounting for inter-gene correlation. Submitted.

Barry, W.T., Nobel, A.B., and Wright, F.A. (2008). A statistical framework for testing functional categories in microarray data. Annals of Applied Statistics 2, 286-315.

Zar, JH (1999). Biostatistical Analysis 4th Edition. Prentice-Hall International, Upper Saddle River, New Jersey.

See Also

rankSumTestWithCorrelation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
genes.up   <- c(1:10)
genes.down <- c(21:30)

set.seed(123)
scores <- matrix(rnorm(200), ncol=2)

## the first gene set receives increased /
## decreased scores in the first experiment
scores[genes.up,1]   <- scores[genes.up  ,1] + 1 
scores[genes.down,1] <- scores[genes.down,1] - 1

## significantly greater
signedRankSumTest( statistics = scores[,1],
                   index.up   = genes.up,
                   index.down = genes.down)

## not signficant
signedRankSumTest( statistics = scores[,2],
                   index.up   = genes.up,
                   index.down = genes.down)

Example output

Loading required package: GSEABase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: annotate
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: XML
Loading required package: graph

Attaching package: 'graph'

The following object is masked from 'package:XML':

    addNode

Loading required package: limma

Attaching package: 'limma'

The following object is masked from 'package:BiocGenerics':

    plotMA


Attaching package: 'gCMAP'

The following object is masked from 'package:IRanges':

    members

           U            p            z 
1.890000e+02 7.169693e-08 5.260846e+00 
          U           p           z 
874.0000000   0.2632461  -0.6333697 

gCMAP documentation built on April 29, 2020, 3:54 a.m.