rafalab / bumphunter

bumphunter
15 stars 14 forks source link

Fixed some 1.7.3 bugs and added some tests #3

Closed lcolladotor closed 9 years ago

lcolladotor commented 9 years ago

Hi,

I added some tests and fixed some bugs (mostly typos) from annotateNearest(), annotateTranscripts() and matchGenes() from version 1.7.3. The commit messages describe in more detail what I changed.

Bumps bumphunter to version 1.7.4.

Cheers, Leo

lcolladotor commented 9 years ago

R CMD check output (via devtools::check)

> check('bumphunter')
Updating bumphunter documentation
Loading bumphunter
First time using roxygen2 4.0. Upgrading automatically...
'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD build  \
  '/Users/lcollado/Dropbox/JHSPH/Code/bumphunter' --no-manual  \
  --no-resave-data

* checking for file ‘/Users/lcollado/Dropbox/JHSPH/Code/bumphunter/DESCRIPTION’ ... OK
* preparing ‘bumphunter’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a ‘data/datalist’ file should be added
* building ‘bumphunter_1.7.4.tar.gz’

'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD check  \
  '/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T//RtmpieI4TL/bumphunter_1.7.4.tar.gz'  \
  --timings

* using log directory ‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpieI4TL/bumphunter.Rcheck’
* using R Under development (unstable) (2014-11-01 r66923)
* using platform: x86_64-apple-darwin10.8.0 (64-bit)
* using session charset: UTF-8
* checking for file ‘bumphunter/DESCRIPTION’ ... OK
* this is package ‘bumphunter’ version ‘1.7.4’
* checking package namespace information ... OK
* checking package dependencies ... NOTE
Depends: includes the non-default packages:
  ‘S4Vectors’ ‘IRanges’ ‘GenomeInfoDb’ ‘GenomicRanges’ ‘foreach’
  ‘iterators’ ‘parallel’ ‘locfit’
Adding so many packages to the search path is excessive and importing
selectively is preferable.
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘bumphunter’ can be installed ... [12s/12s] OK
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... NOTE
Unexported object imported by a ':::' call: ‘doParallel:::.options’
  See the note in ?`:::` about the use of this operator.
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... NOTE
annotateNearest: no visible global function definition for
  ‘makeGRangesFromDataFrame’
annotateTranscripts: no visible global function definition for
  ‘transcriptsBy’
annotateTranscripts: no visible global function definition for ‘cdsBy’
annotateTranscripts: no visible global function definition for
  ‘exonsBy’
annotateTranscripts: no visible global function definition for
  ‘mappedkeys’
bumphunterEngine: no visible binding for global variable ‘bootstraps’
matchGenes: no visible global function definition for
  ‘makeGRangesFromDataFrame’
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... NOTE
Rd file 'annotateTranscripts.Rd':
  \usage lines wider than 90 characters:
     annotateTranscripts(txdb, annotationPackage = NULL, by = c("tx","gene"), codingOnly=FALSE, verbose = TRUE, requireAnnotation = FALSE)

