diff --git a/DESCRIPTION b/DESCRIPTION index e815195..41dff4d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: MetaQC Type: Package Title: MetaQC: Objective Quality Control and Inclusion/Exclusion Criteria for Genomic Meta-Analysis -Version: 0.1.8 +Version: 0.1.9 Author: Don Kang and George Tseng Maintainer: Don Kang @@ -27,12 +27,12 @@ Description: MetaQC implements our proposed quantitative quality preprocessing etc) of their bad quality or irreproducibility for final inclustion/exclusion decision. Depends: R (>= 2.10.0), proto, foreach -Suggests: doMC, doSMP, FactoMineR, samr, matrixStats, gdata, gtools +Suggests: doMC, doSNOW, FactoMineR, samr, matrixStats, gdata, gtools License: GPL-2 URL: https://github.com/donkang75/MetaQC LazyLoad: yes Collate: MetaQC.R requireAll.R functions.R runQC.R cleanup.R -Date: 2012-01-16 -Packaged: 2012-01-16 05:23:41 UTC; don +Date: 2012-02-25 +Packaged: 2012-02-26 07:33:24 UTC; don Repository: CRAN -Date/Publication: 2012-01-16 07:32:42 +Date/Publication: 2012-02-26 16:31:52 diff --git a/MD5 b/MD5 index 6e2d6c7..2c9460b 100644 --- a/MD5 +++ b/MD5 @@ -1,17 +1,17 @@ -90255e6b96799f5426cb64932acfdec9 *DESCRIPTION +c8e0fe79550f0661b4aab85491df4ab2 *DESCRIPTION abde996ec487191303de7c015cf694a0 *NAMESPACE -8a7a74b7075054ef0d3f203f3c381abc *R/MetaQC.R -045e992b75151a01a136ab0734346e75 *R/cleanup.R -622edf4b88cff644bc5a5c7f4b215766 *R/functions.R +08b13788babc860f8d740a2970d1635f *R/MetaQC.R +98f4ebfcc928281f6a0dc3c995cdf581 *R/cleanup.R +6adfded4a7857fdbb42531c262478166 *R/functions.R 747136af145e716b1c9c85cb0a12f7f5 *R/requireAll.R b6c2cca24c87e56bd8dd33b8e48b78af *R/runQC.R 35fa70c4a316424b88aa1ca609d070b1 *data/brain.rda ef5a22d59ce52a794593a74f8447e29a *data/datalist -fed180a046f4759c1e98ccaa8e8cbf1d *man/MetaQC-package.Rd -65b210d4df63e710bd7527c6adf20958 *man/MetaQC.Rd +3a4f0e774a66acf873ef10551a101b4e *man/MetaQC-package.Rd +4c3a49c04c8b2bddb9044abaaf749333 *man/MetaQC.Rd b5ec4431932b3841d6b5b48f90d10196 *man/brain.Rd -96c3b57ac777598e83d7ab2ef36de420 *man/cleanup.Rd -d762c55478e30e8144a7d4939fb24291 *man/plot.proto.Rd -e3fbf01f46e2bf413f4eec6c38050c1c *man/print.proto.Rd -edcab02ebd1cd6ee5c44642838f4f068 *man/requireAll.Rd -810a9f25eb3734d6d48ed86a8ec09677 *man/runQC.Rd +8f98d634094ea142e5061af5de5ecd02 *man/cleanup.Rd +a7eb00ce06c12217b96171385f942af6 *man/plot.proto.Rd +a68a6fc7f3e513d04f12165f830001f6 *man/print.proto.Rd +d88335fc48896e46c0c53df353117546 *man/requireAll.Rd +fd5de5896115c100df99989d335eac9d *man/runQC.Rd diff --git a/R/MetaQC.R b/R/MetaQC.R index 3129f00..5aa4236 100644 --- a/R/MetaQC.R +++ b/R/MetaQC.R @@ -46,17 +46,20 @@ MetaQC <- function(DList, GList, isParallel=FALSE, nCores=NULL, useCache=TRUE, f requireAll("doMC") registerDoMC() } else { #windows - requireAll("doSMP") + requireAll("doSNOW") if(is.null(getOption('cores'))) options(cores=2) - .workers <- startWorkers() - registerDoSMP(.workers) + registerDoSNOW(makeCluster(getOption('cores'), type = "SOCK")) + #.workers <- startWorkers() + #registerDoSMP(.workers) } } Cleanup <- function(.) { - if(!is.null(.$.workers)) - stopWorkers(.$.workers) + warning("This function was deprecated.\n", + "No more needed to call this function.\n") +# if(!is.null(.$.workers)) +# stopWorkers(.$.workers) } .Initialize <- function(., .DList, .GList, .filterGenes) { @@ -87,7 +90,7 @@ MetaQC <- function(DList, GList, isParallel=FALSE, nCores=NULL, useCache=TRUE, f } .ConvertToGeneSetIdx <- function(., .DListF=.$.DListF, .GList=.$.GList, .minNumGenes=.$.minNumGenes) { - .DGList <- foreach(d=iter(.DListF)) %dopar% { #each data set wrap each pathway + .DGList <- foreach(d=iter(.DListF), .packages="foreach") %dopar% { #each data set wrap each pathway .res <- foreach(g=iter(.GList)) %do% { .gs <- na.omit(match(g, rownames(d))) if(length(.gs)<.minNumGenes) return(NA) @@ -327,7 +330,7 @@ MetaQC <- function(DList, GList, isParallel=FALSE, nCores=NULL, useCache=TRUE, f if(is.null(.$.PathPValMat)) { load(.GList) .GListIdx <- .$.ConvertToGeneSetIdx(.GList=GList) - .PathPValList <- foreach(ii=1:length(.GListIdx)) %dopar% { + .PathPValList <- foreach(ii=1:length(.GListIdx), .packages="foreach") %dopar% { .PathPVal <- foreach(jj=iter(.GListIdx[[ii]]), .combine=c) %do% { .gnInPath <- rownames(.$.DListF[[ii]])[jj] #gene names in the pathway .gMatched <- sort(match(.gnInPath, rownames(.$.PValMat0))) @@ -390,7 +393,7 @@ MetaQC <- function(DList, GList, isParallel=FALSE, nCores=NULL, useCache=TRUE, f .CalcDistOfStudies <- function(.) { stopifnot(!is.null(.$.DListF)) - .$.DistOfStudies <- foreach(ii=iter(combinations(length(.$.DListF),2),by="row"), .combine=c) %dopar% { + .$.DistOfStudies <- foreach(ii=iter(combinations(length(.$.DListF),2),by="row"), .combine=c, .packages="foreach") %dopar% { .gn <- intersect(rownames(.$.DListF[[ii[1]]]),rownames(.$.DListF[[ii[2]]])) .DistOfStudies <- foreach(1:100, .combine=c) %do% { #resampling based to fit practical memory limit diff --git a/R/cleanup.R b/R/cleanup.R index 0810d54..e511f3b 100644 --- a/R/cleanup.R +++ b/R/cleanup.R @@ -1,4 +1,6 @@ cleanup <- function(QC) { - if(!is.null(QC$.workers)) - stopWorkers(QC$.workers) + warning("This function was deprecated.\n", + "No more needed to call this function.\n") +# if(!is.null(QC$.workers)) +# stopWorkers(QC$.workers) } diff --git a/R/functions.R b/R/functions.R index 06c17cc..0e3220f 100644 --- a/R/functions.R +++ b/R/functions.R @@ -104,6 +104,10 @@ rowVars <- function (x, center = NULL, ...) { } GMT2List <- function(f, saveAs=NULL) { + trim <- function(x) { + sub(" +$", "", sub("^ +", "", x)) + } + con <- file(f, "r", blocking = FALSE) GList <- readLines(con) # empty GList <- lapply(GList, function(x) unlist(strsplit(x, "\t", fixed=T))) @@ -117,10 +121,6 @@ GMT2List <- function(f, saveAs=NULL) { return(GList) } -trim <- function(x) { - sub(" +$", "", sub("^ +", "", x)) -} - getFileExt <- function(x) { sub(".*[.]", "", x) } diff --git a/man/MetaQC-package.Rd b/man/MetaQC-package.Rd index ec6907d..4333919 100644 --- a/man/MetaQC-package.Rd +++ b/man/MetaQC-package.Rd @@ -12,8 +12,8 @@ For each quality control index, the p-values from statistical hypothesis testing \tabular{ll}{ Package: \tab MetaQC\cr Type: \tab Package\cr -Version: \tab 0.1.8\cr -Date: \tab 2012-01-16\cr +Version: \tab 0.1.9\cr +Date: \tab 2012-02-25\cr License: \tab GPL-2\cr LazyLoad: \tab yes\cr } @@ -52,7 +52,6 @@ Dongwan D. Kang, Etienne Sibille, Naftali Kaminski, and George C. Tseng. (Nuclei #B is recommended to be >= 1e4 in real application runQC(brainQC, B=1e2, fileForCQCp="c2.all.v3.0.symbols.gmt") plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing ## For parallel computation with all cores ## In windows, only 2 cores are used if not specified explicitly @@ -61,7 +60,6 @@ Dongwan D. Kang, Etienne Sibille, Naftali Kaminski, and George C. Tseng. (Nuclei #B is recommended to be >= 1e4 in real application runQC(brainQC, B=1e2, fileForCQCp="c2.all.v3.0.symbols.gmt") plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing ## Real Example which is used in the paper #download the brainFull file @@ -71,7 +69,6 @@ Dongwan D. Kang, Etienne Sibille, Naftali Kaminski, and George C. Tseng. (Nuclei verbose=TRUE, isParallel=TRUE) runQC(brainQC, B=1e4, fileForCQCp="c2.all.v3.0.symbols.gmt") #B was 1e5 in the paper plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing } } diff --git a/man/MetaQC.Rd b/man/MetaQC.Rd index 139d1ba..f06de73 100644 --- a/man/MetaQC.Rd +++ b/man/MetaQC.Rd @@ -100,7 +100,6 @@ Don Kang (donkang75@gmail.com) and George Tseng (ctseng@pitt.edu) #B is recommended to be >= 1e4 in real application runQC(brainQC, B=1e2, fileForCQCp="c2.all.v3.0.symbols.gmt") plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing ## For parallel computation with all cores ## In windows, only 2 cores are used if not specified explicitly @@ -109,7 +108,6 @@ Don Kang (donkang75@gmail.com) and George Tseng (ctseng@pitt.edu) #B is recommended to be >= 1e4 in real application runQC(brainQC, B=1e2, fileForCQCp="c2.all.v3.0.symbols.gmt") plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing ## Real Example which is used in the paper #download the brainFull file @@ -119,7 +117,6 @@ Don Kang (donkang75@gmail.com) and George Tseng (ctseng@pitt.edu) verbose=TRUE, isParallel=TRUE) runQC(brainQC, B=1e4, fileForCQCp="c2.all.v3.0.symbols.gmt") #B was 1e5 in the paper plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing } } diff --git a/man/cleanup.Rd b/man/cleanup.Rd index 4f3fb8a..c34c6c9 100644 --- a/man/cleanup.Rd +++ b/man/cleanup.Rd @@ -6,7 +6,7 @@ Cleaning up resources. } \description{ -It is to shutdown the workers used for parallel processing and release resources. It is only necessary in windows. +It is to shutdown the workers used for parallel processing and release resources. It is only necessary in windows. (Deprecated) } \usage{ diff --git a/man/plot.proto.Rd b/man/plot.proto.Rd index 2ccf772..c482d4a 100644 --- a/man/plot.proto.Rd +++ b/man/plot.proto.Rd @@ -10,7 +10,7 @@ It draws a PCA biplot which shows the four QC measures. CQCg and AQCg are combin } \usage{ -plot.proto(x, ...) +\method{plot}{proto}(x, \dots) } \arguments{ diff --git a/man/print.proto.Rd b/man/print.proto.Rd index 6d3e5b9..9256e81 100644 --- a/man/print.proto.Rd +++ b/man/print.proto.Rd @@ -10,7 +10,7 @@ It prints out the results of all QC measures and standardized mean rank of each } \usage{ -print.proto(x, ...) +\method{print}{proto}(x, \dots) } \arguments{ diff --git a/man/requireAll.Rd b/man/requireAll.Rd index 2f3db17..54abff5 100644 --- a/man/requireAll.Rd +++ b/man/requireAll.Rd @@ -40,7 +40,7 @@ Don Kang (donkang75@gmail.com) and George Tseng (ctseng@pitt.edu) \examples{ \dontrun{ libs <- c("proto", "foreach", ifelse(.Platform$OS.type == "unix", - "doMC", "doSMP")) #doSMP is available to R > 2.11.0 + "doMC", "doSNOW")) requireAll(libs) } } diff --git a/man/runQC.Rd b/man/runQC.Rd index d5d0ffa..e82c853 100644 --- a/man/runQC.Rd +++ b/man/runQC.Rd @@ -80,7 +80,6 @@ Don Kang (donkang75@gmail.com) and George Tseng (ctseng@pitt.edu) #B is recommended to be >= 1e4 in real application runQC(brainQC, B=1e2, fileForCQCp="c2.all.v3.0.symbols.gmt") plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing ## For parallel computation with all cores ## In windows, only 2 cores are used if not specified explicitly @@ -89,7 +88,6 @@ Don Kang (donkang75@gmail.com) and George Tseng (ctseng@pitt.edu) #B is recommended to be >= 1e4 in real application runQC(brainQC, B=1e2, fileForCQCp="c2.all.v3.0.symbols.gmt") plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing ## Real Example which is used in the paper #download the brainFull file @@ -99,7 +97,6 @@ Don Kang (donkang75@gmail.com) and George Tseng (ctseng@pitt.edu) verbose=TRUE, isParallel=TRUE) runQC(brainQC, B=1e4, fileForCQCp="c2.all.v3.0.symbols.gmt") #B was 1e5 in the paper plot(brainQC) - cleanup(brainQC) #neccessary for windows after using parallel processing } }