Skip to content

Commit

Permalink
version 1.57
Browse files Browse the repository at this point in the history
  • Loading branch information
bnaras authored and cran-robot committed Jul 2, 2024
1 parent ba29ab0 commit 2c0fd18
Show file tree
Hide file tree
Showing 59 changed files with 1,888 additions and 1,076 deletions.
30 changes: 19 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
Package: pamr
Title: Pam: Prediction Analysis for Microarrays
Version: 1.56.2.1
Author: T. Hastie, R. Tibshirani, Balasubramanian Narasimhan, Gil Chu
Version: 1.57
Authors@R: c(
person("Trevor", "Hastie", role=c("aut"), email = "hastie@stanford.edu"),
person("Rob", "Tibshirani", role=c("aut"), email = "tibs@stanford.edu"),
person("Balasubramanian", "Narasimhan", role=c("aut", "cre"), email = "naras@stanford.edu"),
person("Gilbert","Chu", role=c("aut")))
Description: Some functions for sample classification in microarrays.
Maintainer: ORPHANED
Depends: R (>= 2.10), cluster, survival
Depends: R (>= 3.5)
License: GPL-2
Packaged: 2024-06-25 08:11:07 UTC; ripley
Date: 2024-06-28
RoxygenNote: 7.3.1
Encoding: UTF-8
Imports: cluster, survival
NeedsCompilation: no
Packaged: 2024-06-30 23:41:08 UTC; naras
Author: Trevor Hastie [aut],
Rob Tibshirani [aut],
Balasubramanian Narasimhan [aut, cre],
Gilbert Chu [aut]
Maintainer: Balasubramanian Narasimhan <naras@stanford.edu>
Repository: CRAN
NeedsCompilation: yes
Date/Publication: 2024-06-27 11:13:24 UTC
X-CRAN-Original-Maintainer: Rob Tibshirani <tibs@stanford.edu>
X-CRAN-Comment: Orphaned and corrected on 2024-06-27
.
Deleted Fortran constructs not corrected by maintainer.
Date/Publication: 2024-07-01 06:40:02 UTC
109 changes: 55 additions & 54 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,68 +1,69 @@
d3eeea0771c618d674aa9c8b8fcf76c3 *DESCRIPTION
a013f5a35633b0ac531127f2199d0148 *NAMESPACE
54b70d1546dc1e7474fb655999e4cd80 *DESCRIPTION
b7464cbd8ed652f8e4f8493b4272c88e *NAMESPACE
3e9a5a7e57f9186f93a6e6e3b6e3f231 *R/balanced.folds.R
a9fa703b4c6ffaccb04deb2eba336b0b *R/descendants.R
149e3ba609aa2df762c95357513d0d7d *R/diag.disc.R
1331130ea581680bb6ed25effabc6680 *R/enlist.R
297b45527274666ae02bd43de701a357 *R/error.nsc.R
a608274634e8adc95b99c97d873fdbfc *R/khan.R
30e6bd3b3bd2ca2e7d3ee42f7413715d *R/nsc.R
1ebd0eaf47e6ff25968dc25c251c525d *R/nsccv.R
b4e92f62767de1a8d76016b6e6bda8e6 *R/pamr.adaptthresh.R
5badf534c3c1bb052420a438094b7021 *R/pamr.confusion.R
ff1daa13bc6226b6968cd75f2f00a619 *R/pamr-package.R
d281bcf2955223e1ffac18cb1cb1fbdf *R/pamr.adaptthresh.R
56fde15aa1048f7cc4fcb624710bb3eb *R/pamr.confusion.R
d5e65f72eba8d21cdcc0822a03783db6 *R/pamr.cube.root.R
7eb0a7ed5298e7c130bf0de7fffe5693 *R/pamr.cv.R
be011eb4978494c79e3294b65eb511df *R/pamr.decorrelate.R
f418dda5b8684a29b5c1130a30a10411 *R/pamr.fdr.R
218250beddb0346957d7dbd5f7d22663 *R/pamr.geneplot.R
7cf30def6c45e7b33da029fcddba7e3a *R/pamr.indeterminate.R
947d0bd705caaac28b6fe68123a3bb28 *R/pamr.listgenes.R
7f77199047b031973b43c11069c41c3c *R/pamr.makeclasses.R
0e01cbdc69f7b1911acc9609b5b14280 *R/pamr.menu.R
bd8755a65a6fbc221257fa41e3cc61cc *R/pamr.cv.R
407532327db1757f572290198b725f39 *R/pamr.decorrelate.R
d9b6f292da2cef112d7309ea82735b49 *R/pamr.fdr.R
2848a9550f89a61dc80953e84cedebce *R/pamr.geneplot.R
2ebebf7c7f792265bd215bdc49d7bd9f *R/pamr.indeterminate.R
8c3476aff169274982100e8a7b07ea37 *R/pamr.listgenes.R
d55e288700bdb43fc425ac5d00783cc7 *R/pamr.makeclasses.R
4af465c9be2ccf37f27dfa03481c135e *R/pamr.menu.R
96a47d5eae6dad1c2167d7db9d49428c *R/pamr.pairscore.R
c069c279f8745599a102fe6b5fdf28a9 *R/pamr.plotcen.R
a45b2868fc505b3bff184a2f8a219861 *R/pamr.plotcv.R
fe9866581c3177a2d9a7ba52559bc70b *R/pamr.plotcvprob.R
9a549ca6e18c35feba216bbf43a71cab *R/pamr.plotfdr.R
0ab0b9e4d06a1ce3fe7b70b6a2c150ba *R/pamr.plotstrata.R
f1ce85500d3cf3a421d2d5a28e0f12b9 *R/pamr.predict.R
89a6a0290506f376d86553ab624f322b *R/pamr.predictmany.R
547018d9891c13beccf26e849273464d *R/pamr.survfuns.R
eb712f427e19fe0c467eb5c2513ae132 *R/pamr.plotcen.R
5948681c344f228b4a18f7ec331080be *R/pamr.plotcv.R
16020531ac3e7b74d85489dc3ce19b9d *R/pamr.plotcvprob.R
606f6e62ed1f2d8fc575cd00b58ea859 *R/pamr.plotfdr.R
f40d19f80d884fcbc7dad24871893acf *R/pamr.plotstrata.R
b642b0eb6fc424c17ce360c7a966a672 *R/pamr.predict.R
c1a439de98c05397a9502a536d279ff8 *R/pamr.predictmany.R
2be894d2d664dd16dd546060bdbe5fe8 *R/pamr.survfuns.R
9bc80d974889da5cc972c0bf9b640a99 *R/pamr.to.excel.R
a03b7b7a5798e384fb14c64cb6390b23 *R/pamr.train.R
d5a6369445441ef2227eadebf2a0aa0a *R/pamr.train.R
b1716c64ae0996cf8580a191fbaa5d8c *R/permute.rows.R
61c7b7912cbf1a427638d0449badb6ed *R/print.nsc.R
fb42d5cf3756816e3f17fdbfdda70ec7 *R/print.nsccv.R
0ce75c063d9470dc420d88de60c37ba3 *R/print.pamrcved.R
5552b33a42fe849a479b5f1934747587 *R/print.pamrtrained.R
ae76cc9e561bea09b81a7aa5ef38332d *R/print.nsc.R
1168237c83e8415f5cd1f041ab444df3 *R/print.nsccv.R
b3670284e92441164c8bbf4c9fc17452 *R/print.pamrcved.R
42b4778b0df66eb716bfc59e7a890cd6 *R/print.pamrtrained.R
ddae48d3df6c057148c51d2e8ffecd51 *R/roc.R
9c93192a4d22d57200ad8aaf2ffdabb1 *R/softmax.R
1dbf2b705691fbdd2fb0b5b26986c941 *R/softshrink.R
a1f4d9a9fd31b8b664b6f75dccaaa0ee *R/which.is.max.R
e8096e76722eca5b2df0acfe386c0db3 *data/datalist
d64f28c69388d3d18445fd02cf0fe9b8 *data/khan.rda
8d0a0be984ab3d9ef53067a53be8791f *man/khan.Rd
2f8f6d4104e43e4b477c0d768b875000 *man/pamr.adaptthresh.Rd
182f266a7d60ed6ef80fd6520c60478e *man/pamr.batchadjust.Rd
2495998feb8aa73579d9e6c4f4f85747 *man/pamr.confusion.Rd
d3a2f25e50020835fd41042f6a08bcc8 *man/pamr.confusion.survival.Rd
4db2df1c52220dd6f727ae5e5ce6652f *man/pamr.cv.Rd
a32286faa78aaeda7d39cc94f2c1f514 *man/pamr.decorrelate.Rd
290eb352615c7867bf6a6e75fc5411b2 *man/pamr.fdr.Rd
73c6ed8df9b0091cbe918dcd36c3a22b *man/pamr.geneplot.Rd
adcbe5d48f776a4d6eea201db47a092b *man/pamr.indeterminate.Rd
14b1bb322665cb376daad7778155b822 *man/pamr.internal.Rd
0e8d75a6965aa1c306295fe5e49ffc07 *man/pamr.listgenes.Rd
93117743e724d1672958e95d278931e8 *man/pamr.makeclasses.Rd
61a9997c8b19b7f732b609f398bd3833 *man/pamr.menu.Rd
d35ab5006075ce3698adba3bd193d09d *man/pamr.plotcen.Rd
e0d98b03bde4fbf7d4a3ada55152655b *man/pamr.plotcv.Rd
a9743d4c693612b997d2a91ef032cc4e *man/pamr.plotcvprob.Rd
de992ac0e3c303ab442f884dd6f01434 *man/pamr.plotfdr.Rd
53af94398af4d65ccdc8d71c1d060ca7 *man/pamr.plotstrata.Rd
df0609e914feec892925fd4900cd0727 *man/pamr.plotsurvival.Rd
de6bffcebbc9258e2ad73314149322ca *man/pamr.predict.Rd
7a633ff47d6177b5912126cb3b579eef *man/pamr.predictmany.Rd
229fd68a5bf9a2bd13104c8cc4f4def2 *man/pamr.surv.to.class2.Rd
d83c019e2e26f6ef89686ecf41ad19db *man/pamr.test.errors.surv.compute.Rd
c01e178393464f8dbce6127a1a4aef37 *man/pamr.train.Rd
2912caf7cbd1ce59d1deb8bac53c69aa *src/knnimpute.f
fd11965b198231953a1a12f7fde82c3a *R/which.is.max.R
47397e8338269919f0ec71e773b290c0 *README.md
f1907c9b0b94299ac988d9b1d3114006 *data/khan.rda
001f53fa65db721d0026ae3d4239b500 *man/khan.Rd
022f20786decee0c532db35e6af2416e *man/pamr-package.Rd
a0ee61365e9fa22b000b1dc73374abf9 *man/pamr.adaptthresh.Rd
6d3315c8f2a6e50b63c99c922c4d8309 *man/pamr.batchadjust.Rd
20a555265122c5c7dfbc7355d38d38e7 *man/pamr.confusion.Rd
ff817fc81df1e986f7eba24b8a359e48 *man/pamr.confusion.survival.Rd
921aa6db6abd1ce8eab8268d297318df *man/pamr.cv.Rd
360c8fef4ff0345958e344496e274a77 *man/pamr.decorrelate.Rd
fa894fa96b30610b5aa5cb2f9c64a21f *man/pamr.fdr.Rd
8dd0eb85624b6cf3998f86bae6abe61f *man/pamr.geneplot.Rd
75289417aa97f797b03ebe399e1820a8 *man/pamr.indeterminate.Rd
a3cfb0e548ca08aa59cc9df7bfefd6ba *man/pamr.listgenes.Rd
e3e3c8dab08e8c3c2722e27f6f0ecadb *man/pamr.makeclasses.Rd
56bc025c2430eac0cf97be3ceb34f3a4 *man/pamr.menu.Rd
7ad56b3dcc2bdfb39cd3281df265fb3b *man/pamr.plotcen.Rd
f64890bb0edbac94b740bc023ad3833e *man/pamr.plotcv.Rd
1aad62db19ee8c7b1bb255822dd9f8be *man/pamr.plotcvprob.Rd
73b741568139920d920fa079e1564d5f *man/pamr.plotfdr.Rd
3630fa2c449414e3c905d55b783b8151 *man/pamr.plotstrata.Rd
95dec0072a00b09cf1026a4ed0770c71 *man/pamr.plotsurvival.Rd
f32356238efa5997680a63528aa4d342 *man/pamr.predict.Rd
6b7cf9a849dbf666c2c47d5893237a69 *man/pamr.predictmany.Rd
73901ccdbb542f611b7e5a4ac403c667 *man/pamr.surv.to.class2.Rd
e013067590dbc84e86488b3229862ff3 *man/pamr.test.errors.surv.compute.Rd
cc8c90fab47bcabb3f32d4527c8331ed *man/pamr.train.Rd
101 changes: 55 additions & 46 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,47 +1,56 @@
useDynLib(pamr)
S3method(print,pamrtrained)
S3method(print,pamrcved)