Rd file 'bumphunter.Rd':
  \usage lines wider than 90 characters:
     bumphunter(object, design, chr=NULL, pos, cluster=NULL,coef=2, cutoff=NULL, pickCutoff = FALSE, pickCutoffQ = 0.99, maxGap=500, nullMet ... [TRUNCATED]
     bumphunterEngine(mat, design, chr = NULL, pos, cluster = NULL, coef = 2, cutoff = NULL, pickCutoff = FALSE, pickCutoffQ = 0.99, maxGap  ... [TRUNCATED]

Rd file 'matchGenes.Rd':
  \usage lines wider than 90 characters:
     matchGenes(x, subject, type = c("any", "fiveprime"), promoterDist = 2500, skipExons = FALSE, verbose = TRUE)
  \examples lines wider than 100 characters:
         islands=makeGRangesFromDataFrame(read.delim("http://rafalab.jhsph.edu/CGI/model-based-cpg-islands-hg19.txt")[1:100,])

These lines will be truncated in the PDF manual.
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
Examples with CPU or elapsed time > 5s
            user system elapsed
bumphunter 4.363      1   2.856
* checking for unstated dependencies in tests ... OK
* checking tests ...
  Running ‘runTests.R’ [12s/18s]
  Running ‘test-all.R’ [61s/121s]
 [73s/140s] OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
   ‘bumphunter.Rnw’ ... OK
 OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

NOTE: There were 4 notes.
See
  ‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpieI4TL/bumphunter.Rcheck/00check.log’
for details.

>
lcolladotor commented 9 years ago

R output from code chunk mentioned in commit message https://github.com/lcolladotor/bumphunter/commit/cf02fa17921357d00f87dfb4c12ed94bf0af13b1

> library('bumphunter')
Loading required package: S4Vectors
Loading required package: stats4
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 object is masked from ‘package:stats’:

    xtabs

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

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

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: GenomicRanges
Loading required package: foreach
foreach: simple, scalable parallel programming from Revolution Analytics
Use Revolution R for scalability, fault tolerance and more.
http://www.revolutionanalytics.com
Loading required package: iterators
Loading required package: locfit
locfit 1.5-9.1   2013-03-22
> x <- data.frame(start = c(4), end = c(5), chr = 'chr1')
> subject <- data.frame(start = c(2, 4), end = c(4, 6), chr = 'chr1')
> annotateNearest(x, subject)
  distance subjectHits   type amountOverlap insideDist size1 size2
1        0           2 inside            NA          0     2     3
> annotateNearest(x, subject[2:1,])
  distance subjectHits    type amountOverlap insideDist size1 size2
1        0           2 overlap            -1         NA     2     3
> 
> library('devtools')
> session_info()
Session info--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 setting  value                                             
 version  R Under development (unstable) (2014-11-01 r66923)
 system   x86_64, darwin10.8.0                              
 ui       AQUA                                              
 language (EN)                                              
 collate  en_US.UTF-8                                       
 tz       America/New_York                                  

Packages------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 package       * version date       source        
 BiocGenerics  * 0.13.4  2014-12-31 Bioconductor  
 bumphunter    * 1.7.4   2015-01-15 Bioconductor  
 codetools       0.2.9   2014-08-21 CRAN (R 3.2.0)
 devtools      * 1.6.1   2014-10-07 CRAN (R 3.2.0)
 digest          0.6.4   2013-12-03 CRAN (R 3.2.0)
 doRNG           1.6     2014-03-07 CRAN (R 3.2.0)
 foreach       * 1.4.2   2014-04-11 CRAN (R 3.2.0)
 GenomeInfoDb  * 1.3.12  2014-12-22 Bioconductor  
 GenomicRanges * 1.19.33 2015-01-13 Bioconductor  
 IRanges       * 2.1.35  2015-01-07 Bioconductor  
 iterators     * 1.0.7   2014-04-11 CRAN (R 3.2.0)
 lattice         0.20.29 2014-04-04 CRAN (R 3.2.0)
 locfit        * 1.5.9.1 2013-04-20 CRAN (R 3.2.0)
 matrixStats     0.10.3  2014-10-15 CRAN (R 3.2.0)
 pkgmaker        0.22    2014-05-14 CRAN (R 3.2.0)
 R.methodsS3     1.6.1   2014-01-05 CRAN (R 3.2.0)
 registry        0.2     2012-01-24 CRAN (R 3.2.0)
 rngtools        1.2.4   2014-03-06 CRAN (R 3.2.0)
 rstudioapi      0.1     2014-03-27 CRAN (R 3.2.0)
 S4Vectors     * 0.5.16  2015-01-07 Bioconductor  
 stringr         0.6.2   2012-12-06 CRAN (R 3.2.0)
 xtable          1.7.4   2014-09-12 CRAN (R 3.2.0)
 XVector         0.7.3   2014-11-24 Bioconductor  
> 

This just shows how the results from annotateNearest() are affected by nearest(). Hence why I added a note about this similar to the one included already in matchGenes().

lcolladotor commented 9 years ago

Adapting derfinder to bumphunter's new functions I found a new bug that I'll track down. Once I'm done with it, hopefully you can accept these changes. In the meantime let me know if you need any clarification.

lcolladotor commented 9 years ago

Merged @martinaryee's changes from https://github.com/ririzarr/bumphunter/commit/5435801557b8bb60be8e6264491b69372dfe928e

Current R CMD check output:

> system.time(check('bumphunter'))
Updating bumphunter documentation
Loading bumphunter
unloadNamespace("bumphunter") not successful. Forcing unload.
First time using roxygen2 4.0. Upgrading automatically...
'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD build  \
  '/Users/lcollado/Dropbox/JHSPH/Code/bumphunter' --no-manual  \
  --no-resave-data

* checking for file ‘/Users/lcollado/Dropbox/JHSPH/Code/bumphunter/DESCRIPTION’ ... OK
* preparing ‘bumphunter’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a ‘data/datalist’ file should be added
* building ‘bumphunter_1.7.5.tar.gz’

'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD check  \
  '/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T//RtmpVhQnKm/bumphunter_1.7.5.tar.gz'  \
  --timings

* using log directory ‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpVhQnKm/bumphunter.Rcheck’
* using R Under development (unstable) (2014-11-01 r66923)
* using platform: x86_64-apple-darwin10.8.0 (64-bit)
* using session charset: UTF-8
* checking for file ‘bumphunter/DESCRIPTION’ ... OK
* this is package ‘bumphunter’ version ‘1.7.5’
* checking package namespace information ... OK
* checking package dependencies ... NOTE
Depends: includes the non-default packages:
  ‘S4Vectors’ ‘IRanges’ ‘GenomeInfoDb’ ‘GenomicRanges’ ‘foreach’
  ‘iterators’ ‘parallel’ ‘locfit’
Adding so many packages to the search path is excessive and importing
selectively is preferable.
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘bumphunter’ can be installed ... [19s/19s] WARNING
Found the following significant warnings:
  Warning: multiple methods tables found for ‘score’
See ‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpVhQnKm/bumphunter.Rcheck/00install.out’ for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... NOTE
Unexported object imported by a ':::' call: ‘doParallel:::.options’
  See the note in ?`:::` about the use of this operator.
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... NOTE
bumphunterEngine: no visible binding for global variable ‘bootstraps’
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... NOTE
Rd file 'annotateTranscripts.Rd':
  \usage lines wider than 90 characters:
     annotateTranscripts(txdb, annotationPackage = NULL, by = c("tx","gene"), codingOnly=FALSE, verbose = TRUE, requireAnnotation = FALSE)

Rd file 'bumphunter.Rd':
  \usage lines wider than 90 characters:
     bumphunter(object, design, chr=NULL, pos, cluster=NULL,coef=2, cutoff=NULL, pickCutoff = FALSE, pickCutoffQ = 0.99, maxGap=500, nullMet ... [TRUNCATED]
     bumphunterEngine(mat, design, chr = NULL, pos, cluster = NULL, coef = 2, cutoff = NULL, pickCutoff = FALSE, pickCutoffQ = 0.99, maxGap  ... [TRUNCATED]

Rd file 'matchGenes.Rd':
  \usage lines wider than 90 characters:
     matchGenes(x, subject, type = c("any", "fiveprime"), promoterDist = 2500, skipExons = FALSE, verbose = TRUE)
  \examples lines wider than 100 characters:
         islands=makeGRangesFromDataFrame(read.delim("http://rafalab.jhsph.edu/CGI/model-based-cpg-islands-hg19.txt")[1:100,])

These lines will be truncated in the PDF manual.
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... [17s/14s] OK
Examples with CPU or elapsed time > 5s
            user system elapsed
bumphunter 5.513  1.806   3.919
* checking for unstated dependencies in tests ... OK
* checking tests ...
  Running ‘runTests.R’ [18s/30s]
  Running ‘test-all.R’ [55s/107s]
 [73s/137s] OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
   ‘bumphunter.Rnw’ ... [12s/10s] OK
 [12s/10s] OK
* checking re-building of vignette outputs ... [14s/13s] OK
* checking PDF version of manual ... OK
* DONE

WARNING: There was 1 warning.
NOTE: There were 4 notes.
See
  ‘/private/var/folders/cx/n9s558kx6fb7jf5z_pgszgb80000gn/T/RtmpVhQnKm/bumphunter.Rcheck/00check.log’
for details.

   user  system elapsed
322.079  12.853 393.684
lcolladotor commented 9 years ago

The latest commit fixes https://github.com/ririzarr/bumphunter/issues/4

lcolladotor commented 9 years ago

As shown in the comment of https://github.com/lcolladotor/derfinder/commit/cb5daf988dbdea7f2675889276ec7472315556ca, derfinder v1.1.17 works with bumphunter version 1.7.6. I haven't found any more bugs and it'd be great if you can merge this PR @martinaryee and/or @ririzarr.

If you have any questions please let me know. Thanks!

lcolladotor commented 9 years ago

Woo! Thanks @martinaryee =)

martinaryee commented 9 years ago

Thanks for the very clear and detailed commit messages @lcolladotor!

lcolladotor commented 9 years ago

No problem! ^_^