Back to Multiple platform build/check report for BioC 3.11
ABCDEFGHIJKLMNOPQRSTUVW[X]YZ

CHECK report for xmapbridge on tokay2

This page was generated on 2020-10-17 11:58:00 -0400 (Sat, 17 Oct 2020).

TO THE DEVELOPERS/MAINTAINERS OF THE xmapbridge PACKAGE: Please make sure to use the following settings in order to reproduce any error or warning you see on this page.
Package 1896/1905HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
xmapbridge 1.46.0
Chris Wirth
Snapshot Date: 2020-10-16 14:40:19 -0400 (Fri, 16 Oct 2020)
URL: https://git.bioconductor.org/packages/xmapbridge
Branch: RELEASE_3_11
Last Commit: f831afc
Last Changed Date: 2020-04-27 14:18:19 -0400 (Mon, 27 Apr 2020)
malbec2 Linux (Ubuntu 18.04.4 LTS) / x86_64  OK  OK  OK UNNEEDED, same version exists in internal repository
tokay2 Windows Server 2012 R2 Standard / x64  OK  OK [ OK ] NA 
machv2 macOS 10.14.6 Mojave / x86_64  OK  OK  OK  OK UNNEEDED, same version exists in internal repository

Summary

Package: xmapbridge
Version: 1.46.0
Command: C:\Users\biocbuild\bbs-3.11-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:xmapbridge.install-out.txt --library=C:\Users\biocbuild\bbs-3.11-bioc\R\library --no-vignettes --timings xmapbridge_1.46.0.tar.gz
StartedAt: 2020-10-17 09:18:02 -0400 (Sat, 17 Oct 2020)
EndedAt: 2020-10-17 09:18:46 -0400 (Sat, 17 Oct 2020)
EllapsedTime: 44.4 seconds
RetCode: 0
Status:  OK  
CheckDir: xmapbridge.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\Users\biocbuild\bbs-3.11-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:xmapbridge.install-out.txt --library=C:\Users\biocbuild\bbs-3.11-bioc\R\library --no-vignettes --timings xmapbridge_1.46.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'C:/Users/biocbuild/bbs-3.11-bioc/meat/xmapbridge.Rcheck'
* using R version 4.0.3 (2020-10-10)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using option '--no-vignettes'
* checking for file 'xmapbridge/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'xmapbridge' version '1.46.0'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'xmapbridge' can be installed ... 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
* loading checks for arch 'i386'
** 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
* loading checks for arch 'x64'
** 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
'library' or 'require' call to 'methods' which was already attached by Depends.
  Please remove these calls from your code.
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... NOTE
File 'xmapbridge/R/zzz.R':
  .onLoad has wrong argument list 'lib, pkg, where'
  .onLoad calls:
    require(methods, quietly = TRUE)

Package startup functions should have two arguments with names starting
  with 'lib' and 'pkg', respectively.
Package startup functions should not change the search path.
See section 'Good practice' in '?.onAttach'.

xmap.col: no visible global function definition for 'col2rgb'
Undefined global functions or variables:
  col2rgb
Consider adding
  importFrom("grDevices", "col2rgb")
to your NAMESPACE file.
* checking Rd files ... OK
* checking Rd metadata ... OK
* 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 line endings in Makefiles ... OK
* checking for GNU extensions in Makefiles ... OK
* checking include directives in Makefiles ... OK
* checking files in 'vignettes' ... OK
* checking examples ...
** running examples for arch 'i386' ... OK
** running examples for arch 'x64' ... OK
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
** running tests for arch 'i386' ...
  Running 'doRUnit.R'
  Running 'xmapbridge_test.R'
 OK
** running tests for arch 'x64' ...
  Running 'doRUnit.R'
  Running 'xmapbridge_test.R'
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in 'inst/doc' ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  'C:/Users/biocbuild/bbs-3.11-bioc/meat/xmapbridge.Rcheck/00check.log'
for details.



Installation output

xmapbridge.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\cygwin\bin\curl.exe -O https://malbec2.bioconductor.org/BBS/3.11/bioc/src/contrib/xmapbridge_1.46.0.tar.gz && rm -rf xmapbridge.buildbin-libdir && mkdir xmapbridge.buildbin-libdir && C:\Users\biocbuild\bbs-3.11-bioc\R\bin\R.exe CMD INSTALL --merge-multiarch --build --library=xmapbridge.buildbin-libdir xmapbridge_1.46.0.tar.gz && C:\Users\biocbuild\bbs-3.11-bioc\R\bin\R.exe CMD INSTALL xmapbridge_1.46.0.zip && rm xmapbridge_1.46.0.tar.gz xmapbridge_1.46.0.zip
###
##############################################################################
##############################################################################


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1632k  100 1632k    0     0  20.7M      0 --:--:-- --:--:-- --:--:-- 22.7M

install for i386

* installing *source* package 'xmapbridge' ...
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'xmapbridge'
    finding HTML links ... done
    exon.data                               html  
    xmap.col                                html  
    xmap.files                              html  
    xmap.plot                               html  
    xmapbridge-internal                     html  
    xmapbridge-package                      html  
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path