import(survival, cluster)
export(pamr.adaptthresh,
pamr.batchadjust,
pamr.confusion,
pamr.cv,
pamr.fdr,
pamr.decorrelate,
pamr.geneplot,
pamr.listgenes,
pamr.makeclasses,
pamr.menu,
pamr.cube.root,
pamr.indeterminate,
pamr.pairscore,
pamr.plotcen,
pamr.plotcvprob,
pamr.plotcv,
pamr.plotfdr,
pamr.predictmany,
pamr.predict,
pamr.score.to.class1,
pamr.score.to.class2,
pamr.surv.to.class2,
pamr.confusion.survival,
pamr.plotsurvival,
pamr.plotstrata,
pamr.pvalue.survival,
pamr.train,
print.pamrtrained,
print.pamrcved,
pamr.test.errors.surv.compute,
print.pamrcved,
print.pamrtrained)

importFrom("grDevices", "dev.off", "savePlot")
importFrom("graphics", "abline", "axis", "box", "legend", "lines",
"locator", "mtext", "par", "plot", "points", "segments",
"text", "title")
importFrom("stats", "approx", "dist", "hclust", "kmeans", "lm",
"median", "model.matrix", "pchisq", "predict", "quantile",
"runif", "update", "var")
importFrom("utils", "menu")
# Generated by roxygen2: do not edit by hand

