
R version 3.3.0 (2016-05-03) -- "Supposedly Educational"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ENmix)
Loading required package: minfi
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, cbind, colnames, do.call,
    duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect,
    is.unsorted, lapply, lengths, Map, mapply, match, mget, order,
    paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind,
    Reduce, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: lattice
Loading required package: GenomicRanges
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biostrings
Loading required package: XVector
Loading required package: bumphunter
Loading required package: foreach
Loading required package: iterators
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Setting options('download.file.method.GEOquery'='auto')
Setting options('GEOquery.inmemory.gpl'=FALSE)
Loading required package: doParallel
> library(minfiData)
Loading required package: IlluminaHumanMethylation450kmanifest
Loading required package: IlluminaHumanMethylation450kanno.ilmn12.hg19
> library(digest)
> 
> digestMatrix <- function(mat) {
+     content <- sprintf("%.6f", mat)
+     content[content == "-0.000000"] <- "0.000000"
+     digest(c(content, rownames(mat), colnames(mat)))
+ }
> 
> #read in raw intensity data
> sheet <- read.metharray.sheet(file.path(find.package("minfiData"),
+         "extdata"), pattern = "csv$")
[read.metharray.sheet] Found the following CSV files:

[1] "/ddn/gs1/home/xuz/R/x86_64-pc-linux-gnu-library/3.3/minfiData/extdata/SampleSheet.csv"
> rgSet <- read.metharray.exp(targets = sheet,extended = TRUE)
> qc<-QCinfo(rgSet)
1  samples with percentage of low quanlity CpG value greater
         than  0.05  or bisulfite intensity less than  16095.2 
8588  CpGs with percentage of low quanlity value greater than  0.05 
Ploting qc_sample.jpg ...Done
Ploting qc_CpG.jpg ...Done
Identifying ourlier samples based on beta or total intensity values...
After excluding low quality samples and CpGs
1  samples are outliers based on averaged total intensity value 
0  samples are outliers in beta value distribution 
1  outlier samples were added into badsample list
WARNING: Sample size may be too small to correctly identify outlier samples!
RECOMMAND: set outlier=FALSE or double check total intensity and beta value 
             distribution plots to confirm
Ploting freqpolygon_beta_beforeQC.jpg ...Done
Ploting freqpolygon_beta_afterQC.jpg ...Done
> mdat <- preprocessRaw(rgSet)
> mdat.bg=preprocessENmix(rgSet,bgParaEst="oob",nCores=6)
Analysis is running, please wait...!
> mdat.filter=QCfilter(mdat,qcinfo=qc, samplethre = 0.01, CpGthre = 0.05)
5  samples with percentage of low quanlity CpG value greater
         than  0.01  or bisulfite intensity less than  16095.2 
Error in apply(qcmat, 1, sum) : dim(X) must have a positive length
Calls: QCfilter -> apply
Execution halted

R version 3.3.0 (2016-05-03) -- "Supposedly Educational"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ENmix)
Loading required package: minfi
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, cbind, colnames, do.call,
    duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect,
    is.unsorted, lapply, lengths, Map, mapply, match, mget, order,
    paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind,
    Reduce, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: lattice
Loading required package: GenomicRanges
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biostrings
Loading required package: XVector
Loading required package: bumphunter
Loading required package: foreach
Loading required package: iterators
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Setting options('download.file.method.GEOquery'='auto')
Setting options('GEOquery.inmemory.gpl'=FALSE)
Loading required package: doParallel
> library(minfiData)
Loading required package: IlluminaHumanMethylation450kmanifest
Loading required package: IlluminaHumanMethylation450kanno.ilmn12.hg19
> library(digest)
> 
> digestMatrix <- function(mat) {
+     content <- sprintf("%.6f", mat)
+     content[content == "-0.000000"] <- "0.000000"
+     digest(c(content, rownames(mat), colnames(mat)))
+ }
> 
> #read in raw intensity data
> sheet <- read.metharray.sheet(file.path(find.package("minfiData"),
+         "extdata"), pattern = "csv$")
[read.metharray.sheet] Found the following CSV files:

[1] "/ddn/gs1/home/xuz/R/x86_64-pc-linux-gnu-library/3.3/minfiData/extdata/SampleSheet.csv"
> rgSet <- read.metharray.exp(targets = sheet,extended = TRUE)
> qc<-QCinfo(rgSet)
1  samples with percentage of low quanlity CpG value greater
         than  0.05  or bisulfite intensity less than  16095.2 
8588  CpGs with percentage of low quanlity value greater than  0.05 
Ploting qc_sample.jpg ...Done
Ploting qc_CpG.jpg ...Done
Identifying ourlier samples based on beta or total intensity values...
After excluding low quality samples and CpGs
1  samples are outliers based on averaged total intensity value 
0  samples are outliers in beta value distribution 
1  outlier samples were added into badsample list
WARNING: Sample size may be too small to correctly identify outlier samples!
RECOMMAND: set outlier=FALSE or double check total intensity and beta value 
             distribution plots to confirm
