Skip to content

Commit

Permalink
version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbinian Strimmer authored and gaborcsardi committed Feb 4, 2009
1 parent 2f39698 commit ae8bac0
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 28 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: st
Version: 1.1.0
Date: 2008-12-13
Version: 1.1.1
Date: 2009-02-04
Title: Shrinkage t Statistic and Correlation-Adjusted t Score
Author: Rainer Opgen-Rhein, Verena Zuber, and Korbinian Strimmer.
Maintainer: Korbinian Strimmer <strimmer@uni-leipzig.de>
Expand All @@ -9,9 +9,9 @@ Suggests: limma, samr
Description: This package implements the "shrinkage t" statistic
introduced in Opgen-Rhein and Strimmer (2007) and a shrinkage estimate
of the "correlation-adjusted t-score" (cat score) described in
Zuber and Strimmer (2008). It also offers a convenient interface
Zuber and Strimmer (2009). It also offers a convenient interface
to a number of other regularized t-statistics commonly
employed in high-dimensional case-control studies.
License: GPL (>= 3)
URL: http://strimmerlab.org/software/st/
Packaged: Sat Dec 13 16:36:07 2008; strimmer
Packaged: Wed Feb 4 22:07:27 2009; strimmer
11 changes: 10 additions & 1 deletion NEWS
Expand Up @@ -3,11 +3,20 @@
=======================================


CHANGES IN `st' PACKAGE VERSION 1.1.1

- rankprod.stat() and rankprod.fun() added for calculation of the
two-sided rank products statistic.
- reference to Zuber and Strimmer (2009) added.
- small corrections in the help pages, to pass the more stringent
checks on .Rd files introduced in R in January 2009.


CHANGES IN `st' PACKAGE VERSION 1.1.0

- new functions shrinkcat.stat() und shrinkcat.fun() implementing
a shrinkage estimate of the "correlation-adjusted t-score" described
in Zuber and Strimmer (2008).
in Zuber and Strimmer (2009).
- part of the code was rewritten to share code with the "sda" package
(exploiting the link between discriminant analysis and gene ranking).

Expand Down
66 changes: 66 additions & 0 deletions R/rankprod.stat.R
@@ -0,0 +1,66 @@
### rankprod.R (2008-12-18)
###
### Two-sided rank products statistic
###
### Copyright 2008 Korbinian Strimmer
###
### This function is in part based on code from Henry Wirth.
###
### This file is part of the `st' library for R and related languages.
### It is made available under the terms of the GNU General Public
### License, version 3, or at your option, any later version,
### incorporated herein by reference.
###
### This program is distributed in the hope that it will be
### useful, but WITHOUT ANY WARRANTY; without even the implied
### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
### PURPOSE. See the GNU General Public License for more
### details.
###
### You should have received a copy of the GNU General Public
### License along with this program; if not, write to the Free
### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
### MA 02111-1307, USA


rankprod.stat = function (X, L)
{
FUN = rankprod.fun(L=L)
score = FUN(X)

return( score )
}

rankprod.fun <- function (L)
{
if (missing(L)) stop("Class labels are missing!")
L = factor(L)
cl = levels(L)
if (length(cl) != 2) stop("Class labels must be specified for two groups, not more or less!")

idx1 = which( L == levels(L)[1] )
idx2 = which( L == levels(L)[2] )

function(X)
{
ranks = array(0, dim=c( ncol(X), length(idx1)*length(idx2) ) )

for( i in 1:length(idx1) )
{
for( j in 1:length(idx2) )
{
index = j+length(idx2)*(i-1)
ranks[ , index] = rank( -abs( X[idx1[i], ] - X[idx2[j], ] ) )
}
}

# geometric mean
avg.rank = exp(rowMeans(log(ranks)))

# return rank complement
compl.rank = ncol(X)-avg.rank+1

return( compl.rank )
}
}

79 changes: 79 additions & 0 deletions man/diffmean.stat.Rd
@@ -0,0 +1,79 @@
\name{diffmean.stat}
\alias{diffmean.stat}
\alias{diffmean.fun}
\alias{rankprod.stat}
\alias{rankprod.fun}