export(pamr.adaptthresh)
export(pamr.batchadjust)
export(pamr.confusion)
export(pamr.confusion.survival)
export(pamr.cv)
export(pamr.decorrelate)
export(pamr.fdr)
export(pamr.geneplot)
export(pamr.indeterminate)
export(pamr.listgenes)
export(pamr.makeclasses)
export(pamr.menu)
export(pamr.plotcen)
export(pamr.plotcv)
export(pamr.plotcvprob)
export(pamr.plotfdr)
export(pamr.plotstrata)
export(pamr.plotsurvival)
export(pamr.predict)
export(pamr.predictmany)
export(pamr.surv.to.class2)
export(pamr.test.errors.surv.compute)
export(pamr.train)
import(cluster)
import(survival)
importFrom(grDevices,dev.off)
importFrom(grDevices,savePlot)
importFrom(graphics,abline)
importFrom(graphics,axis)
importFrom(graphics,box)
importFrom(graphics,legend)
importFrom(graphics,lines)
importFrom(graphics,locator)
importFrom(graphics,mtext)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(graphics,segments)
importFrom(graphics,text)
importFrom(graphics,title)
importFrom(stats,approx)
importFrom(stats,dist)
importFrom(stats,hclust)
importFrom(stats,kmeans)
importFrom(stats,lm)
importFrom(stats,median)
importFrom(stats,model.matrix)
importFrom(stats,pchisq)
importFrom(stats,predict)
importFrom(stats,quantile)
importFrom(stats,runif)
importFrom(stats,update)
importFrom(stats,var)
importFrom(utils,menu)
13 changes: 13 additions & 0 deletions R/khan.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#' Khan microarray data
#'
#' The \code{khan} data frame has 2308 rows and 65 columns. These are one of
#' the datasets data used in the Tibshirani et al paper in PNAS on nearest
#' shrunken centroids.
#'
#' The first two columns of gene ids and names and the remaining
#' columns are gene expression values for 63 samples. An attribute
#' `cancer_type` contains the cancer type for each sample.
#'
#' @name khan
#' @keywords datasets
NULL
19 changes: 19 additions & 0 deletions R/pamr-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' Prediction Analysis of Microarrays
#'
#' @description Functions for training and predicting using shrunken
#' centroids. While originally developed in the context of
#' microarray data analysis (<doi:10.1073/pnas.082099299>), the
#' method is broadly applicable.
#' @aliases pamr.cube.root pamr.pairscore pamr.pvalue.survival
#' pamr.score.to.class1 pamr.score.to.class2 print.nsc print.nsccv
#' print.pamrcved print.pamrtrained
#' @import survival cluster
#' @importFrom grDevices dev.off savePlot
#' @importFrom graphics abline axis box legend lines locator mtext par plot points segments text title
#' @importFrom stats approx dist hclust kmeans lm median model.matrix pchisq predict quantile runif update var
#' @importFrom utils menu
#' @keywords internal
"_PACKAGE"