install for x64

* installing *source* package 'xmapbridge' ...
** testing if installed package can be loaded
* MD5 sums
packaged installation of 'xmapbridge' as xmapbridge_1.46.0.zip
* DONE (xmapbridge)
* installing to library 'C:/Users/biocbuild/bbs-3.11-bioc/R/library'
package 'xmapbridge' successfully unpacked and MD5 sums checked

Tests output

xmapbridge.Rcheck/tests_i386/doRUnit.Rout


R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-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.

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.

> if( require( "RUnit", quietly=TRUE ) ) {
+   pkg <- "xmapbridge"
+ 
+   if( Sys.getenv( "RCMDCHECK" ) == "FALSE" ) {
+     path <- file.path( getwd(), "..", "inst", "unitTests" )
+   }
+   else {
+     path <- system.file( package=pkg, "unitTests" )
+   }
+ 
+   cat( "\nRunning unit tests\n" )
+   print( list( pkg=pkg, getwd=getwd(), pathToUnitTests=path ) )
+   library( package=pkg, character.only=TRUE )
+  
+   testSuite <- defineTestSuite( name=paste( pkg, "unit testing" ), dirs=path )
+   tests <- runTestSuite( testSuite )
+  
+   pathReport <- file.path( path, "report" )
+  
+   cat( "------------------- UNIT TEST SUMMARY ---------------------\n\n" )
+   printTextProtocol( tests, showDetails=FALSE )
+   printTextProtocol( tests, showDetails=FALSE, fileName=paste( pathReport, "Summary.txt", sep="" ) )
+   printTextProtocol( tests, showDetails=TRUE,  fileName=paste( pathReport, ".txt", sep="" ) )
+  
+   printHTMLProtocol( tests, fileName=paste( pathReport, ".html", sep="" ) )
+  
+   tmp <- getErrors( tests )
+   if( tmp$nFail > 0 | tmp$nErr > 0 ) {
+     stop( paste( "\n\nunit testing failed (#test failures: ", tmp$nFail, ", #R errors: ",  tmp$nErr, ")\n\n", sep="" ) )
+   }
+ } else {
+   warning( "cannot run unit tests -- package RUnit is not available" )
+ }

Running unit tests
$pkg
[1] "xmapbridge"

$getwd
[1] "C:/Users/biocbuild/bbs-3.11-bioc/meat/xmapbridge.Rcheck/tests_i386"

$pathToUnitTests
[1] "C:/Users/biocbuild/bbs-3.11-bioc/R/library/xmapbridge/unitTests"



Executing test function test.get.xmap.cache.dir  ...  done successfully.



Executing test function test.graph  ...  done successfully.



Executing test function test.plots  ...  done successfully.



Executing test function test.projects  ...  done successfully.



Executing test function test.utils  ...  done successfully.



Executing test function test.validate.x.and.y  ...  done successfully.

------------------- UNIT TEST SUMMARY ---------------------

RUNIT TEST PROTOCOL -- Sat Oct 17 09:18:31 2020 
*********************************************** 
Number of test functions: 6 
Number of errors: 0 
Number of failures: 0 

 
1 Test Suite : 
xmapbridge unit testing - 6 test functions, 0 errors, 0 failures
> 
> proc.time()
   user  system elapsed 
   1.06    0.53    1.62 

xmapbridge.Rcheck/tests_x64/doRUnit.Rout


R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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.

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.

> if( require( "RUnit", quietly=TRUE ) ) {
+   pkg <- "xmapbridge"
+ 
+   if( Sys.getenv( "RCMDCHECK" ) == "FALSE" ) {
+     path <- file.path( getwd(), "..", "inst", "unitTests" )
+   }
+   else {
+     path <- system.file( package=pkg, "unitTests" )
+   }
+ 
+   cat( "\nRunning unit tests\n" )
+   print( list( pkg=pkg, getwd=getwd(), pathToUnitTests=path ) )
+   library( package=pkg, character.only=TRUE )
+  
+   testSuite <- defineTestSuite( name=paste( pkg, "unit testing" ), dirs=path )
+   tests <- runTestSuite( testSuite )
+  
+   pathReport <- file.path( path, "report" )
+  
+   cat( "------------------- UNIT TEST SUMMARY ---------------------\n\n" )
+   printTextProtocol( tests, showDetails=FALSE )
+   printTextProtocol( tests, showDetails=FALSE, fileName=paste( pathReport, "Summary.txt", sep="" ) )
+   printTextProtocol( tests, showDetails=TRUE,  fileName=paste( pathReport, ".txt", sep="" ) )
+  
+   printHTMLProtocol( tests, fileName=paste( pathReport, ".html", sep="" ) )
+  
+   tmp <- getErrors( tests )
+   if( tmp$nFail > 0 | tmp$nErr > 0 ) {
+     stop( paste( "\n\nunit testing failed (#test failures: ", tmp$nFail, ", #R errors: ",  tmp$nErr, ")\n\n", sep="" ) )
+   }
+ } else {
+   warning( "cannot run unit tests -- package RUnit is not available" )
+ }