\title{Difference of Means (``Fold Change'') and Rank Products Statistic}

\usage{
diffmean.stat(X, L)
diffmean.fun(L)
rankprod.stat(X, L)
rankprod.fun(L)
}

\description{
These function compute the difference of group means (``fold change'') and the
related rank products statistic of Breitling et al. (2004).
}

\arguments{
\item{X}{data matrix. Note that the \emph{columns} correspond to variables (``genes'')
and the \emph{rows} to samples.}
\item{L}{factor containing class labels for the two groups. }
}
\details{
\code{diffmean.*} computes the difference of means (i.e. the fold-change for log-transformed data).

\code{rankprod.*} computes the two-sided rank products statistic, i.e. the geometric mean of the
ranks of the pairwise absolute mean differences (Breitling et al. 2004). Note that for consistency with the other functions in this package the \emph{complement} of the averaged ranks is returned
(i.e. rank 1 becomes \code{ncol(X)}, rank 2 becomes \code{ncol(X)-1}, etc.).
}
\value{
The *.stat functions directly return the respective statistic for each variable.

The corresponding *.fun functions return a function that produces the respective
statistics when applied to a data matrix (this is very useful for simulations).
}

\references{
Breitling, R., et al. 2004. Rank products: a simple, yet powerful, new method
to detect differentially regulated genes in replicated microarray experiments.
FEBS Letters \bold{573}:83-9.
}
\author{
Korbinian Strimmer (\url{http://strimmerlab.org}).

This function is in part based on code from Henry Wirth.
}
\seealso{\code{\link{studentt.stat}},\code{\link{shrinkt.stat}}.}

\examples{
# load st library
library("st")

# load Choe et al. (2005) data
data(choedata)
X <- choe2.mat
dim(X) # 6 11475
L <- choe2.L
L

# L may also contain some real labels
L = c("group 1", "group 1", "group 1", "group 2", "group 2", "group 2")


# difference of means resp. fold change statistic
score = diffmean.stat(X, L)
order(abs(score), decreasing=TRUE)[1:10]
# [1] 4790 6620 1022 10979 970 35 2693 5762 5885 2

# two-sided rank products statistic
score = rankprod.stat(X, L)
order(score, decreasing=TRUE)[1:10]
# [1] 4790 1022 10979 6620 35 2693 970 5762 5885 2

}
\keyword{univar}
15 changes: 2 additions & 13 deletions man/regularizedt.Rd
@@ -1,8 +1,6 @@
\name{regularizedt}
\alias{studentt.stat}
\alias{studentt.fun}
\alias{diffmean.stat}
\alias{diffmean.fun}
\alias{efront.stat}
\alias{efront.fun}
\alias{sam.stat}
Expand All @@ -18,8 +16,6 @@
\usage{
studentt.stat(X, L)
studentt.fun(L)
diffmean.stat(X, L)
diffmean.fun(L)
efront.stat(X, L, verbose=TRUE)
efront.fun(L, verbose=TRUE)
sam.stat(X, L)
Expand All @@ -38,16 +34,14 @@ modt.fun(L)
\arguments{
\item{X}{data matrix. Note that the \emph{columns} correspond to variables (``genes'')
and the \emph{rows} to samples.}
\item{L}{vector with class labels for the two groups. }
\item{L}{factor containing class labels for the two groups. }
\item{method}{determines how the smoothing parameter is estimated (applies only to improved SAM statistic \code{samL1}).}
\item{plot}{output diagnostic plot (applies only to improved SAM statistic \code{samL1}).}
\item{verbose}{print out some (more or less useful) information during computation.}
}
\details{
\code{studentt.*} computes the standard equal variance t statistic.

\code{diffmean.*} computes the difference of means (i.e. the fold-change for log-transformed data).

\code{efront.*} computes the t statistic using the 90 \% rule of Efron et al. (2001).

\code{sam.*} computes the SAM t statistic of Tusher et al. (2001).
Expand Down Expand Up @@ -82,7 +76,7 @@ and relative to the shrinkage t statistic in Opgen-Rhein and Strimmer (2007).
and
Korbinian Strimmer (\url{http://strimmerlab.org}).
}
\seealso{\code{\link{shrinkt.stat}}.}
\seealso{\code{\link{diffmean.stat}}, \code{\link{shrinkt.stat}}, \code{\link{shrinkcat.stat}}.}

\examples{
# load st library
Expand Down Expand Up @@ -111,11 +105,6 @@ sum( fdr.out$lfdr < 0.2 )
fdr.out$param


# difference of means /fold change statistic
score = diffmean.stat(X, L)
order(abs(score), decreasing=TRUE)[1:10]
# [1] 4790 6620 1022 10979 970 35 2693 5762 5885 2

# Efron t statistic (90 \% rule)
score = efront.stat(X, L)
order(abs(score), decreasing=TRUE)[1:10]
Expand Down
8 changes: 4 additions & 4 deletions man/shrinkcat.stat.Rd
Expand Up @@ -11,7 +11,7 @@ shrinkcat.fun(L, verbose=TRUE)
\description{
\code{shrinkcat.stat} and \code{shrinkcat.fun} computes a shrinkage
estimate of the ``correlation-adjusted t score''
of Zuber and Strimmer (2008).
of Zuber and Strimmer (2009).
}

\arguments{
Expand All @@ -22,7 +22,7 @@ shrinkcat.fun(L, verbose=TRUE)
}
\details{
The cat (``correlation-adjusted t'') score is the product of the square root of the
inverse correlation matrix with a vector of t scores. In Zuber and Strimmer (2008)
inverse correlation matrix with a vector of t scores. In Zuber and Strimmer (2009)
it is shown that the cat score is
a natural criterion to rank genes according to their ability to seperate two classes
in the presence of correlation among genes.
Expand All @@ -39,8 +39,8 @@ shrinkcat.fun(L, verbose=TRUE)
}

\references{
Zuber, V., and K. Strimmer. 2008. Gene ranking and differential expression
under correlation. In preparation.
Zuber, V., and K. Strimmer. 2009. Gene ranking and biomarker discovery under correlation.
See \url{http://arxiv.org/abs/0902.0751} for publication details.
}
\author{
Verena Zuber
Expand Down
6 changes: 1 addition & 5 deletions man/shrinkt.stat.Rd
Expand Up @@ -16,7 +16,7 @@ shrinkt.fun(L, var.equal=TRUE, verbose=TRUE)
\arguments{
\item{X}{data matrix. Note that the \emph{columns} correspond to variables (``genes'')
and the \emph{rows} to samples.}
\item{L}{vector with class labels for the two groups. }
\item{L}{factor containing class labels for the two groups. }
\item{var.equal}{assume equal (default) or unequal variances in each group.}
\item{verbose}{print out some (more or less useful) information during computation.}
}
Expand Down Expand Up @@ -53,10 +53,6 @@ shrinkt.fun(L, var.equal=TRUE, verbose=TRUE)
}
\seealso{\code{\link{studentt.stat}},
\code{\link{diffmean.stat}},
\code{\link{efront.stat}},
\code{\link{sam.stat}},
\code{\link{samL1.stat}},
\code{\link{modt.stat}},
\code{\link{shrinkcat.stat}}.}

\examples{
Expand Down
2 changes: 1 addition & 1 deletion man/st.package.Rd
Expand Up @@ -8,7 +8,7 @@
This package implements the "shrinkage t" statistic
described in Opgen-Rhein and Strimmer (2007) and a shrinkage estimate
of the "correlation-adjusted t-score" (cat score) introduced in
Zuber and Strimmer (2008). It also offers a convenient interface
Zuber and Strimmer (2009). It also offers a convenient interface
to a number of other regularized t-statistics commonly
employed in high-dimensional case-control studies.
}
Expand Down

0 comments on commit ae8bac0

Please sign in to comment.