77 changes: 77 additions & 0 deletions R/pamr.adaptthresh.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
#' A function to adaptive choose threshold scales, for use in pamr.train
#'
#' A function to adaptive choose threshold scales, for use in pamr.train
#'
#' \code{pamr.adaptthresh} Adaptively searches for set of good threshold
#' scales. The baseline (default) scale is 1 for each class. The idea is that
#' for easy to classify classes, the threshold scale can be increased without
#' increasing the error rate for that class, and resulting in fewer genes
#' needed for the classification rule. The scalings from pamr.adaptthresh are
#' then used in pamr.train, and pamr.cv. The results may be better than those
#' obtained with the default values of threshold.scale.
#'
#' @param object The result of a call to pamr.train
#' @param ntries Number of iterations to use in algorithm
#' @param reduction.factor Amount by which a scaling is reduced in one step of
#' the algorithm
#' @param full.out Should full output be returned? Default FALSE
#' @author Trevor Hastie, Robert Tibshirani, Balasubramanian Narasimhan, and
#' Gilbert Chu
#' @references
#'
#' Robert Tibshirani, Trevor Hastie, Balasubramanian Narasimhan, and Gilbert
#' Chu. "Diagnosis of multiple cancer types by shrunken centroids of gene
#' expression" PNAS 2002 99:6567-6572 (May 14).
#'
#' Robert Tibshirani, Trevor Hastie, Balasubramanian Narasimhan, and Gilbert
#' Chu (2002). Class prediction by nearest shrunken centroids,with
#' applications to DNA microarrays. Stanford tech report.
#' @examples
#'
#' suppressWarnings(RNGversion("3.5.0"))
#' set.seed(120)
#' x <- matrix(rnorm(1000*20),ncol=20)
#' y <- sample(c(1:4),size=20,replace=TRUE)
#' mydata <- list(x=x,y=y)
#' mytrain <- pamr.train(mydata)
#' new.scales <- pamr.adaptthresh(mytrain)
#'
#'
#' mytrain2 <- pamr.train(mydata, threshold.scale=new.scales)
#'
#' myresults2 <- pamr.cv(mytrain2, mydata)
#'
#'
#' @export pamr.adaptthresh
pamr.adaptthresh <- function(object, ntries = 10, reduction.factor = 0.9, full.out = FALSE) {
errors <- error.nsc(object)
threshold <- object$threshold
Expand Down Expand Up @@ -44,6 +89,38 @@ pamr.adaptthresh <- function(object, ntries = 10, reduction.factor = 0.9, full.o
opt.scale
}



#' A function to mean-adjust microarray data by batches
#'
#' A function to mean-adjust microarray data by batches
#'
#' \code{pamr.batchadjust} does a genewise one-way ANOVA adjustment for
#' expression values. Let \eqn{x(i,j)} be the expression for gene \eqn{i} in sample \eqn{j}.
#' Suppose sample \eqn{j} in in batch \eqn{b}, and let \eqn{B} be the set of all samples in batch
#' \eqn{b}. Then \code{pamr.batchadjust} adjusts \eqn{x(i,j)} to \eqn{x(i,j) - mean[x(i,j)]}
#' where the mean is taken over all samples \eqn{j} in \eqn{B}.
#'
#' @param data The input data. A list with components: x- an expression genes
#' in the rows, samples in the columns, and y- a vector of the class labels for
#' each sample, and batchlabels- a vector of batch labels for each sample.
#' @return A data object of the same form as the input data, with x replaced by
#' the adjusted x
#' @author Trevor Hastie,Robert Tibshirani, Balasubramanian Narasimhan, and
#' Gilbert Chu
#' @examples
#'
#' suppressWarnings(RNGversion("3.5.0"))
#' set.seed(120)
#' #generate some data
#' x <- matrix(rnorm(1000*20),ncol=20)
#' y <- sample(c(1:4),size=20,replace=TRUE)
#' batchlabels <- sample(c(1:5),size=20,replace=TRUE)
#' mydata <- list(x=x,y=factor(y),batchlabels=factor(batchlabels))
#'
#' mydata2 <- pamr.batchadjust(mydata)
#'
#' @export pamr.batchadjust
pamr.batchadjust <- function(data) {
if (is.null(data$batchlabels)) {
stop("batch labels are not in data object")
Expand Down
Loading

0 comments on commit 2c0fd18

Please sign in to comment.