Ploting freqpolygon_beta_beforeQC.jpg ...Done
Ploting freqpolygon_beta_afterQC.jpg ...Done
> mdat <- preprocessRaw(rgSet)
> mdat.bg=preprocessENmix(rgSet,bgParaEst="oob",nCores=6)
Analysis is running, please wait...!
> mdat.filter=QCfilter(mdat,qcinfo=qc, samplethre = 0.05, CpGthre = 0.05)
1  samples with percentage of low quanlity CpG value greater
         than  0.05  or bisulfite intensity less than  16095.2 
8588  CpGs with percentage of low quanlity value greater than  0.05 
After excluding overlapped counts:
1  unique samples were excluded
8588  unique CpGs were excluded
> mdat.quantile=normalize.quantile.450k(mdat,method="quantile1")
Analysis is running, please wait...! 
> 
> testDigests <- list(
+     qc = list(detP = digestMatrix(qc$detP),
+       nbead=digestMatrix(qc$nbead)),
+    enmix = list(Meth = digestMatrix(getMeth(mdat.bg)),
+       Unmeth = digestMatrix(getUnmeth(mdat.bg))),
+     filter = list(Meth = digestMatrix(getMeth(mdat.filter)),
+       Unmeth = digestMatrix(getUnmeth(mdat.filter))),
+     quantile = list(Meth = digestMatrix(getMeth(mdat.quantile)),
+       Unmeth = digestMatrix(getUnmeth(mdat.quantile)))
+     )
> 
> save(testDigests, file = "../unitTests/testDigests.rda")
> 
> gc()
            used  (Mb) gc trigger   (Mb)  max used   (Mb)
Ncells   7348378 392.5   12002346  641.0  12002346  641.0
Vcells 103208784 787.5  189291335 1444.2 189230346 1443.8
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.6 (Final)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] digest_0.6.9                                      
 [2] minfiData_0.14.0                                  
 [3] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.2.1
 [4] IlluminaHumanMethylation450kmanifest_0.4.0        
 [5] ENmix_1.9.1                                       
 [6] doParallel_1.0.10                                 
 [7] minfi_1.18.2                                      
 [8] bumphunter_1.12.0                                 
 [9] locfit_1.5-9.1                                    
[10] iterators_1.0.8                                   
[11] foreach_1.4.3                                     
[12] Biostrings_2.40.2                                 
[13] XVector_0.12.0                                    
[14] SummarizedExperiment_1.2.3                        
[15] GenomicRanges_1.24.2                              
[16] GenomeInfoDb_1.8.3                                
[17] IRanges_2.6.1                                     
[18] S4Vectors_0.10.2                                  
[19] lattice_0.20-33                                   
[20] Biobase_2.32.0                                    
[21] BiocGenerics_0.18.0                               

loaded via a namespace (and not attached):
 [1] mclust_5.2              base64_2.0              Rcpp_0.12.5            
 [4] Rsamtools_1.24.0        R6_2.1.2                plyr_1.8.4             
 [7] chron_2.3-47            RSQLite_1.0.0           sva_3.20.0             
[10] httr_1.2.1              zlibbioc_1.18.0         GenomicFeatures_1.24.4 
[13] data.table_1.9.6        annotate_1.50.0         Matrix_1.2-6           
[16] preprocessCore_1.34.0   splines_3.3.0           BiocParallel_1.6.2     
[19] geneplotter_1.50.0      stringr_1.0.0           RCurl_1.95-4.8         
[22] biomaRt_2.28.0          compiler_3.3.0          rtracklayer_1.32.1     
[25] multtest_2.28.0         pkgmaker_0.22           mgcv_1.8-12            
[28] openssl_0.9.4           GEOquery_2.38.4         quadprog_1.5-5         
[31] codetools_0.2-14        matrixStats_0.50.2      XML_3.98-1.4           
[34] reshape_0.8.5           GenomicAlignments_1.8.4 MASS_7.3-45            
[37] bitops_1.0-6            grid_3.3.0              nlme_3.1-128           
[40] xtable_1.8-2            registry_0.3            DBI_0.4-1              
[43] magrittr_1.5            wateRmelon_1.16.0       impute_1.46.0          
[46] stringi_1.1.1           genefilter_1.54.2       doRNG_1.6              
[49] limma_3.28.14           nor1mix_1.2-1           RColorBrewer_1.1-2     
[52] siggenes_1.46.0         tools_3.3.0             illuminaio_0.14.0      
[55] rngtools_1.2.4          survival_2.39-5         AnnotationDbi_1.34.4   
[58] beanplot_1.2           
> 
> rm(list = ls())
> 
> 
> 
> 
