Skip to content

Commit

Permalink
version 0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
donkang75 authored and gaborcsardi committed Feb 25, 2012
1 parent bd58065 commit 60c509f
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 45 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Expand Up @@ -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 <donkang75@gmail.com> and George Tseng
<ctseng@pitt.edu>
Maintainer: Don Kang <donkang75@gmail.com>
Expand All @@ -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
22 changes: 11 additions & 11 deletions 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
19 changes: 11 additions & 8 deletions R/MetaQC.R
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)))
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions 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)
}
8 changes: 4 additions & 4 deletions R/functions.R
Expand Up @@ -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)))
Expand All @@ -117,10 +121,6 @@ GMT2List <- function(f, saveAs=NULL) {
return(GList)
}

trim <- function(x) {
sub(" +$", "", sub("^ +", "", x))
}

getFileExt <- function(x) {
sub(".*[.]", "", x)
}
Expand Down
7 changes: 2 additions & 5 deletions man/MetaQC-package.Rd
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

}
}
3 changes: 0 additions & 3 deletions man/MetaQC.Rd
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

}
}
Expand Down
2 changes: 1 addition & 1 deletion man/cleanup.Rd
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion man/plot.proto.Rd
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion man/print.proto.Rd
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion man/requireAll.Rd
Expand Up @@ -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)
}
}
Expand Down
3 changes: 0 additions & 3 deletions man/runQC.Rd
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

}
}
Expand Down

0 comments on commit 60c509f

Please sign in to comment.