[med-svn] [pvclust] 01/03: Imported Upstream version 1.3-2
Andreas Tille
tille at debian.org
Fri Aug 7 14:34:31 UTC 2015
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository pvclust.
commit ec6c3f76701e9243cf7220375087979030f7006a
Author: Andreas Tille <tille at debian.org>
Date: Fri Aug 7 16:31:25 2015 +0200
Imported Upstream version 1.3-2
---
DESCRIPTION | 16 +-
MD5 | 22 +--
NAMESPACE | 36 ++--
R/pvclust-internal.R | 540 +++++++++++++++++++++++++--------------------------
R/pvclust.R | 10 +-
data/lung.RData | Bin
man/lung.Rd | 122 ++++++------
man/msfit.Rd | 138 ++++++-------
man/msplot.Rd | 32 +--
man/plot.pvclust.Rd | 130 ++++++-------
man/print.pvclust.Rd | 72 +++----
man/pvclust.Rd | 0
man/pvpick.Rd | 96 ++++-----
man/seplot.Rd | 46 ++---
14 files changed, 632 insertions(+), 628 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
old mode 100755
new mode 100644
index 77f54dd..a6b4595
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: pvclust
-Version: 1.3-0
-Date: 2014-10-08
+Version: 1.3-2
+Date: 2014-12-19
Title: Hierarchical Clustering with P-Values via Multiscale Bootstrap
Resampling
Author: Ryota Suzuki <suzuki at ef-prime.com>, Hidetoshi Shimodaira
@@ -8,13 +8,13 @@ Author: Ryota Suzuki <suzuki at ef-prime.com>, Hidetoshi Shimodaira
Maintainer: Ryota Suzuki <suzuki at ef-prime.com>
Depends: R (>= 2.10.0)
Suggests: MASS, parallel
-Description: pvclust is a package for assessing the uncertainty in
- hierarchical cluster analysis. It provides AU (approximately
- unbiased) p-values as well as BP (boostrap probability) values
- computed via multiscale bootstrap resampling.
+Description: An implementation of multiscale bootstrap resampling for
+ assessing the uncertainty in hierarchical cluster analysis.
+ It provides AU (approximately unbiased) p-value as well as
+ BP (bootstrap probability) value for each cluster in a dendrogram.
License: GPL (>= 2)
URL: http://www.sigmath.es.osaka-u.ac.jp/shimo-lab/prog/pvclust/
-Packaged: 2014-10-08 11:57:10 UTC; suzuki
+Packaged: 2014-12-19 05:24:46 UTC; suzuki
NeedsCompilation: no
Repository: CRAN
-Date/Publication: 2014-10-08 14:02:05
+Date/Publication: 2014-12-22 06:28:55
diff --git a/MD5 b/MD5
index a1bdb57..d3a054d 100644
--- a/MD5
+++ b/MD5
@@ -1,13 +1,13 @@
-751a6b3f35581b472f4e12f382c79822 *DESCRIPTION
-37c39c6efcd73c5db52c9f7d2d26301b *NAMESPACE
-b0aabf99eb6db36b0452ee07a612dbff *R/pvclust-internal.R
-73faece83dca117e5f5e7f58418d5c34 *R/pvclust.R
+c8d270dc7740a01321089f869aa222d8 *DESCRIPTION
+97c5dfc9e62e9ba7cd789609bc5d7f99 *NAMESPACE
+78aaa368d0e21dfa99912aeb0e1031fc *R/pvclust-internal.R
+667584464eb31a68d58f274d440f01ad *R/pvclust.R
4ce445fdf8be068ed0f770d3c7bafd17 *data/lung.RData
-d4137b4bb2fc7b26f40719391597a20a *man/lung.Rd
-305eedf26b855648f7456e9da01e5094 *man/msfit.Rd
-7fb48846f78962a79e748621b99ba738 *man/msplot.Rd
-9dfaa13e0b453115bd6191036f6a5473 *man/plot.pvclust.Rd
-3ccb94ceeb320278445c2be3fd41bcbb *man/print.pvclust.Rd
+4dd897fecd4b0175cf3318af419bebab *man/lung.Rd
+25915dafebbf8ed6fb9234776ae7349c *man/msfit.Rd
+f2b43095e239bcd8edd83cb0d6b6352c *man/msplot.Rd
+c2c1b6dbd2843eeccbee5ec24da11b49 *man/plot.pvclust.Rd
+1a64c1ea3c377fad1a8d81c67c34f0a7 *man/print.pvclust.Rd
10d182003a1d3ab8ab43b6a0f3759974 *man/pvclust.Rd
-cc1b3150c5eaedb0877afdfd2f385bed *man/pvpick.Rd
-c5bd20b8d802595502f2f6dc4ce989df *man/seplot.Rd
+cfa83769e276f25bdb5c83b430553af5 *man/pvpick.Rd
+3ab1fb9eebdc5f8b3915d71258bee39c *man/seplot.Rd
diff --git a/NAMESPACE b/NAMESPACE
old mode 100755
new mode 100644
index 913b027..b276cec
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,18 +1,18 @@
-export(pvclust)
-export(pvpick)
-export(msfit)
-export(msplot)
-export(pvrect)
-export(seplot)
-export(parPvclust)
-
-S3method(plot, pvclust)
-S3method(lines, pvclust)
-S3method(text, pvclust)
-S3method(print, pvclust)
-S3method(summary, pvclust)
-
-S3method(plot, msfit)
-S3method(lines, msfit)
-S3method(summary, msfit)
-
+export(pvclust)
+export(pvpick)
+export(msfit)
+export(msplot)
+export(pvrect)
+export(seplot)
+export(parPvclust)
+
+S3method(plot, pvclust)
+S3method(lines, pvclust)
+S3method(text, pvclust)
+S3method(print, pvclust)
+S3method(summary, pvclust)
+
+S3method(plot, msfit)
+S3method(lines, msfit)
+S3method(summary, msfit)
+
diff --git a/R/pvclust-internal.R b/R/pvclust-internal.R
old mode 100755
new mode 100644
index 76269ba..22d6417
--- a/R/pvclust-internal.R
+++ b/R/pvclust-internal.R
@@ -1,270 +1,270 @@
-hc2axes <- function(x)
-{
- A <- x$merge # (n,n-1) matrix
- n <- nrow(A) + 1
- x.axis <- c()
- y.axis <- x$height
-
- x.tmp <- rep(0,2)
- zz <- match(1:length(x$order),x$order)
-
- for(i in 1:(n-1)) {
- ai <- A[i,1]
-
- if(ai < 0)
- x.tmp[1] <- zz[-ai]
- else
- x.tmp[1] <- x.axis[ai]
-
- ai <- A[i,2]
-
- if(ai < 0)
- x.tmp[2] <- zz[-ai]
- else
- x.tmp[2] <- x.axis[ai]
-
- x.axis[i] <- mean(x.tmp)
- }
-
- return(data.frame(x.axis=x.axis,y.axis=y.axis))
-}
-
-hc2split <- function(x)
- {
- A <- x$merge # (n-1,n) matrix
- n <- nrow(A) + 1
- B <- list()
-
- for(i in 1:(n-1)){
- ai <- A[i,1]
-
- if(ai < 0)
- B[[i]] <- -ai
- else
- B[[i]] <- B[[ai]]
-
- ai <- A[i,2]
-
- if(ai < 0)
- B[[i]] <- sort(c(B[[i]],-ai))
- else
- B[[i]] <- sort(c(B[[i]],B[[ai]]))
- }
-
- CC <- matrix(rep(0,n*(n-1)),nrow=(n-1),ncol=n)
-
- for(i in 1:(n-1)){
- bi <- B[[i]]
- m <- length(bi)
- for(j in 1:m)
- CC[i,bi[j]] <- 1
- }
-
- split <- list(pattern=apply(CC,1,paste,collapse=""), member=B)
-
- return(split)
- }
-
-pvclust.node <- function(x, r,...)
- {
-# require(pvclust)
- mboot.node <- lapply(r, boot.hclust, nboot=x, ...)
- return(mboot.node)
- }
-
-boot.hclust <- function(r, data, object.hclust, method.dist, use.cor,
- method.hclust, nboot, store, weight=F)
-{
- n <- nrow(data)
- size <- round(n*r, digits=0)
- if(size == 0)
- stop("invalid scale parameter(r)")
- r <- size/n
-
- pattern <- hc2split(object.hclust)$pattern
- edges.cnt <- table(factor(pattern)) - table(factor(pattern))
- st <- list()
-
- # bootstrap start
- rp <- as.character(round(r,digits=2)); if(r == 1) rp <- paste(rp,".0",sep="")
- cat(paste("Bootstrap (r = ", rp, ")... ", sep=""))
- w0 <- rep(1,n) # equal weight
- na.flag <- 0
-
- for(i in 1:nboot){
- if(weight && r>10) { ## <- this part should be improved
- w1 <- as.vector(rmultinom(1,size,w0)) # resampled weight
- suppressWarnings(distance <- distw.pvclust(data,w1,method=method.dist,use.cor=use.cor))
- } else {
- smpl <- sample(1:n, size, replace=TRUE)
- suppressWarnings(distance <- dist.pvclust(data[smpl,],method=method.dist,use.cor=use.cor))
- }
- if(all(is.finite(distance))) { # check if distance is valid
- x.hclust <- hclust(distance,method=method.hclust)
- pattern.i <- hc2split(x.hclust)$pattern # split
- edges.cnt <- edges.cnt + table(factor(pattern.i, levels=pattern))
- } else {
- x.hclust <- NULL
- na.flag <- 1
- }
-
- if(store)
- st[[i]] <- x.hclust
- }
- cat("Done.\n")
- # bootstrap done
-
- if(na.flag == 1)
- warning(paste("inappropriate distance matrices are omitted in computation: r = ", r), call.=FALSE)
-
- boot <- list(edges.cnt=edges.cnt, method.dist=method.dist, use.cor=use.cor,
- method.hclust=method.hclust, nboot=nboot, size=size, r=r, store=st)
- class(boot) <- "boot.hclust"
-
- return(boot)
-}
-
-pvclust.merge <- function(data, object.hclust, mboot){
-
- pattern <- hc2split(object.hclust)$pattern
-
- r <- unlist(lapply(mboot,"[[","r"))
- nboot <- unlist(lapply(mboot,"[[","nboot"))
- store <- lapply(mboot,"[[", "store")
-
- rl <- length(mboot)
- ne <- length(pattern)
-
- edges.bp <- edges.cnt <- data.frame(matrix(rep(0,ne*rl),nrow=ne,ncol=rl))
- row.names(edges.bp) <- pattern
- names(edges.cnt) <- paste("r", 1:rl, sep="")
-
- for(j in 1:rl) {
- edges.cnt[,j] <- as.vector(mboot[[j]]$edges.cnt)
- edges.bp[,j] <- edges.cnt[,j] / nboot[j]
- }
-
- ms.fitted <- lapply(as.list(1:ne),
- function(x, edges.bp, r, nboot){
- msfit(as.vector(t(edges.bp[x,])), r, nboot)},
- edges.bp, r, nboot)
- class(ms.fitted) <- "mslist"
-
- p <- lapply(ms.fitted,"[[","p")
- se <- lapply(ms.fitted,"[[","se")
- coef <- lapply(ms.fitted,"[[","coef")
-
- au <- unlist(lapply(p,"[[","au"))
- bp <- unlist(lapply(p,"[[","bp"))
- se.au <- unlist(lapply(se,"[[","au"))
- se.bp <- unlist(lapply(se,"[[","bp"))
- v <- unlist(lapply(coef,"[[","v"))
- cc <- unlist(lapply(coef,"[[","c"))
- pchi <- unlist(lapply(ms.fitted,"[[","pchi"))
-
- edges.pv <- data.frame(au=au, bp=bp, se.au=se.au, se.bp=se.bp,
- v=v, c=cc, pchi=pchi)
-
- row.names(edges.pv) <- row.names(edges.cnt) <- 1:ne
-
- result <- list(hclust=object.hclust, edges=edges.pv, count=edges.cnt,
- msfit=ms.fitted, nboot=nboot, r=r, store=store)
-
- class(result) <- "pvclust"
- return(result)
-}
-
-dist.pvclust <- function(x, method="euclidean", use.cor="pairwise.complete.obs")
-{
- if(!is.na(pmatch(method,"correlation"))){
- res <- as.dist(1 - cor(x, method="pearson", use=use.cor))
- attr(res,"method") <- "correlation"
- return(res)
- }
- else if(!is.na(pmatch(method,"abscor"))){
- res <- as.dist(1 - abs(cor(x,method="pearson",use=use.cor)))
- attr(res,"method") <- "abscor"
- return(res)
- }
- else if(!is.na(pmatch(method,"uncentered"))){
- if(sum(is.na(x)) > 0){
- x <- na.omit(x)
- warning("Rows including NAs were omitted")
- }
- x <- as.matrix(x)
- P <- crossprod(x)
- qq <- matrix(diag(P),ncol=ncol(P))
- Q <- sqrt(crossprod(qq))
- res <- as.dist(1 - P/Q)
- attr(res,"method") <- "uncentered"
- return(res)
- }
- else
- dist(t(x),method)
-}
-
-
-corw <- function(x,w,
- use=c("all.obs","complete.obs","pairwise.complete.obs")
- ) {
- if(is.data.frame(x)) x <- as.matrix(x)
- x <- x[w>0,,drop=F]
- w <- w[w>0]
-
- n <- nrow(x) # sample size
- m <- ncol(x) # number of variables
- if(missing(w)) w <- rep(1,n)
- r <- matrix(0,m,m,dimnames=list(colnames(x),colnames(x)))
- diag(r) <- 1
- use <- match.arg(use)
-
- pairu <- F
- if(use=="all.obs") {
- u <- rep(T,n)
- } else if(use=="complete.obs") {
- u <- apply(x,1,function(y) !any(is.na(y)))
- } else if(use=="pairwise.complete.obs") {
- pairu <- T
- ux <- is.finite(x)
- } else stop("unknown use")
-
- for(i in 1+seq(length=m-1)) {
- for(j in seq(length=i-1)) {
- if(pairu) u <- ux[,i] & ux[,j]
- wu <- w[u]; xi <- x[u,i]; xj <- x[u,j]
- ws <- sum(wu)
- if(ws > 1e-8) {
- xi <- xi - sum(wu*xi)/ws
- xj <- xj - sum(wu*xj)/ws
- vxi <- sum(wu*xi*xi)/ws
- vxj <- sum(wu*xj*xj)/ws
- if(min(vxi,vxj) > 1e-8) {
- vxij <- sum(wu*xi*xj)/ws
- rij <- vxij/sqrt(vxi*vxj)
- } else {
- rij <- 0
- }
- } else {
- rij <- 0
- }
- r[i,j] <- r[j,i] <- rij
- }
- }
- r
-}
-
-### calculate distance by weight
-distw.pvclust <- function(x,w,method="correlation", use.cor="pairwise.complete.obs")
-{
- if(!is.na(pmatch(method,"correlation"))){
- res <- as.dist(1 - corw(x,w, use=use.cor))
- attr(res,"method") <- "correlation"
- return(res)
- }
- else if(!is.na(pmatch(method,"abscor"))){
- res <- as.dist(1 - abs(corw(x,w, use=use.cor)))
- attr(res,"method") <- "abscor"
- return(res)
- }
- stop("wrong method")
-}
+hc2axes <- function(x)
+{
+ A <- x$merge # (n,n-1) matrix
+ n <- nrow(A) + 1
+ x.axis <- c()
+ y.axis <- x$height
+
+ x.tmp <- rep(0,2)
+ zz <- match(1:length(x$order),x$order)
+
+ for(i in 1:(n-1)) {
+ ai <- A[i,1]
+
+ if(ai < 0)
+ x.tmp[1] <- zz[-ai]
+ else
+ x.tmp[1] <- x.axis[ai]
+
+ ai <- A[i,2]
+
+ if(ai < 0)
+ x.tmp[2] <- zz[-ai]
+ else
+ x.tmp[2] <- x.axis[ai]
+
+ x.axis[i] <- mean(x.tmp)
+ }
+
+ return(data.frame(x.axis=x.axis,y.axis=y.axis))
+}
+
+hc2split <- function(x)
+ {
+ A <- x$merge # (n-1,n) matrix
+ n <- nrow(A) + 1
+ B <- list()
+
+ for(i in 1:(n-1)){
+ ai <- A[i,1]
+
+ if(ai < 0)
+ B[[i]] <- -ai
+ else
+ B[[i]] <- B[[ai]]
+
+ ai <- A[i,2]
+
+ if(ai < 0)
+ B[[i]] <- sort(c(B[[i]],-ai))
+ else
+ B[[i]] <- sort(c(B[[i]],B[[ai]]))
+ }
+
+ CC <- matrix(rep(0,n*(n-1)),nrow=(n-1),ncol=n)
+
+ for(i in 1:(n-1)){
+ bi <- B[[i]]
+ m <- length(bi)
+ for(j in 1:m)
+ CC[i,bi[j]] <- 1
+ }
+
+ split <- list(pattern=apply(CC,1,paste,collapse=""), member=B)
+
+ return(split)
+ }
+
+pvclust.node <- function(x, r,...)
+ {
+# require(pvclust)
+ mboot.node <- lapply(r, boot.hclust, nboot=x, ...)
+ return(mboot.node)
+ }
+
+boot.hclust <- function(r, data, object.hclust, method.dist, use.cor,
+ method.hclust, nboot, store, weight=F)
+{
+ n <- nrow(data)
+ size <- round(n*r, digits=0)
+ if(size == 0)
+ stop("invalid scale parameter(r)")
+ r <- size/n
+
+ pattern <- hc2split(object.hclust)$pattern
+ edges.cnt <- table(factor(pattern)) - table(factor(pattern))
+ st <- list()
+
+ # bootstrap start
+ rp <- as.character(round(r,digits=2)); if(r == 1) rp <- paste(rp,".0",sep="")
+ cat(paste("Bootstrap (r = ", rp, ")... ", sep=""))
+ w0 <- rep(1,n) # equal weight
+ na.flag <- 0
+
+ for(i in 1:nboot){
+ if(weight && r>10) { ## <- this part should be improved
+ w1 <- as.vector(rmultinom(1,size,w0)) # resampled weight
+ suppressWarnings(distance <- distw.pvclust(data,w1,method=method.dist,use.cor=use.cor))
+ } else {
+ smpl <- sample(1:n, size, replace=TRUE)
+ suppressWarnings(distance <- dist.pvclust(data[smpl,],method=method.dist,use.cor=use.cor))
+ }
+ if(all(is.finite(distance))) { # check if distance is valid
+ x.hclust <- hclust(distance,method=method.hclust)
+ pattern.i <- hc2split(x.hclust)$pattern # split
+ edges.cnt <- edges.cnt + table(factor(pattern.i, levels=pattern))
+ } else {
+ x.hclust <- NULL
+ na.flag <- 1
+ }
+
+ if(store)
+ st[[i]] <- x.hclust
+ }
+ cat("Done.\n")
+ # bootstrap done
+
+ if(na.flag == 1)
+ warning(paste("inappropriate distance matrices are omitted in computation: r = ", r), call.=FALSE)
+
+ boot <- list(edges.cnt=edges.cnt, method.dist=method.dist, use.cor=use.cor,
+ method.hclust=method.hclust, nboot=nboot, size=size, r=r, store=st)
+ class(boot) <- "boot.hclust"
+
+ return(boot)
+}
+
+pvclust.merge <- function(data, object.hclust, mboot){
+
+ pattern <- hc2split(object.hclust)$pattern
+
+ r <- unlist(lapply(mboot,"[[","r"))
+ nboot <- unlist(lapply(mboot,"[[","nboot"))
+ store <- lapply(mboot,"[[", "store")
+
+ rl <- length(mboot)
+ ne <- length(pattern)
+
+ edges.bp <- edges.cnt <- data.frame(matrix(rep(0,ne*rl),nrow=ne,ncol=rl))
+ row.names(edges.bp) <- pattern
+ names(edges.cnt) <- paste("r", 1:rl, sep="")
+
+ for(j in 1:rl) {
+ edges.cnt[,j] <- as.vector(mboot[[j]]$edges.cnt)
+ edges.bp[,j] <- edges.cnt[,j] / nboot[j]
+ }
+
+ ms.fitted <- lapply(as.list(1:ne),
+ function(x, edges.bp, r, nboot){
+ msfit(as.vector(t(edges.bp[x,])), r, nboot)},
+ edges.bp, r, nboot)
+ class(ms.fitted) <- "mslist"
+
+ p <- lapply(ms.fitted,"[[","p")
+ se <- lapply(ms.fitted,"[[","se")
+ coef <- lapply(ms.fitted,"[[","coef")
+
+ au <- unlist(lapply(p,"[[","au"))
+ bp <- unlist(lapply(p,"[[","bp"))
+ se.au <- unlist(lapply(se,"[[","au"))
+ se.bp <- unlist(lapply(se,"[[","bp"))
+ v <- unlist(lapply(coef,"[[","v"))
+ cc <- unlist(lapply(coef,"[[","c"))
+ pchi <- unlist(lapply(ms.fitted,"[[","pchi"))
+
+ edges.pv <- data.frame(au=au, bp=bp, se.au=se.au, se.bp=se.bp,
+ v=v, c=cc, pchi=pchi)
+
+ row.names(edges.pv) <- row.names(edges.cnt) <- 1:ne
+
+ result <- list(hclust=object.hclust, edges=edges.pv, count=edges.cnt,
+ msfit=ms.fitted, nboot=nboot, r=r, store=store)
+
+ class(result) <- "pvclust"
+ return(result)
+}
+
+dist.pvclust <- function(x, method="euclidean", use.cor="pairwise.complete.obs")
+{
+ if(!is.na(pmatch(method,"correlation"))){
+ res <- as.dist(1 - cor(x, method="pearson", use=use.cor))
+ attr(res,"method") <- "correlation"
+ return(res)
+ }
+ else if(!is.na(pmatch(method,"abscor"))){
+ res <- as.dist(1 - abs(cor(x,method="pearson",use=use.cor)))
+ attr(res,"method") <- "abscor"
+ return(res)
+ }
+ else if(!is.na(pmatch(method,"uncentered"))){
+ if(sum(is.na(x)) > 0){
+ x <- na.omit(x)
+ warning("Rows including NAs were omitted")
+ }
+ x <- as.matrix(x)
+ P <- crossprod(x)
+ qq <- matrix(diag(P),ncol=ncol(P))
+ Q <- sqrt(crossprod(qq))
+ res <- as.dist(1 - P/Q)
+ attr(res,"method") <- "uncentered"
+ return(res)
+ }
+ else
+ dist(t(x),method)
+}
+
+
+corw <- function(x,w,
+ use=c("all.obs","complete.obs","pairwise.complete.obs")
+ ) {
+ if(is.data.frame(x)) x <- as.matrix(x)
+ x <- x[w>0,,drop=F]
+ w <- w[w>0]
+
+ n <- nrow(x) # sample size
+ m <- ncol(x) # number of variables
+ if(missing(w)) w <- rep(1,n)
+ r <- matrix(0,m,m,dimnames=list(colnames(x),colnames(x)))
+ diag(r) <- 1
+ use <- match.arg(use)
+
+ pairu <- F
+ if(use=="all.obs") {
+ u <- rep(T,n)
+ } else if(use=="complete.obs") {
+ u <- apply(x,1,function(y) !any(is.na(y)))
+ } else if(use=="pairwise.complete.obs") {
+ pairu <- T
+ ux <- is.finite(x)
+ } else stop("unknown use")
+
+ for(i in 1+seq(length=m-1)) {
+ for(j in seq(length=i-1)) {
+ if(pairu) u <- ux[,i] & ux[,j]
+ wu <- w[u]; xi <- x[u,i]; xj <- x[u,j]
+ ws <- sum(wu)
+ if(ws > 1e-8) {
+ xi <- xi - sum(wu*xi)/ws
+ xj <- xj - sum(wu*xj)/ws
+ vxi <- sum(wu*xi*xi)/ws
+ vxj <- sum(wu*xj*xj)/ws
+ if(min(vxi,vxj) > 1e-8) {
+ vxij <- sum(wu*xi*xj)/ws
+ rij <- vxij/sqrt(vxi*vxj)
+ } else {
+ rij <- 0
+ }
+ } else {
+ rij <- 0
+ }
+ r[i,j] <- r[j,i] <- rij
+ }
+ }
+ r
+}
+
+### calculate distance by weight
+distw.pvclust <- function(x,w,method="correlation", use.cor="pairwise.complete.obs")
+{
+ if(!is.na(pmatch(method,"correlation"))){
+ res <- as.dist(1 - corw(x,w, use=use.cor))
+ attr(res,"method") <- "correlation"
+ return(res)
+ }
+ else if(!is.na(pmatch(method,"abscor"))){
+ res <- as.dist(1 - abs(corw(x,w, use=use.cor)))
+ attr(res,"method") <- "abscor"
+ return(res)
+ }
+ stop("wrong method")
+}
diff --git a/R/pvclust.R b/R/pvclust.R
old mode 100755
new mode 100644
index a3f590a..74bbc61
--- a/R/pvclust.R
+++ b/R/pvclust.R
@@ -287,12 +287,16 @@ parPvclust <- function(cl=NULL, data, method.hclust="average",
n <- nrow(data); p <- ncol(data)
# hclust for original data
- METHODS <- c("ward", "single", "complete", "average", "mcquitty",
- "median", "centroid")
- method.hclust <- METHODS[pmatch(method.hclust, METHODS)]
+ #METHODS <- c("ward", "single", "complete", "average", "mcquitty",
+ # "median", "centroid")
+ #method.hclust <- METHODS[pmatch(method.hclust, METHODS)]
+
distance <- dist.pvclust(data, method=method.dist, use.cor=use.cor)
data.hclust <- hclust(distance, method=method.hclust)
+ # ward -> ward.D
+ if(method.hclust == "ward") method.hclust <- "ward.D"
+
# multiscale bootstrap
size <- floor(n*r)
rl <- length(size)
diff --git a/data/lung.RData b/data/lung.RData
old mode 100755
new mode 100644
diff --git a/man/lung.Rd b/man/lung.Rd
old mode 100755
new mode 100644
index 7ebcdec..0667b0a
--- a/man/lung.Rd
+++ b/man/lung.Rd
@@ -1,61 +1,61 @@
-\name{lung}
-\docType{data}
-\alias{lung}
-\title{DNA Microarray Data of Lung Tumors}
-\description{
-DNA Microarray data of 73 lung tissues including 67 lung tumors.
-There are 916 observations of genes for each lung tissue.
-}
-\usage{data(lung)}
-\format{data frame of size \eqn{916 \times 73}{(916, 73)}.}
-\details{
- This dataset has been modified from original data. Each one
- observation of duplicate genes has been removed. See \code{source}
- section in this help for original data source.
-}
-\examples{
-\donttest{
-## Reading the data
-data(lung)
-
-## Multiscale Bootstrap Resampling
-lung.pv <- pvclust(lung, nboot=100)
-
-## CAUTION: nboot=100 may be too small for actual use.
-## We suggest nboot=1000 or larger.
-## plot/print functions will be useful for diagnostics.
-
-## Plot the result
-plot(lung.pv, cex=0.8, cex.pv=0.7)
-
-ask.bak <- par()$ask
-par(ask=TRUE)
-
-pvrect(lung.pv, alpha=0.9)
-msplot(lung.pv, edges=c(51,62,68,71))
-
-par(ask=ask.bak)
-
-## Print a cluster with high p-value
-lung.pp <- pvpick(lung.pv, alpha=0.9)
-lung.pp$clusters[[2]]
-
-## Print its edge number
-lung.pp$edges[2]
-}
-
-## We recommend parallel computing for large dataset as this one
-\dontrun{
-library(snow)
-cl <- makeCluster(10, type="MPI")
-lung.pv <- parPvclust(cl, lung, nboot=1000)
-}
-}
-\source{\url{http://genome-www.stanford.edu/lung_cancer/adeno/}}
-\references{
- Garber, M. E. et al. (2001)
- "Diversity of gene expression in adenocarcinoma of the lung",
- \emph{Proceedings of the National Academy of Sciences},
- 98, 13784-13789.
-}
-\keyword{datasets}
+\name{lung}
+\docType{data}
+\alias{lung}
+\title{DNA Microarray Data of Lung Tumors}
+\description{
+DNA Microarray data of 73 lung tissues including 67 lung tumors.
+There are 916 observations of genes for each lung tissue.
+}
+\usage{data(lung)}
+\format{data frame of size \eqn{916 \times 73}{(916, 73)}.}
+\details{
+ This dataset has been modified from original data. Each one
+ observation of duplicate genes has been removed. See \code{source}
+ section in this help for original data source.
+}
+\examples{
+\donttest{
+## Reading the data
+data(lung)
+
+## Multiscale Bootstrap Resampling
+lung.pv <- pvclust(lung, nboot=100)
+
+## CAUTION: nboot=100 may be too small for actual use.
+## We suggest nboot=1000 or larger.
+## plot/print functions will be useful for diagnostics.
+
+## Plot the result
+plot(lung.pv, cex=0.8, cex.pv=0.7)
+
+ask.bak <- par()$ask
+par(ask=TRUE)
+
+pvrect(lung.pv, alpha=0.9)
+msplot(lung.pv, edges=c(51,62,68,71))
+
+par(ask=ask.bak)
+
+## Print a cluster with high p-value
+lung.pp <- pvpick(lung.pv, alpha=0.9)
+lung.pp$clusters[[2]]
+
+## Print its edge number
+lung.pp$edges[2]
+}
+
+## We recommend parallel computing for large dataset as this one
+\dontrun{
+library(snow)
+cl <- makeCluster(10, type="MPI")
+lung.pv <- parPvclust(cl, lung, nboot=1000)
+}
+}
+\source{\url{http://genome-www.stanford.edu/lung_cancer/adeno/}}
+\references{
+ Garber, M. E. et al. (2001)
+ "Diversity of gene expression in adenocarcinoma of the lung",
+ \emph{Proceedings of the National Academy of Sciences},
+ 98, 13784-13789.
+}
+\keyword{datasets}
diff --git a/man/msfit.Rd b/man/msfit.Rd
old mode 100755
new mode 100644
index 2f84619..62ed3e1
--- a/man/msfit.Rd
+++ b/man/msfit.Rd
@@ -1,70 +1,70 @@
-\name{msfit}
-\alias{msfit}
-\alias{plot.msfit}
-\alias{lines.msfit}
-\alias{summary.msfit}
-\title{Curve Fitting for Multiscale Bootstrap Resampling}
-\description{\code{msfit} performs curve fitting for multiscale
- bootstrap resampling. It generates an object of class
- \code{msfit}. Several generic methods are available.
-}
-\usage{
-msfit(bp, r, nboot)
-
-\method{plot}{msfit}(x, curve=TRUE, main=NULL, sub=NULL, xlab=NULL, ylab=NULL, ...)
-
-\method{lines}{msfit}(x, col=2, lty=1, ...)
-
-\method{summary}{msfit}(object, digits=3, ...)
-}
-\arguments{
- \item{bp}{numeric vector of bootstrap probability values.}
- \item{r}{numeric vector of relative sample size of bootstrap samples
- defined as \eqn{r=n'/n} for original sample size \eqn{n} and
- bootstrap sample size \eqn{n'}.}
- \item{nboot}{numeric value (vector) of the number of bootstrap
- replications.}
- \item{x}{object of class \code{msfit}.}
- \item{curve}{logical. If \code{TRUE}, the fitted curve is drawn.}
- \item{main, sub, xlab, ylab, col, lty}{generic graphic parameters.}
- \item{object}{object of class \code{msfit}.}
- \item{digits}{integer indicating the precision to be used in rounding.}
- \item{...}{other parameters to be used in the functions.}
-}
-\details{
- function \code{msfit} performs the curve fitting for multiscale
- bootstrap resampling. In package \code{pvclust} this function is only
- called from the function \code{pvclust} (or \code{parPvclust}), and
- may never be called from users. However one can access a list of
- \code{msfit} objects by \code{x$msfit}, where \code{x} is an object of
- class \code{pvclust}.
-}
-\value{\code{msfit} returns an object of class \code{msfit}. It contains
- the following objects:
- \item{p}{numeric vector of \eqn{p}-values. \code{au} is AU
- (Approximately Unbiased) \eqn{p}-value computed by multiscale
- bootstrap resampling, which is more accurate than BP value
- (explained below) as unbiased \eqn{p}-value. \code{bp} is BP
- (Bootstrap Probability) value, which is simple but tends to be
- unbiased when the absolute value of \code{c} (a value in \code{coef}
- vector, explained below) is large.}
- \item{se}{numeric vector of estimated standard errors of \eqn{p}-values.}
- \item{coef}{numeric vector related to geometric aspects of
- hypotheses. \code{v} is signed distance and \code{c} is curvature of
- the boundary.}
- \item{df}{numeric value of the degree of freedom in curve fitting.}
- \item{rss}{residual sum of squares.}
- \item{pchi}{\eqn{p}-value of chi-square test based on asymptotic theory.}
-}
-\references{
- Shimodaira, H. (2004)
- "Approximately unbiased tests of regions using multistep-multiscale
- bootstrap resampling",
- \emph{Annals of Statistics}, 32, 2616-2641.
-
- Shimodaira, H. (2002)
- "An approximately unbiased test of phylogenetic tree selection",
- \emph{Systematic Biology}, 51, 492-508.
-}
-\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
+\name{msfit}
+\alias{msfit}
+\alias{plot.msfit}
+\alias{lines.msfit}
+\alias{summary.msfit}
+\title{Curve Fitting for Multiscale Bootstrap Resampling}
+\description{\code{msfit} performs curve fitting for multiscale
+ bootstrap resampling. It generates an object of class
+ \code{msfit}. Several generic methods are available.
+}
+\usage{
+msfit(bp, r, nboot)
+
+\method{plot}{msfit}(x, curve=TRUE, main=NULL, sub=NULL, xlab=NULL, ylab=NULL, ...)
+
+\method{lines}{msfit}(x, col=2, lty=1, ...)
+
+\method{summary}{msfit}(object, digits=3, ...)
+}
+\arguments{
+ \item{bp}{numeric vector of bootstrap probability values.}
+ \item{r}{numeric vector of relative sample size of bootstrap samples
+ defined as \eqn{r=n'/n} for original sample size \eqn{n} and
+ bootstrap sample size \eqn{n'}.}
+ \item{nboot}{numeric value (vector) of the number of bootstrap
+ replications.}
+ \item{x}{object of class \code{msfit}.}
+ \item{curve}{logical. If \code{TRUE}, the fitted curve is drawn.}
+ \item{main, sub, xlab, ylab, col, lty}{generic graphic parameters.}
+ \item{object}{object of class \code{msfit}.}
+ \item{digits}{integer indicating the precision to be used in rounding.}
+ \item{...}{other parameters to be used in the functions.}
+}
+\details{
+ function \code{msfit} performs the curve fitting for multiscale
+ bootstrap resampling. In package \code{pvclust} this function is only
+ called from the function \code{pvclust} (or \code{parPvclust}), and
+ may never be called from users. However one can access a list of
+ \code{msfit} objects by \code{x$msfit}, where \code{x} is an object of
+ class \code{pvclust}.
+}
+\value{\code{msfit} returns an object of class \code{msfit}. It contains
+ the following objects:
+ \item{p}{numeric vector of \eqn{p}-values. \code{au} is AU
+ (Approximately Unbiased) \eqn{p}-value computed by multiscale
+ bootstrap resampling, which is more accurate than BP value
+ (explained below) as unbiased \eqn{p}-value. \code{bp} is BP
+ (Bootstrap Probability) value, which is simple but tends to be
+ unbiased when the absolute value of \code{c} (a value in \code{coef}
+ vector, explained below) is large.}
+ \item{se}{numeric vector of estimated standard errors of \eqn{p}-values.}
+ \item{coef}{numeric vector related to geometric aspects of
+ hypotheses. \code{v} is signed distance and \code{c} is curvature of
+ the boundary.}
+ \item{df}{numeric value of the degree of freedom in curve fitting.}
+ \item{rss}{residual sum of squares.}
+ \item{pchi}{\eqn{p}-value of chi-square test based on asymptotic theory.}
+}
+\references{
+ Shimodaira, H. (2004)
+ "Approximately unbiased tests of regions using multistep-multiscale
+ bootstrap resampling",
+ \emph{Annals of Statistics}, 32, 2616-2641.
+
+ Shimodaira, H. (2002)
+ "An approximately unbiased test of phylogenetic tree selection",
+ \emph{Systematic Biology}, 51, 492-508.
+}
+\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
\keyword{htest}
\ No newline at end of file
diff --git a/man/msplot.Rd b/man/msplot.Rd
old mode 100755
new mode 100644
index 3713473..c8ad27f
--- a/man/msplot.Rd
+++ b/man/msplot.Rd
@@ -1,16 +1,16 @@
-\name{msplot}
-\alias{msplot}
-\title{Drawing the Results of Curve Fitting for Pvclust Object}
-\description{draws the results of curve fitting for pvclust object.
-}
-\usage{
-msplot(x, edges=NULL, ...)
-}
-\arguments{
- \item{x}{object of class \code{pvclust}.}
- \item{edges}{numeric vector of edge numbers to be plotted.}
- \item{...}{other parameters to be used in the function.}
-}
-\seealso{\code{\link{plot.msfit}}}
-\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
-\keyword{hplot}
+\name{msplot}
+\alias{msplot}
+\title{Drawing the Results of Curve Fitting for Pvclust Object}
+\description{draws the results of curve fitting for pvclust object.
+}
+\usage{
+msplot(x, edges=NULL, ...)
+}
+\arguments{
+ \item{x}{object of class \code{pvclust}.}
+ \item{edges}{numeric vector of edge numbers to be plotted.}
+ \item{...}{other parameters to be used in the function.}
+}
+\seealso{\code{\link{plot.msfit}}}
+\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
+\keyword{hplot}
diff --git a/man/plot.pvclust.Rd b/man/plot.pvclust.Rd
old mode 100755
new mode 100644
index b3296de..9bbc637
--- a/man/plot.pvclust.Rd
+++ b/man/plot.pvclust.Rd
@@ -1,65 +1,65 @@
-\name{plot.pvclust}
-\alias{plot.pvclust}
-\alias{text.pvclust}
-\title{Draws Dendrogram with P-values for Pvclust Object}
-\description{
- plot dendrogram for a \code{pvclust} object and add \eqn{p}-values for
- clusters.
-}
-\usage{
-\method{plot}{pvclust}(x, print.pv=TRUE, print.num=TRUE, float=0.01,
- col.pv=c(2,3,8), cex.pv=0.8, font.pv=NULL, col=NULL, cex=NULL,
- font=NULL, lty=NULL, lwd=NULL, main=NULL, sub=NULL, xlab=NULL, ...)
-
-\method{text}{pvclust}(x, col=c(2,3,8), print.num=TRUE, float=0.01, cex=NULL, font=NULL, ...)
-}
-\arguments{
- \item{x}{object of class \code{pvclust}, which is generated by
- function \code{pvclust}. See \code{\link{pvclust}} for details.}
- \item{print.pv}{logical flag to specify whether print \eqn{p}-values
- above the edges (clusters).}
- \item{print.num}{logical flag to specify whether print edge numbers
- below clusters.}
- \item{float}{numeric value to adjust the height of \eqn{p}-values from
- edges.}
- \item{col.pv}{numeric vector of length three to specify the colors for
- \eqn{p}-values and edge numbers. From the beginning each value
- corresponds to the color of AU values, BP values and edge numbers,
- respectively.}
- \item{cex.pv}{numeric value which specifies the size of characters for
- \eqn{p}-values and edge numbers. See \code{cex} argument for
- \code{\link[graphics]{par}}.}
- \item{font.pv}{numeric value which specifies the font of characters
- for \eqn{p}-values and edge numbers. See \code{font} argument for
- \code{\link[graphics]{par}}.}
- \item{col, cex, font}{in \code{text} function, they correspond to
- \code{col.pv}, \code{cex.pv} and \code{font.pv} in \code{plot}
- function, respectively. In \code{plot} function they are used as
- generic graphic parameters.}
- \item{lty, lwd, main, sub, xlab, ...}{
- generic graphic parameters. See \code{\link[graphics]{par}} for
- details.}
-}
-\details{
- This function plots a dendrogram with \eqn{p}-values for given object
- of class \code{pvclust}. AU \eqn{p}-value (printed in red color in
- default) is the abbreviation of "approximately unbiased"
- \eqn{p}-value, which is calculated by multiscale bootstrap
- resampling. BP value (printed in green color in default) is "bootstrap
- probability" value, which is less accurate than AU value as
- \eqn{p}-value. One can consider that clusters (edges) with high AU
- values (e.g. 95\%) are strongly supported by data.
-}
-\seealso{\code{\link{text.pvclust}}}
-\references{
- Shimodaira, H. (2004)
- "Approximately unbiased tests of regions using multistep-multiscale
- bootstrap resampling",
- \emph{Annals of Statistics}, 32, 2616-2641.
-
- Shimodaira, H. (2002)
- "An approximately unbiased test of phylogenetic tree selection",
- \emph{Systematic Biology}, 51, 492-508.
-}
-\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
-\keyword{hplot}
+\name{plot.pvclust}
+\alias{plot.pvclust}
+\alias{text.pvclust}
+\title{Draws Dendrogram with P-values for Pvclust Object}
+\description{
+ plot dendrogram for a \code{pvclust} object and add \eqn{p}-values for
+ clusters.
+}
+\usage{
+\method{plot}{pvclust}(x, print.pv=TRUE, print.num=TRUE, float=0.01,
+ col.pv=c(2,3,8), cex.pv=0.8, font.pv=NULL, col=NULL, cex=NULL,
+ font=NULL, lty=NULL, lwd=NULL, main=NULL, sub=NULL, xlab=NULL, ...)
+
+\method{text}{pvclust}(x, col=c(2,3,8), print.num=TRUE, float=0.01, cex=NULL, font=NULL, ...)
+}
+\arguments{
+ \item{x}{object of class \code{pvclust}, which is generated by
+ function \code{pvclust}. See \code{\link{pvclust}} for details.}
+ \item{print.pv}{logical flag to specify whether print \eqn{p}-values
+ above the edges (clusters).}
+ \item{print.num}{logical flag to specify whether print edge numbers
+ below clusters.}
+ \item{float}{numeric value to adjust the height of \eqn{p}-values from
+ edges.}
+ \item{col.pv}{numeric vector of length three to specify the colors for
+ \eqn{p}-values and edge numbers. From the beginning each value
+ corresponds to the color of AU values, BP values and edge numbers,
+ respectively.}
+ \item{cex.pv}{numeric value which specifies the size of characters for
+ \eqn{p}-values and edge numbers. See \code{cex} argument for
+ \code{\link[graphics]{par}}.}
+ \item{font.pv}{numeric value which specifies the font of characters
+ for \eqn{p}-values and edge numbers. See \code{font} argument for
+ \code{\link[graphics]{par}}.}
+ \item{col, cex, font}{in \code{text} function, they correspond to
+ \code{col.pv}, \code{cex.pv} and \code{font.pv} in \code{plot}
+ function, respectively. In \code{plot} function they are used as
+ generic graphic parameters.}
+ \item{lty, lwd, main, sub, xlab, ...}{
+ generic graphic parameters. See \code{\link[graphics]{par}} for
+ details.}
+}
+\details{
+ This function plots a dendrogram with \eqn{p}-values for given object
+ of class \code{pvclust}. AU \eqn{p}-value (printed in red color in
+ default) is the abbreviation of "approximately unbiased"
+ \eqn{p}-value, which is calculated by multiscale bootstrap
+ resampling. BP value (printed in green color in default) is "bootstrap
+ probability" value, which is less accurate than AU value as
+ \eqn{p}-value. One can consider that clusters (edges) with high AU
+ values (e.g. 95\%) are strongly supported by data.
+}
+\seealso{\code{\link{text.pvclust}}}
+\references{
+ Shimodaira, H. (2004)
+ "Approximately unbiased tests of regions using multistep-multiscale
+ bootstrap resampling",
+ \emph{Annals of Statistics}, 32, 2616-2641.
+
+ Shimodaira, H. (2002)
+ "An approximately unbiased test of phylogenetic tree selection",
+ \emph{Systematic Biology}, 51, 492-508.
+}
+\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
+\keyword{hplot}
diff --git a/man/print.pvclust.Rd b/man/print.pvclust.Rd
old mode 100755
new mode 100644
index 3314756..87f04d4
--- a/man/print.pvclust.Rd
+++ b/man/print.pvclust.Rd
@@ -1,37 +1,37 @@
-\name{print.pvclust}
-\alias{print.pvclust}
-\title{Print Function for Pvclust Object}
-\description{print clustering method and distance measure used in
- hierarchical clustering, \eqn{p}-values and related statistics for
- a \code{pvclust} object.
-}
-\usage{
-\method{print}{pvclust}(x, which=NULL, digits=3, ...)
-}
-\arguments{
- \item{x}{object of class \code{pvclust}.}
- \item{which}{numeric vector which specifies the numbers of edges
- (clusters) of which the values are printed. If \code{NULL} is given,
- it prints the values of all edges. The default is \code{NULL}.}
- \item{digits}{integer indicating the precision to be used in
- rounding.}
- \item{...}{other parameters used in the function.}
-}
-\value{this function prints \eqn{p}-values and some related
- statistics.
- \item{au}{AU (Approximately Unbiased) \eqn{p}-value, which is more
- accurate than BP value as unbiased \eqn{p}-value. It is computed by
- multiscale bootstrap resampling.}
- \item{bp}{BP (Bootstrap Probability) value, which is a simple
- statistic computed by bootstrap resampling. This value tends to be
- biased as \eqn{p}-value when the absolute value of \code{c}
- (explained below) is large.}
- \item{se.au, se.bp}{estimated standard errors for \code{au} and
- \code{bp}, respectively.}
- \item{v, c}{values related to geometric aspects of
- hypotheses. \code{v} is signed distance and \code{c} is curvature of
- the boundary.}
- \item{pchi}{\eqn{p}-values of chi-square test based on asymptotic theory.}
-}
-\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
+\name{print.pvclust}
+\alias{print.pvclust}
+\title{Print Function for Pvclust Object}
+\description{print clustering method and distance measure used in
+ hierarchical clustering, \eqn{p}-values and related statistics for
+ a \code{pvclust} object.
+}
+\usage{
+\method{print}{pvclust}(x, which=NULL, digits=3, ...)
+}
+\arguments{
+ \item{x}{object of class \code{pvclust}.}
+ \item{which}{numeric vector which specifies the numbers of edges
+ (clusters) of which the values are printed. If \code{NULL} is given,
+ it prints the values of all edges. The default is \code{NULL}.}
+ \item{digits}{integer indicating the precision to be used in
+ rounding.}
+ \item{...}{other parameters used in the function.}
+}
+\value{this function prints \eqn{p}-values and some related
+ statistics.
+ \item{au}{AU (Approximately Unbiased) \eqn{p}-value, which is more
+ accurate than BP value as unbiased \eqn{p}-value. It is computed by
+ multiscale bootstrap resampling.}
+ \item{bp}{BP (Bootstrap Probability) value, which is a simple
+ statistic computed by bootstrap resampling. This value tends to be
+ biased as \eqn{p}-value when the absolute value of \code{c}
+ (explained below) is large.}
+ \item{se.au, se.bp}{estimated standard errors for \code{au} and
+ \code{bp}, respectively.}
+ \item{v, c}{values related to geometric aspects of
+ hypotheses. \code{v} is signed distance and \code{c} is curvature of
+ the boundary.}
+ \item{pchi}{\eqn{p}-values of chi-square test based on asymptotic theory.}
+}
+\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
\keyword{print}
\ No newline at end of file
diff --git a/man/pvclust.Rd b/man/pvclust.Rd
old mode 100755
new mode 100644
diff --git a/man/pvpick.Rd b/man/pvpick.Rd
old mode 100755
new mode 100644
index cad64a2..b866955
--- a/man/pvpick.Rd
+++ b/man/pvpick.Rd
@@ -1,49 +1,49 @@
-\name{pvpick}
-\alias{pvpick}
-\alias{pvrect}
-\alias{lines.pvclust}
-\title{Find Clusters with High/Low P-values}
-\description{find clusters with relatively high/low
- \eqn{p}-values. \code{pvrect} and \code{lines} (S3 method for class
- \code{pvclust}) highlight such clusters in existing plot, and
- \code{pvpick} returns a list of such clusters.
-}
-\usage{
-pvpick(x, alpha=0.95, pv="au", type="geq", max.only=TRUE)
-
-pvrect(x, alpha=0.95, pv="au", type="geq", max.only=TRUE, border=2, ...)
-
-\method{lines}{pvclust}(x, alpha=0.95, pv="au", type="geq", col=2, lwd=2, ...)
-}
-\arguments{
- \item{x}{object of class \code{pvclust}.}
- \item{alpha}{threshold value for \eqn{p}-values.}
- \item{pv}{character string which specifies the \eqn{p}-value to be
- used. It should be either of \code{"au"} or \code{"bp"},
- corresponding to AU \eqn{p}-value or BP value, respectively. See
- \code{plot.pvclust} for details.}
- \item{type}{one of \code{"geq"}, \code{"leq"}, \code{"gt"} or
- \code{"lt"}. If \code{"geq"} is specified, clusters with
- \eqn{p}-value \emph{greater than or equals} the threshold given by
- \code{"alpha"} are returned or displayed. Likewise \code{"leq"}
- stands for \emph{lower than or equals}, \code{"gt"} for
- \emph{greater than} and \code{"lt"} for \emph{lower than} the
- threshold value. The default is \code{"geq"}.}
- \item{max.only}{logical. If some of clusters with high/low
- \eqn{p}-values have inclusion relation, only the largest cluster is
- returned (or displayed) when \code{max.only=TRUE}.}
- \item{border}{numeric value which specifies the color of borders of
- rectangles.}
- \item{col}{numeric value which specifies the color of lines.}
- \item{lwd}{numeric value which specifies the width of lines.}
- \item{...}{other graphic parameters to be used.}
-}
-\value{\code{pvpick} returns a list which contains the following values.
- \item{clusters}{a list of character string vectors. Each vector
- corresponds to the names of objects in each cluster.}
- \item{edges}{numeric vector of edge numbers. The \eqn{i}'th element
- (number) corresponds to the \eqn{i}'th name vector in
- \code{clusters}.}
- }
-\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
+\name{pvpick}
+\alias{pvpick}
+\alias{pvrect}
+\alias{lines.pvclust}
+\title{Find Clusters with High/Low P-values}
+\description{find clusters with relatively high/low
+ \eqn{p}-values. \code{pvrect} and \code{lines} (S3 method for class
+ \code{pvclust}) highlight such clusters in existing plot, and
+ \code{pvpick} returns a list of such clusters.
+}
+\usage{
+pvpick(x, alpha=0.95, pv="au", type="geq", max.only=TRUE)
+
+pvrect(x, alpha=0.95, pv="au", type="geq", max.only=TRUE, border=2, ...)
+
+\method{lines}{pvclust}(x, alpha=0.95, pv="au", type="geq", col=2, lwd=2, ...)
+}
+\arguments{
+ \item{x}{object of class \code{pvclust}.}
+ \item{alpha}{threshold value for \eqn{p}-values.}
+ \item{pv}{character string which specifies the \eqn{p}-value to be
+ used. It should be either of \code{"au"} or \code{"bp"},
+ corresponding to AU \eqn{p}-value or BP value, respectively. See
+ \code{plot.pvclust} for details.}
+ \item{type}{one of \code{"geq"}, \code{"leq"}, \code{"gt"} or
+ \code{"lt"}. If \code{"geq"} is specified, clusters with
+ \eqn{p}-value \emph{greater than or equals} the threshold given by
+ \code{"alpha"} are returned or displayed. Likewise \code{"leq"}
+ stands for \emph{lower than or equals}, \code{"gt"} for
+ \emph{greater than} and \code{"lt"} for \emph{lower than} the
+ threshold value. The default is \code{"geq"}.}
+ \item{max.only}{logical. If some of clusters with high/low
+ \eqn{p}-values have inclusion relation, only the largest cluster is
+ returned (or displayed) when \code{max.only=TRUE}.}
+ \item{border}{numeric value which specifies the color of borders of
+ rectangles.}
+ \item{col}{numeric value which specifies the color of lines.}
+ \item{lwd}{numeric value which specifies the width of lines.}
+ \item{...}{other graphic parameters to be used.}
+}
+\value{\code{pvpick} returns a list which contains the following values.
+ \item{clusters}{a list of character string vectors. Each vector
+ corresponds to the names of objects in each cluster.}
+ \item{edges}{numeric vector of edge numbers. The \eqn{i}'th element
+ (number) corresponds to the \eqn{i}'th name vector in
+ \code{clusters}.}
+ }
+\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
\keyword{aplot}
\ No newline at end of file
diff --git a/man/seplot.Rd b/man/seplot.Rd
old mode 100755
new mode 100644
index fe3bc4f..f5b2bee
--- a/man/seplot.Rd
+++ b/man/seplot.Rd
@@ -1,23 +1,23 @@
-\name{seplot}
-\alias{seplot}
-\title{Diagnostic Plot for Standard Error of p-value}
-\description{draws diagnostic plot for standard error of \eqn{p}-value
- for pvclust object.
-}
-\usage{
-seplot(object, type=c("au", "bp"), identify=FALSE, main=NULL,
-xlab=NULL, ylab=NULL, ...)
-}
-\arguments{
- \item{object}{object of class \code{pvclust}.}
- \item{type}{the type of \eqn{p}-value to be plotted, one of \code{"au"}
- or \code{"bp"}.}
- \item{identify}{logical. If \code{TRUE}, edge numbers can be identified
- interactively. See \code{\link{identify}} for basic usage.}
- \item{main, xlab, ylab}{generic graphic parameters. See
- \code{\link[graphics]{par}} for details.}
- \item{...}{other graphical parameters to be passed to generic
- \code{plot} or \code{identify} function.}
-}
-\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
-\keyword{hplot}
+\name{seplot}
+\alias{seplot}
+\title{Diagnostic Plot for Standard Error of p-value}
+\description{draws diagnostic plot for standard error of \eqn{p}-value
+ for pvclust object.
+}
+\usage{
+seplot(object, type=c("au", "bp"), identify=FALSE, main=NULL,
+xlab=NULL, ylab=NULL, ...)
+}
+\arguments{
+ \item{object}{object of class \code{pvclust}.}
+ \item{type}{the type of \eqn{p}-value to be plotted, one of \code{"au"}
+ or \code{"bp"}.}
+ \item{identify}{logical. If \code{TRUE}, edge numbers can be identified
+ interactively. See \code{\link{identify}} for basic usage.}
+ \item{main, xlab, ylab}{generic graphic parameters. See
+ \code{\link[graphics]{par}} for details.}
+ \item{...}{other graphical parameters to be passed to generic
+ \code{plot} or \code{identify} function.}
+}
+\author{Ryota Suzuki \email{suzuki at ef-prime.com}}
+\keyword{hplot}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/pvclust.git
More information about the debian-med-commit
mailing list