Running unit tests
$pkg
[1] "xmapbridge"

$getwd
[1] "C:/Users/biocbuild/bbs-3.11-bioc/meat/xmapbridge.Rcheck/tests_x64"

$pathToUnitTests
[1] "C:/Users/biocbuild/bbs-3.11-bioc/R/library/xmapbridge/unitTests"



Executing test function test.get.xmap.cache.dir  ...  done successfully.



Executing test function test.graph  ...  done successfully.



Executing test function test.plots  ...  done successfully.



Executing test function test.projects  ...  done successfully.



Executing test function test.utils  ...  done successfully.



Executing test function test.validate.x.and.y  ...  done successfully.

------------------- UNIT TEST SUMMARY ---------------------

RUNIT TEST PROTOCOL -- Sat Oct 17 09:18:36 2020 
*********************************************** 
Number of test functions: 6 
Number of errors: 0 
Number of failures: 0 

 
1 Test Suite : 
xmapbridge unit testing - 6 test functions, 0 errors, 0 failures
> 
> proc.time()
   user  system elapsed 
   1.12    0.59    1.70 

xmapbridge.Rcheck/tests_i386/xmapbridge_test.Rout


R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-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.

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.

> #                               8             o      8               
> #                               8                    8               
> #  `o  o' ooYoYo. .oPYo. .oPYo. 8oPYo. oPYo. o8 .oPYo8 .oPYo. .oPYo. 
> #   `bd'  8' 8  8 .oooo8 8    8 8    8 8  `'  8 8    8 8    8 8oooo8 
> #   d'`b  8  8  8 8    8 8    8 8    8 8      8 8    8 8    8 8.     
> #  o'  `o 8  8  8 `YooP8 8YooP' `YooP' 8      8 `YooP' `YooP8 `Yooo' 
> #                        8                                  8        
> #                        8                              YooP'
> #
> # Author:  Tim Yates and Crispin J Miller
> # Date:    2008/08/13
> # Licence: LGPL-v3
> #
> # This file tests all of the exported methods from the library to make sure
> # they work as expected (generate the correct files), fail cleanly as required,
> # and clean up after themselves in case of faliure after a particular file has
> # been created
> #
> 
> library( xmapbridge )
> 
> .test.env <- new.env( hash=TRUE, parent=emptyenv() )
> 
> ###############################################################################
> ## Assert methods (to make the code look a bit cleaner)
> ###############################################################################
> 
> assertEqual <- function( a, b, msg="not equal" ) {
+   if( class( a ) == "list" && class( b ) == "list" ) {
+     if( !isTRUE( all.equal( a, b ) ) ) {
+       stop( msg )
+     }
+   }
+   else if( a != b ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertNotEqual <- function( a, b, msg="equal" ) {
+   if( class( a ) == "list" && class( b ) == "list" ) {
+     if( isTRUE( all.equal( a, b ) ) ) {
+       stop( msg )
+     }
+   }
+   else if( a == b ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertLength <- function( a, len, msg="invalid length" ) {
+   if( length( a ) != len ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertNull <- function( a, msg="is null" ) {
+   if( !is.null( a ) ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertNotNull <- function( a, msg="is not null" ) {
+   if( is.null( a ) ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertNumeric <- function( a, msg="non-numeric" ) {
+   if( !is.number( a ) ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> shouldFail <- function( test, msg=paste( "FAIL:", test ) ) {
+   .ok <- FALSE
+   tryCatch( {
+     test()
+     .ok <- TRUE
+   }, warning=function(e) {
+     print( paste( "caught a warning '", e$message, "'" ) ) 
+   }, error=function(e) {
+     print( paste( "Failed (yay) '", e$message, "'" ) ) 
+   } )
+   if( .ok ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> ###############################################################################
> ## Setup and Teardown Methods
> ###############################################################################
> 
> .setup <- function() {
+   .test.env$tmp  <- tempdir()
+   .test.env$old  <- Sys.getenv( "XMAP_BRIDGE_CACHE" )
+   Sys.setenv( XMAP_BRIDGE_CACHE=.test.env$tmp )
+ }
> 
> .teardown <- function() {
+   # Delete the temp folder, and reset our environment
+   Sys.setenv( XMAP_BRIDGE_CACHE=.test.env$old )
+   unlink( .test.env$tmp, recursive=TRUE )
+ }
> 
> ###############################################################################
> ## And call the tests...
> ###############################################################################
> 
> # Set up the environment
> ###############################################################################
> 
> .setup()
> 
> # Project tests
> ###############################################################################
> 
> shouldFail( function() { xmap.project.load( "FAIL!" ) }, "Invalid project parameter shouldn't work!" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> shouldFail( function() { xmap.project.save( "FAIL!", list() ) }, "Invalid project parameter shouldn't work!" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> shouldFail( function() { xmap.project.delete( "FAIL!" ) }, "Invalid project parameter shouldn't work!" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> 
> .project <- xmap.project.new( "Project A" )
> .projects <- xmap.project.list()
> assertLength( .projects, 1, paste( "Got", length( .projects ), "projects.  Should have only 1" ) )
[1] TRUE
> assertEqual( .project, .projects[[1]], "Project not equal to project in list" )
[1] TRUE
> 
> .data <- xmap.project.load( .project )
> assertNotNull( .data, "Load failed for data" )
[1] TRUE
> assertLength( .data, 1, "Data should have 1 element" )
[1] TRUE
> assertEqual( "Project A", .data$NAME )
[1] TRUE
> .data$NAME <- "Project Z"
> xmap.project.save( .project, .data )
> .data2 <- xmap.project.load( .project )
> assertEqual( "Project Z", .data2$NAME, "Did not load altered project name" )
[1] TRUE
> assertEqual( .data, .data2, "Saved and loaded data not identical!" )
[1] TRUE
> 
> .project2 <- xmap.project.new( "Project B" )
> .projects <- xmap.project.list()
> assertLength( .projects, 2, paste( "Got", length( .projects ), "projects.  Should have 2" ) )
[1] TRUE
> 
> shouldFail( function() { assertEqual( .project, .project2 ) }, paste( "Project 1 and 2 should not be equal" ) )
[1] "Failed (yay) ' not equal '"
[1] TRUE
> assertNotEqual( .project, .project2, paste( "Project 1 and 2 should not be equal" ) )
[1] TRUE
> 
> xmap.project.delete( .project2 )
> 
> .projects <- xmap.project.list()
> assertLength( .projects, 1, paste( "Got", length( .projects ), "projects.  Should have only 1" ) )
[1] TRUE
> 
> # Graph tests
> ###############################################################################
> 
> shouldFail( function() {    xmap.graph.new( "NonProjectObject", "A Graph", "desc", -10, 10, "1", 1000000, 2000000, ylab="label", species="homo_sapiens" ) }, "Invalid project parameter" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> shouldFail( function() {   xmap.graph.load( "FAIL!" )         }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() {   xmap.graph.list( "FAIL!" )         }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> shouldFail( function() {   xmap.graph.save( "FAIL!", list() ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() { xmap.graph.delete( "FAIL!" )         }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() {    xmap.graph.new( .project2, "A Graph", "desc", -10, 10, "1", 1000000, 2000000, ylab="label", species="homo_sapiens" ) }, "Writing to a missing project seeme to work?" )
xmapbridge:Project( C:\Users\biocbuild\bbs-3.11-bioc\tmpdir\RtmpS4Usol/2020.Oct.17.09.18.32_0.56.xmb ) 
[1] "Failed (yay) ' non-string argument to .Internal(paste) '"
[1] TRUE
> 
> .graph <- xmap.graph.new( .project, "A Graph", "desc", -10, 10, "1", 1000000, 2000000, ylab="label", species="homo_sapiens" )
> 
> .graphs <- xmap.graph.list( .project )
> assertLength( .graphs, 1, paste( "Got", length( .graphs ), "graphs.  Should have only 1" ) )
[1] TRUE
> assertEqual( .graph, .graphs[[1]], "Graph not equal to first graph in list" )
[1] TRUE
> 
> .data <- xmap.graph.load( .graph )
> assertNotNull( .data, "Load failed for data" )
[1] TRUE
> assertLength( .data, 9, "Graph data should have 9 elements" )
[1] TRUE
> assertEqual( .data$MIN, -10 )
[1] TRUE
> .data$MIN <- 0
> xmap.graph.save( .graph, .data )
> .data2 <- xmap.graph.load( .graph )
> assertEqual( .data2$MIN, 0 )
[1] TRUE
> assertEqual( .data, .data2, "Saved and loaded graph data not identical!" )
[1] TRUE
> 
> .graph2 <- xmap.graph.new( .project, "A Graph", "desc", -10, 10, "1", 1000000, 2000000, ylab="label", species="homo_sapiens" )
> 
> .graphs <- xmap.graph.list( .project )
> assertLength( .graphs, 2, paste( "Got", length( .graphs ), "graphs.  Should have 2" ) )
[1] TRUE
> 
> xmap.graph.delete( .graph2 )
> 
> # Plot tests
> ###############################################################################
> 
> .X <- seq( 1000000, 2000000, by=1000 )
> .Y <- runif( length( .X ), -10, 10 )
> .badY <- runif( ( length( .X ) - 1 ), -10, 10 )
> .alphaY <- rep( letters, ceiling( length( .X ) / length( letters ) ) )[ 1:length( .X ) ]
> 
> print( paste( ".X has", length( .X ), "elements, .Y has", length( .Y ), ", .badY has", length( .badY ), "elements, and .alphaY has", length( .alphaY ), "elements" ) )
[1] ".X has 1001 elements, .Y has 1001 , .badY has 1000 elements, and .alphaY has 1001 elements"
> 
> shouldFail( function() {    xmap.plot.new( "FAIL!", "A Plot", .X, .Y, type="line" ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() {   xmap.plot.load( "FAIL!" )                 }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' plotid should be an object of class Plot, not character '"
[1] TRUE
> shouldFail( function() {   xmap.plot.list( "FAIL!" )                 }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() {   xmap.plot.save( "FAIL!", list(), .X, .Y ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' plotid should be an object of class Plot, not character '"
[1] TRUE
> shouldFail( function() { xmap.plot.delete( "FAIL!" )                 }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' plotid should be an object of class Plot, not character '"
[1] TRUE
> shouldFail( function() {    xmap.plot.new( .graph2, "A Plot", .X, .Y, type="line" ) }, "Invalid graph parameter shouldn't work!" )
xmapbridge:Project( C:\Users\biocbuild\bbs-3.11-bioc\tmpdir\RtmpS4Usol/2020.Oct.17.09.18.32_0.42.xmb ) 
[1] "Failed (yay) ' non-string argument to .Internal(paste) '"
[1] TRUE
> shouldFail( function() {    xmap.plot.new( .graph, "A Plot", .X, .badY, type="line" ) }, "Invalid y list size shouldn't work!" )
[1] "Failed (yay) ' 'x' and 'y' lengths differ '"
[1] TRUE
> 
> .plot <- xmap.plot.new( .graph, "A Plot", .X, .Y, type="line" )
> 
> .plots <- xmap.plot.list( .graph )
> assertLength( .plots, 1, paste( "Got", length( .plots ), "plots.  Should have only 1" ) )
[1] TRUE
> assertEqual( .plot, .plots[[1]], "Plot does not equal the first plot in the list" )
[1] TRUE
> 
> .data <- xmap.plot.load( .plot )
> assertNotNull( .data, "Load failed for plot data" )
[1] TRUE
> shouldFail( function() { assertLength( .data, 0 ) }, "Plot data should have more than 0 elements" )
[1] "Failed (yay) ' invalid length '"
[1] TRUE
> assertEqual( .data$TYPE, "line", "Plot type should be 'line'" )
[1] TRUE
> .data$TYPE <- "area"
> xmap.plot.save( .plot, .data, .X, .Y )
> .data2 <- xmap.plot.load( .plot )
> assertEqual( .data2$TYPE, "area", "Plot type should now be 'area'" )
[1] TRUE
> assertEqual( .data, .data2, "Saved and loaded plot data not identical!" )
[1] TRUE
> 
> .plot2 <- xmap.plot.new( .graph, "A Plot", .X, .Y, type="line" )
> 
> .plots <- xmap.plot.list( .graph )
> assertLength( .plots, 2, paste( "Got", length( .plots ), "plots.  Should have only 2" ) )
[1] TRUE
> 
> xmap.plot.delete( .plot )
> .plots <- xmap.plot.list( .graph )
> assertLength( .plots, 1, paste( "Got", length( .plots ), "plots.  Should have only 1" ) )
[1] TRUE
> 
> # Util tests
> ###############################################################################
> 
> shouldFail( function() { xmap.plot( .X, .badY, species="homo_sapiens", "1", type="line" ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' 'x' and 'y' lengths differ '"
[1] TRUE
> shouldFail( function() { xmap.plot( .X, .alphaY, species="homo_sapiens", "1", type="line" ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' y seems to contain non-numerics '"
[1] TRUE
> shouldFail( function() { xmap.plot( .X, .Y, species="homo_sapiens", "1", type="INVALID" ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' 'arg' should be one of \"scatter\", \"line\", \"bar\", \"step\", \"area\", \"steparea\" [dg] [dp] '"
[1] TRUE
> shouldFail( function() { xmap.plot( .X, .Y, species="MONKEY", "1" ) }, "Invalid species parameter shouldn't work!" )
[1] "Failed (yay) ' 'arg' should be one of \"homo_sapiens\", \"mus_musculus\", \"rattus_norvegicus\" '"
[1] TRUE
> shouldFail( function() { xmap.plot( .X, .Y, species="homo_sapiens" ) }, "Missing chromosome should have failed!" )
[1] "Failed (yay) ' You need to specify a chromosome for this plot '"
[1] TRUE
> .projects <- xmap.project.list()
> assertLength( .projects, 1, paste( "Got", length( .projects ), "projects.  There should still just be 1" ) )
[1] TRUE
> 
> .plot <- xmap.plot( .X, .Y, chr="1" )
> .projects <- xmap.project.list()
> assertLength( .projects, 2, paste( "Got", length( .projects ), "projects.  There should be 2" ) )
[1] TRUE
> 
> .graphs <- xmap.graph.list( .plot )
> assertLength( .graphs, 1, paste( "Got", length( .graphs ), "graphs.  There should be 1" ) )
[1] TRUE
> 
> .graph <- xmap.points( .X, .Y )
> .plots <- xmap.plot.list( .plot )
> assertLength( .plots, 2, paste( "Got", length( .plots ), "plots.  There should be 2" ) )
[1] TRUE
> 
> xmap.project.delete( .project )
> xmap.project.delete( .plot )
> .projects <- xmap.project.list()
> assertLength( .projects, 0, paste( "Got", length( .projects ), "projects.  There shouldn't be any" ) )
[1] TRUE
> 
> # Cleanup
> ###############################################################################
> 
> .teardown()
> 
> proc.time()
   user  system elapsed 
   1.34    0.75    2.07 

xmapbridge.Rcheck/tests_x64/xmapbridge_test.Rout


R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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.

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.

> #                               8             o      8               
> #                               8                    8               
> #  `o  o' ooYoYo. .oPYo. .oPYo. 8oPYo. oPYo. o8 .oPYo8 .oPYo. .oPYo. 
> #   `bd'  8' 8  8 .oooo8 8    8 8    8 8  `'  8 8    8 8    8 8oooo8 
> #   d'`b  8  8  8 8    8 8    8 8    8 8      8 8    8 8    8 8.     
> #  o'  `o 8  8  8 `YooP8 8YooP' `YooP' 8      8 `YooP' `YooP8 `Yooo' 
> #                        8                                  8        
> #                        8                              YooP'
> #
> # Author:  Tim Yates and Crispin J Miller
> # Date:    2008/08/13
> # Licence: LGPL-v3
> #
> # This file tests all of the exported methods from the library to make sure
> # they work as expected (generate the correct files), fail cleanly as required,
> # and clean up after themselves in case of faliure after a particular file has
> # been created
> #
> 
> library( xmapbridge )
> 
> .test.env <- new.env( hash=TRUE, parent=emptyenv() )
> 
> ###############################################################################
> ## Assert methods (to make the code look a bit cleaner)
> ###############################################################################
> 
> assertEqual <- function( a, b, msg="not equal" ) {
+   if( class( a ) == "list" && class( b ) == "list" ) {
+     if( !isTRUE( all.equal( a, b ) ) ) {
+       stop( msg )
+     }
+   }
+   else if( a != b ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertNotEqual <- function( a, b, msg="equal" ) {
+   if( class( a ) == "list" && class( b ) == "list" ) {
+     if( isTRUE( all.equal( a, b ) ) ) {
+       stop( msg )
+     }
+   }
+   else if( a == b ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertLength <- function( a, len, msg="invalid length" ) {
+   if( length( a ) != len ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertNull <- function( a, msg="is null" ) {
+   if( !is.null( a ) ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertNotNull <- function( a, msg="is not null" ) {
+   if( is.null( a ) ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> assertNumeric <- function( a, msg="non-numeric" ) {
+   if( !is.number( a ) ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> shouldFail <- function( test, msg=paste( "FAIL:", test ) ) {
+   .ok <- FALSE
+   tryCatch( {
+     test()
+     .ok <- TRUE
+   }, warning=function(e) {
+     print( paste( "caught a warning '", e$message, "'" ) ) 
+   }, error=function(e) {
+     print( paste( "Failed (yay) '", e$message, "'" ) ) 
+   } )
+   if( .ok ) {
+     stop( msg )
+   }
+   TRUE
+ }
> 
> ###############################################################################
> ## Setup and Teardown Methods
> ###############################################################################
> 
> .setup <- function() {
+   .test.env$tmp  <- tempdir()
+   .test.env$old  <- Sys.getenv( "XMAP_BRIDGE_CACHE" )
+   Sys.setenv( XMAP_BRIDGE_CACHE=.test.env$tmp )
+ }
> 
> .teardown <- function() {
+   # Delete the temp folder, and reset our environment
+   Sys.setenv( XMAP_BRIDGE_CACHE=.test.env$old )
+   unlink( .test.env$tmp, recursive=TRUE )
+ }
> 
> ###############################################################################
> ## And call the tests...
> ###############################################################################
> 
> # Set up the environment
> ###############################################################################
> 
> .setup()
> 
> # Project tests
> ###############################################################################
> 
> shouldFail( function() { xmap.project.load( "FAIL!" ) }, "Invalid project parameter shouldn't work!" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> shouldFail( function() { xmap.project.save( "FAIL!", list() ) }, "Invalid project parameter shouldn't work!" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> shouldFail( function() { xmap.project.delete( "FAIL!" ) }, "Invalid project parameter shouldn't work!" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> 
> .project <- xmap.project.new( "Project A" )
> .projects <- xmap.project.list()
> assertLength( .projects, 1, paste( "Got", length( .projects ), "projects.  Should have only 1" ) )
[1] TRUE
> assertEqual( .project, .projects[[1]], "Project not equal to project in list" )
[1] TRUE
> 
> .data <- xmap.project.load( .project )
> assertNotNull( .data, "Load failed for data" )
[1] TRUE
> assertLength( .data, 1, "Data should have 1 element" )
[1] TRUE
> assertEqual( "Project A", .data$NAME )
[1] TRUE
> .data$NAME <- "Project Z"
> xmap.project.save( .project, .data )
> .data2 <- xmap.project.load( .project )
> assertEqual( "Project Z", .data2$NAME, "Did not load altered project name" )
[1] TRUE
> assertEqual( .data, .data2, "Saved and loaded data not identical!" )
[1] TRUE
> 
> .project2 <- xmap.project.new( "Project B" )
> .projects <- xmap.project.list()
> assertLength( .projects, 2, paste( "Got", length( .projects ), "projects.  Should have 2" ) )
[1] TRUE
> 
> shouldFail( function() { assertEqual( .project, .project2 ) }, paste( "Project 1 and 2 should not be equal" ) )
[1] "Failed (yay) ' not equal '"
[1] TRUE
> assertNotEqual( .project, .project2, paste( "Project 1 and 2 should not be equal" ) )
[1] TRUE
> 
> xmap.project.delete( .project2 )
> 
> .projects <- xmap.project.list()
> assertLength( .projects, 1, paste( "Got", length( .projects ), "projects.  Should have only 1" ) )
[1] TRUE
> 
> # Graph tests
> ###############################################################################
> 
> shouldFail( function() {    xmap.graph.new( "NonProjectObject", "A Graph", "desc", -10, 10, "1", 1000000, 2000000, ylab="label", species="homo_sapiens" ) }, "Invalid project parameter" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> shouldFail( function() {   xmap.graph.load( "FAIL!" )         }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() {   xmap.graph.list( "FAIL!" )         }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' projectid should be an object of class Project, not character '"
[1] TRUE
> shouldFail( function() {   xmap.graph.save( "FAIL!", list() ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() { xmap.graph.delete( "FAIL!" )         }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() {    xmap.graph.new( .project2, "A Graph", "desc", -10, 10, "1", 1000000, 2000000, ylab="label", species="homo_sapiens" ) }, "Writing to a missing project seeme to work?" )
xmapbridge:Project( C:\Users\biocbuild\bbs-3.11-bioc\tmpdir\RtmpcvvvDR/2020.Oct.17.09.18.36_0.48.xmb ) 
[1] "Failed (yay) ' non-string argument to .Internal(paste) '"
[1] TRUE
> 
> .graph <- xmap.graph.new( .project, "A Graph", "desc", -10, 10, "1", 1000000, 2000000, ylab="label", species="homo_sapiens" )
> 
> .graphs <- xmap.graph.list( .project )
> assertLength( .graphs, 1, paste( "Got", length( .graphs ), "graphs.  Should have only 1" ) )
[1] TRUE
> assertEqual( .graph, .graphs[[1]], "Graph not equal to first graph in list" )
[1] TRUE
> 
> .data <- xmap.graph.load( .graph )
> assertNotNull( .data, "Load failed for data" )
[1] TRUE
> assertLength( .data, 9, "Graph data should have 9 elements" )
[1] TRUE
> assertEqual( .data$MIN, -10 )
[1] TRUE
> .data$MIN <- 0
> xmap.graph.save( .graph, .data )
> .data2 <- xmap.graph.load( .graph )
> assertEqual( .data2$MIN, 0 )
[1] TRUE
> assertEqual( .data, .data2, "Saved and loaded graph data not identical!" )
[1] TRUE
> 
> .graph2 <- xmap.graph.new( .project, "A Graph", "desc", -10, 10, "1", 1000000, 2000000, ylab="label", species="homo_sapiens" )
> 
> .graphs <- xmap.graph.list( .project )
> assertLength( .graphs, 2, paste( "Got", length( .graphs ), "graphs.  Should have 2" ) )
[1] TRUE
> 
> xmap.graph.delete( .graph2 )
> 
> # Plot tests
> ###############################################################################
> 
> .X <- seq( 1000000, 2000000, by=1000 )
> .Y <- runif( length( .X ), -10, 10 )
> .badY <- runif( ( length( .X ) - 1 ), -10, 10 )
> .alphaY <- rep( letters, ceiling( length( .X ) / length( letters ) ) )[ 1:length( .X ) ]
> 
> print( paste( ".X has", length( .X ), "elements, .Y has", length( .Y ), ", .badY has", length( .badY ), "elements, and .alphaY has", length( .alphaY ), "elements" ) )
[1] ".X has 1001 elements, .Y has 1001 , .badY has 1000 elements, and .alphaY has 1001 elements"
> 
> shouldFail( function() {    xmap.plot.new( "FAIL!", "A Plot", .X, .Y, type="line" ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() {   xmap.plot.load( "FAIL!" )                 }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' plotid should be an object of class Plot, not character '"
[1] TRUE
> shouldFail( function() {   xmap.plot.list( "FAIL!" )                 }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' graphid should be an object of class Graph, not character '"
[1] TRUE
> shouldFail( function() {   xmap.plot.save( "FAIL!", list(), .X, .Y ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' plotid should be an object of class Plot, not character '"
[1] TRUE
> shouldFail( function() { xmap.plot.delete( "FAIL!" )                 }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' plotid should be an object of class Plot, not character '"
[1] TRUE
> shouldFail( function() {    xmap.plot.new( .graph2, "A Plot", .X, .Y, type="line" ) }, "Invalid graph parameter shouldn't work!" )
xmapbridge:Project( C:\Users\biocbuild\bbs-3.11-bioc\tmpdir\RtmpcvvvDR/2020.Oct.17.09.18.36_0.35.xmb ) 
[1] "Failed (yay) ' non-string argument to .Internal(paste) '"
[1] TRUE
> shouldFail( function() {    xmap.plot.new( .graph, "A Plot", .X, .badY, type="line" ) }, "Invalid y list size shouldn't work!" )
[1] "Failed (yay) ' 'x' and 'y' lengths differ '"
[1] TRUE
> 
> .plot <- xmap.plot.new( .graph, "A Plot", .X, .Y, type="line" )
> 
> .plots <- xmap.plot.list( .graph )
> assertLength( .plots, 1, paste( "Got", length( .plots ), "plots.  Should have only 1" ) )
[1] TRUE
> assertEqual( .plot, .plots[[1]], "Plot does not equal the first plot in the list" )
[1] TRUE
> 
> .data <- xmap.plot.load( .plot )
> assertNotNull( .data, "Load failed for plot data" )
[1] TRUE
> shouldFail( function() { assertLength( .data, 0 ) }, "Plot data should have more than 0 elements" )
[1] "Failed (yay) ' invalid length '"
[1] TRUE
> assertEqual( .data$TYPE, "line", "Plot type should be 'line'" )
[1] TRUE
> .data$TYPE <- "area"
> xmap.plot.save( .plot, .data, .X, .Y )
> .data2 <- xmap.plot.load( .plot )
> assertEqual( .data2$TYPE, "area", "Plot type should now be 'area'" )
[1] TRUE
> assertEqual( .data, .data2, "Saved and loaded plot data not identical!" )
[1] TRUE
> 
> .plot2 <- xmap.plot.new( .graph, "A Plot", .X, .Y, type="line" )
> 
> .plots <- xmap.plot.list( .graph )
> assertLength( .plots, 2, paste( "Got", length( .plots ), "plots.  Should have only 2" ) )
[1] TRUE
> 
> xmap.plot.delete( .plot )
> .plots <- xmap.plot.list( .graph )
> assertLength( .plots, 1, paste( "Got", length( .plots ), "plots.  Should have only 1" ) )
[1] TRUE
> 
> # Util tests
> ###############################################################################
> 
> shouldFail( function() { xmap.plot( .X, .badY, species="homo_sapiens", "1", type="line" ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' 'x' and 'y' lengths differ '"
[1] TRUE
> shouldFail( function() { xmap.plot( .X, .alphaY, species="homo_sapiens", "1", type="line" ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' y seems to contain non-numerics '"
[1] TRUE
> shouldFail( function() { xmap.plot( .X, .Y, species="homo_sapiens", "1", type="INVALID" ) }, "Invalid graph parameter shouldn't work!" )
[1] "Failed (yay) ' 'arg' should be one of \"scatter\", \"line\", \"bar\", \"step\", \"area\", \"steparea\" [dg] [dp] '"
[1] TRUE
> shouldFail( function() { xmap.plot( .X, .Y, species="MONKEY", "1" ) }, "Invalid species parameter shouldn't work!" )
[1] "Failed (yay) ' 'arg' should be one of \"homo_sapiens\", \"mus_musculus\", \"rattus_norvegicus\" '"
[1] TRUE
> shouldFail( function() { xmap.plot( .X, .Y, species="homo_sapiens" ) }, "Missing chromosome should have failed!" )
[1] "Failed (yay) ' You need to specify a chromosome for this plot '"
[1] TRUE
> .projects <- xmap.project.list()
> assertLength( .projects, 1, paste( "Got", length( .projects ), "projects.  There should still just be 1" ) )
[1] TRUE
> 
> .plot <- xmap.plot( .X, .Y, chr="1" )
> .projects <- xmap.project.list()
> assertLength( .projects, 2, paste( "Got", length( .projects ), "projects.  There should be 2" ) )
[1] TRUE
> 
> .graphs <- xmap.graph.list( .plot )
> assertLength( .graphs, 1, paste( "Got", length( .graphs ), "graphs.  There should be 1" ) )
[1] TRUE
> 
> .graph <- xmap.points( .X, .Y )
> .plots <- xmap.plot.list( .plot )
> assertLength( .plots, 2, paste( "Got", length( .plots ), "plots.  There should be 2" ) )
[1] TRUE
> 
> xmap.project.delete( .project )
> xmap.project.delete( .plot )
> .projects <- xmap.project.list()
> assertLength( .projects, 0, paste( "Got", length( .projects ), "projects.  There shouldn't be any" ) )
[1] TRUE
> 
> # Cleanup
> ###############################################################################
> 
> .teardown()
> 
> proc.time()
   user  system elapsed 
   1.12    0.46    1.57 

Example timings

xmapbridge.Rcheck/examples_i386/xmapbridge-Ex.timings

nameusersystemelapsed
xmap.col0.030.000.03
xmap.files0.130.010.14
xmap.plot0.030.020.04

xmapbridge.Rcheck/examples_x64/xmapbridge-Ex.timings

nameusersystemelapsed
xmap.col0.020.000.01
xmap.files0.140.030.17
xmap.plot0.040.030.08