Back to Multiple platform build/check report for BioC 3.9
ABCDEF[G]HIJKLMNOPQRSTUVWXYZ

CHECK report for genomeIntervals on tokay2

This page was generated on 2019-04-09 11:57:03 -0400 (Tue, 09 Apr 2019).

Package 643/1703HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
genomeIntervals 1.39.0
Julien Gagneur
Snapshot Date: 2019-04-08 17:01:18 -0400 (Mon, 08 Apr 2019)
URL: https://git.bioconductor.org/packages/genomeIntervals
Branch: master
Last Commit: 6b1216b
Last Changed Date: 2018-10-30 11:54:28 -0400 (Tue, 30 Oct 2018)
malbec2 Linux (Ubuntu 18.04.2 LTS) / x86_64  OK  OK  OK UNNEEDED, same version exists in internal repository
tokay2 Windows Server 2012 R2 Standard / x64  OK  OK [ WARNINGS ] OK UNNEEDED, same version exists in internal repository
celaya2 OS X 10.11.6 El Capitan / x86_64  OK  OK  OK  OK UNNEEDED, same version exists in internal repository
merida2 OS X 10.11.6 El Capitan / x86_64  OK  OK  OK  OK 

Summary

Package: genomeIntervals
Version: 1.39.0
Command: C:\Users\biocbuild\bbs-3.9-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:genomeIntervals.install-out.txt --library=C:\Users\biocbuild\bbs-3.9-bioc\R\library --no-vignettes --timings genomeIntervals_1.39.0.tar.gz
StartedAt: 2019-04-09 02:59:55 -0400 (Tue, 09 Apr 2019)
EndedAt: 2019-04-09 03:02:25 -0400 (Tue, 09 Apr 2019)
EllapsedTime: 149.3 seconds
RetCode: 0
Status:  WARNINGS  
CheckDir: genomeIntervals.Rcheck
Warnings: 1

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\Users\biocbuild\bbs-3.9-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:genomeIntervals.install-out.txt --library=C:\Users\biocbuild\bbs-3.9-bioc\R\library --no-vignettes --timings genomeIntervals_1.39.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'C:/Users/biocbuild/bbs-3.9-bioc/meat/genomeIntervals.Rcheck'
* using R Under development (unstable) (2019-03-09 r76216)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using option '--no-vignettes'
* checking for file 'genomeIntervals/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'genomeIntervals' version '1.39.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 'genomeIntervals' can be installed ... WARNING
Found the following significant warnings:
  Rd warning: C:/Users/biocbuild/bbs-3.9-bioc/tmpdir/RtmpmWp1Kx/R.INSTALL1fa033c55489/genomeIntervals/man/Genome_intervals-class.Rd:110: file link 'width' in package 'IRanges' does not exist and so has been treated as a topic
  Rd warning: C:/Users/biocbuild/bbs-3.9-bioc/tmpdir/RtmpmWp1Kx/R.INSTALL1fa033c55489/genomeIntervals/man/Genome_intervals-coercion-methods.Rd:49: file link 'readGff3' in package 'genomeIntervals' does not exist and so has been treated as a topic
See 'C:/Users/biocbuild/bbs-3.9-bioc/meat/genomeIntervals.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
* 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 ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... NOTE
interval_complement,Genome_intervals: warning in
  factor(rep(as.character(fac.comb[, 2]), times = nrows), level =
  levels(seqnames(x))): partial argument match of 'level' to 'levels'
interval_complement,Genome_intervals_stranded: warning in
  factor(rep(names(s), times = sapply(gi.list, nrow)), level =
  levels(strand(x))): partial argument match of 'level' to 'levels'
coerce,Genome_intervals-RangedData: no visible global function
  definition for 'na.omit'
writeGff3,data.frame: no visible global function definition for
  'write.table'
Undefined global functions or variables:
  na.omit write.table
Consider adding
  importFrom("stats", "na.omit")
  importFrom("utils", "write.table")
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 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 'benchmarking-tests.R'
  Comparing 'benchmarking-tests.Rout' to 'benchmarking-tests.Rout.save' ...13,35d12
< 
< 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, sd, var, xtabs
< 
< The following objects are masked from 'package:base':
< 
<     Filter, Find, Map, Position, Reduce, anyDuplicated, append,
<     as.data.frame, basename, cbind, colMeans, colSums, colnames,
<     dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
<     intersect, is.unsorted, lapply, mapply, match, mget, order, paste,
<     pmax, pmax.int, pmin, pmin.int, rank, rbind, rowMeans, rowSums,
<     rownames, sapply, setdiff, sort, table, tapply, union, unique,
<     unsplit, which, which.max, which.min
< 
  Running 'consistency-tests.R'
  Running 'fullShow.R'
 OK
** running tests for arch 'x64' ...
  Running 'benchmarking-tests.R'
  Comparing 'benchmarking-tests.Rout' to 'benchmarking-tests.Rout.save' ...13,35d12
< 
< 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, sd, var, xtabs
< 
< The following objects are masked from 'package:base':
< 
<     Filter, Find, Map, Position, Reduce, anyDuplicated, append,
<     as.data.frame, basename, cbind, colMeans, colSums, colnames,
<     dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
<     intersect, is.unsorted, lapply, mapply, match, mget, order, paste,
<     pmax, pmax.int, pmin, pmin.int, rank, rbind, rowMeans, rowSums,
<     rownames, sapply, setdiff, sort, table, tapply, union, unique,
<     unsplit, which, which.max, which.min
< 
  Running 'consistency-tests.R'
  Running 'fullShow.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: 1 WARNING, 1 NOTE
See
  'C:/Users/biocbuild/bbs-3.9-bioc/meat/genomeIntervals.Rcheck/00check.log'
for details.



Installation output

genomeIntervals.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\cygwin\bin\curl.exe -O https://malbec2.bioconductor.org/BBS/3.9/bioc/src/contrib/genomeIntervals_1.39.0.tar.gz && rm -rf genomeIntervals.buildbin-libdir && mkdir genomeIntervals.buildbin-libdir && C:\Users\biocbuild\bbs-3.9-bioc\R\bin\R.exe CMD INSTALL --merge-multiarch --build --library=genomeIntervals.buildbin-libdir genomeIntervals_1.39.0.tar.gz && C:\Users\biocbuild\bbs-3.9-bioc\R\bin\R.exe CMD INSTALL genomeIntervals_1.39.0.zip && rm genomeIntervals_1.39.0.tar.gz genomeIntervals_1.39.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
  0 38725    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 38725  100 38725    0     0   644k      0 --:--:-- --:--:-- --:--:--  713k

install for i386

* installing *source* package 'genomeIntervals' ...
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'genomeIntervals'
    finding HTML links ... done
    GenomeIntervals-constructor             html  
    Genome_intervals-class                  html  
    finding level-2 HTML links ... done

Rd warning: C:/Users/biocbuild/bbs-3.9-bioc/tmpdir/RtmpmWp1Kx/R.INSTALL1fa033c55489/genomeIntervals/man/Genome_intervals-class.Rd:110: file link 'width' in package 'IRanges' does not exist and so has been treated as a topic
    Genome_intervals-coercion-methods       html  
Rd warning: C:/Users/biocbuild/bbs-3.9-bioc/tmpdir/RtmpmWp1Kx/R.INSTALL1fa033c55489/genomeIntervals/man/Genome_intervals-coercion-methods.Rd:49: file link 'readGff3' in package 'genomeIntervals' does not exist and so has been treated as a topic
    Genome_intervals-deprecated             html  
    Genome_intervals-ordering               html  
    Genome_intervals_stranded-class         html  
    c.Genome_intervals                      html  
    core_annotated                          html  
    distance_to_nearest-methods             html  
    gen_ints                                html  
    genomeIntervals-package                 html  
    genomeIntervals-readGff3                html  
    getGffAttribute                         html  
    interval_overlap-methods                html  
    interval_set_operations-methods         html  
    parseGffAttributes                      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 'genomeIntervals' ...
** testing if installed package can be loaded
* MD5 sums
packaged installation of 'genomeIntervals' as genomeIntervals_1.39.0.zip
* DONE (genomeIntervals)
* installing to library 'C:/Users/biocbuild/bbs-3.9-bioc/R/library'
package 'genomeIntervals' successfully unpacked and MD5 sums checked

Tests output

genomeIntervals.Rcheck/tests_i386/benchmarking-tests.Rout.save


R version 2.12.1 (2010-12-16)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-apple-darwin9.8.0/x86_64 (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.

> # benchmarking tests
> # 
> # on modifications, regenerate .Rout.save with:
> # R --vanilla <./benchmarking-tests.R >& ./benchmarking-tests.Rout.save
> # and use svn' diff to check for differences
> #
> # Author: julien.gagneur
> ###############################################################################
> 
> library(genomeIntervals)
Loading required package: intervals
> source("fullShow.R")
> options(warn = -1)
> 
> #---------------
> # make data
> #---------------
> # toy examples
> data("gen_ints")
> 
> # non-stranded versions
> i0 = as(i, "Genome_intervals")
> j0 = as(j, "Genome_intervals")
> k0 = as(k, "Genome_intervals")
> 
> # empty intervals
> e = k[1:3,]
> e[,2] = e[,1]
> closed(e) = FALSE
> 
> #---------------
> # checks
> #---------------
> # distance to nearest
> cat("distance_to_nearest\n")
distance_to_nearest
> print( distance_to_nearest(i,j) )		# x
[1]  0  2  3  0  0  0 NA
> print( distance_to_nearest(j,i) )		# x
[1]  0  2 NA  0  0
> print( distance_to_nearest(i,k) )		# x
[1] 0.0 1.5 2.5 0.5 0.0 0.0  NA
> print( distance_to_nearest(i,e) )		# x
[1] NA NA NA NA NA NA NA
> print( distance_to_nearest(e,i) )		# x
[1] NA NA NA
> 
> print( distance_to_nearest(i0,j0) )		# x
[1]  0  0  1  0  0  0 NA
> print( distance_to_nearest(j0,i0) )		# x
[1] 0 2 0 0 0
> cat("\n")

> 
> # interval overlap
> cat("interval_overlap\n")
interval_overlap
> print( interval_overlap(i,k) )			# x
[[1]]
[1] 1

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
integer(0)

[[5]]
[1] 5

[[6]]
[1] 4

[[7]]
integer(0)

> print( interval_overlap(i,e) )			# x
[[1]]
integer(0)

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
integer(0)

[[5]]
integer(0)

[[6]]
integer(0)

[[7]]
integer(0)

> print( interval_overlap(i0,j0) )		# x
[[1]]
[1] 1

[[2]]
[1] 3

[[3]]
integer(0)

[[4]]
[1] 5

[[5]]
[1] 5

[[6]]
[1] 4 5

[[7]]
integer(0)

> cat("\n")

> 
> 
> # set operations
> cat("interval_union\n")
interval_union
> fullShow( close_intervals( interval_union(i) ) )		# x
Object of class Genome_intervals_stranded
4 base intervals and 0 inter-base intervals(*):
chr01 + [1, 4] 
chr02 + [4, 12] 
chr03 + [2, 5] 
chr02 - [5, 11] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr02      FALSE      +
3    chr03      FALSE      +
4    chr02      FALSE      -
> fullShow( close_intervals( interval_union(i,k) ) )		# x
Object of class Genome_intervals_stranded
6 base intervals and 2 inter-base intervals(*):
chr01 + [1, 4] 
chr01 + [6, 10] 
chr01 + [1, 1] *
chr02 + [4, 15] 
chr03 + [2, 5] 
chr01 - [4, 5] 
chr02 - [5, 11] 
chr02 - [8, 8] *
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01       TRUE      +
4    chr02      FALSE      +
5    chr03      FALSE      +
6    chr01      FALSE      -
7    chr02      FALSE      -
8    chr02       TRUE      -
> fullShow( close_intervals( interval_union(i0,k0) ) )	# x
Object of class Genome_intervals
3 base intervals and 2 inter-base intervals(*):
chr01 [1, 10] 
chr01 [1, 1] *
chr02 [4, 15] 
chr02 [8, 8] *
chr03 [2, 5] 
annotation:
  inter_base seq_name
1      FALSE    chr01
2       TRUE    chr01
3      FALSE    chr02
4       TRUE    chr02
5      FALSE    chr03
> fullShow( close_intervals( interval_union(e) ) )		# x
Object of class Genome_intervals_stranded
0 base intervals and 0 inter-base intervals(*):

annotation:
[1] seq_name   inter_base strand    
<0 rows> (or 0-length row.names)
> cat("\n")

> 
> cat("interval_intersection\n")
interval_intersection
> fullShow( close_intervals( interval_intersection(i,j) ) ) # x
Object of class Genome_intervals_stranded
3 base intervals and 0 inter-base intervals(*):
chr01 + [1, 1] 
chr02 - [8, 8] 
chr02 + [12, 12] 
annotation:
  inter_base seq_name strand
1      FALSE    chr01      +
2      FALSE    chr02      -
3      FALSE    chr02      +
> fullShow( close_intervals( interval_intersection(i,k) ) ) # x
Object of class Genome_intervals_stranded
1 base interval and 0 inter-base intervals(*):
chr02 + [12, 12] 
annotation:
  inter_base seq_name strand
1      FALSE    chr02      +
> fullShow( close_intervals( interval_intersection(i,e) ) ) # x
Object of class Genome_intervals_stranded
0 base intervals and 0 inter-base intervals(*):

annotation:
[1] inter_base seq_name   strand    
<0 rows> (or 0-length row.names)
> cat("\n")

> 
> cat("interval_complement\n")
interval_complement
> fullShow( close_intervals( interval_complement(j) ) )	# x
Object of class Genome_intervals_stranded
9 base intervals and 0 inter-base intervals(*):
chr01 + [-Inf, 0] 
chr01 + [2, 5] 
chr01 + [11, Inf] 
chr02 + [-Inf, 11] 
chr02 + [16, Inf] 
chr01 - [-Inf, 3] 
chr01 - [6, Inf] 
chr02 - [-Inf, 7] 
chr02 - [9, Inf] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01      FALSE      +
4    chr02      FALSE      +
5    chr02      FALSE      +
6    chr01      FALSE      -
7    chr01      FALSE      -
8    chr02      FALSE      -
9    chr02      FALSE      -
> fullShow( close_intervals( interval_complement(j0) ) )	# x
Object of class Genome_intervals
6 base intervals and 0 inter-base intervals(*):
chr01 [-Inf, 0] 
chr01 [2, 3] 
chr01 [11, Inf] 
chr02 [-Inf, 7] 
chr02 [9, 11] 
chr02 [16, Inf] 
annotation:
  inter_base seq_name
1      FALSE    chr01
2      FALSE    chr01
3      FALSE    chr01
4      FALSE    chr02
5      FALSE    chr02
6      FALSE    chr02
> fullShow( close_intervals( interval_complement(k) ) ) # x
Object of class Genome_intervals_stranded
7 base intervals and 6 inter-base intervals(*):
chr01 + [-Inf, 5] 
chr01 + [11, Inf] 
chr01 + [-Inf, 0] *
chr01 + [2, Inf] *
chr02 + [-Inf, 11] 
chr02 + [16, Inf] 
chr02 + [-Inf, Inf] *
chr01 - [-Inf, 3] 
chr01 - [6, Inf] 
chr01 - [-Inf, Inf] *
chr02 - [-Inf, Inf] 
chr02 - [-Inf, 7] *
chr02 - [9, Inf] *
annotation:
   seq_name inter_base strand
1     chr01      FALSE      +
2     chr01      FALSE      +
3     chr01       TRUE      +
4     chr01       TRUE      +
5     chr02      FALSE      +
6     chr02      FALSE      +
7     chr02       TRUE      +
8     chr01      FALSE      -
9     chr01      FALSE      -
10    chr01       TRUE      -
11    chr02      FALSE      -
12    chr02       TRUE      -
13    chr02       TRUE      -
> fullShow( close_intervals( interval_complement(e) ) ) # x
Object of class Genome_intervals_stranded
4 base intervals and 2 inter-base intervals(*):
chr01 + [-Inf, Inf] 
chr01 + [-Inf, Inf] *
chr02 + [-Inf, Inf] 
chr02 + [-Inf, Inf] *
chr01 - [-Inf, Inf] 
chr02 - [-Inf, Inf] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01       TRUE      +
3    chr02      FALSE      +
4    chr02       TRUE      +
5    chr01      FALSE      -
6    chr02      FALSE      -
> cat("\n")

> 
> 

genomeIntervals.Rcheck/tests_x64/benchmarking-tests.Rout.save


R version 2.12.1 (2010-12-16)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-apple-darwin9.8.0/x86_64 (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.

> # benchmarking tests
> # 
> # on modifications, regenerate .Rout.save with:
> # R --vanilla <./benchmarking-tests.R >& ./benchmarking-tests.Rout.save
> # and use svn' diff to check for differences
> #
> # Author: julien.gagneur
> ###############################################################################
> 
> library(genomeIntervals)
Loading required package: intervals
> source("fullShow.R")
> options(warn = -1)
> 
> #---------------
> # make data
> #---------------
> # toy examples
> data("gen_ints")
> 
> # non-stranded versions
> i0 = as(i, "Genome_intervals")
> j0 = as(j, "Genome_intervals")
> k0 = as(k, "Genome_intervals")
> 
> # empty intervals
> e = k[1:3,]
> e[,2] = e[,1]
> closed(e) = FALSE
> 
> #---------------
> # checks
> #---------------
> # distance to nearest
> cat("distance_to_nearest\n")
distance_to_nearest
> print( distance_to_nearest(i,j) )		# x
[1]  0  2  3  0  0  0 NA
> print( distance_to_nearest(j,i) )		# x
[1]  0  2 NA  0  0
> print( distance_to_nearest(i,k) )		# x
[1] 0.0 1.5 2.5 0.5 0.0 0.0  NA
> print( distance_to_nearest(i,e) )		# x
[1] NA NA NA NA NA NA NA
> print( distance_to_nearest(e,i) )		# x
[1] NA NA NA
> 
> print( distance_to_nearest(i0,j0) )		# x
[1]  0  0  1  0  0  0 NA
> print( distance_to_nearest(j0,i0) )		# x
[1] 0 2 0 0 0
> cat("\n")

> 
> # interval overlap
> cat("interval_overlap\n")
interval_overlap
> print( interval_overlap(i,k) )			# x
[[1]]
[1] 1

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
integer(0)

[[5]]
[1] 5

[[6]]
[1] 4

[[7]]
integer(0)

> print( interval_overlap(i,e) )			# x
[[1]]
integer(0)

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
integer(0)

[[5]]
integer(0)

[[6]]
integer(0)

[[7]]
integer(0)

> print( interval_overlap(i0,j0) )		# x
[[1]]
[1] 1

[[2]]
[1] 3

[[3]]
integer(0)

[[4]]
[1] 5

[[5]]
[1] 5

[[6]]
[1] 4 5

[[7]]
integer(0)

> cat("\n")

> 
> 
> # set operations
> cat("interval_union\n")
interval_union
> fullShow( close_intervals( interval_union(i) ) )		# x
Object of class Genome_intervals_stranded
4 base intervals and 0 inter-base intervals(*):
chr01 + [1, 4] 
chr02 + [4, 12] 
chr03 + [2, 5] 
chr02 - [5, 11] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr02      FALSE      +
3    chr03      FALSE      +
4    chr02      FALSE      -
> fullShow( close_intervals( interval_union(i,k) ) )		# x
Object of class Genome_intervals_stranded
6 base intervals and 2 inter-base intervals(*):
chr01 + [1, 4] 
chr01 + [6, 10] 
chr01 + [1, 1] *
chr02 + [4, 15] 
chr03 + [2, 5] 
chr01 - [4, 5] 
chr02 - [5, 11] 
chr02 - [8, 8] *
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01       TRUE      +
4    chr02      FALSE      +
5    chr03      FALSE      +
6    chr01      FALSE      -
7    chr02      FALSE      -
8    chr02       TRUE      -
> fullShow( close_intervals( interval_union(i0,k0) ) )	# x
Object of class Genome_intervals
3 base intervals and 2 inter-base intervals(*):
chr01 [1, 10] 
chr01 [1, 1] *
chr02 [4, 15] 
chr02 [8, 8] *
chr03 [2, 5] 
annotation:
  inter_base seq_name
1      FALSE    chr01
2       TRUE    chr01
3      FALSE    chr02
4       TRUE    chr02
5      FALSE    chr03
> fullShow( close_intervals( interval_union(e) ) )		# x
Object of class Genome_intervals_stranded
0 base intervals and 0 inter-base intervals(*):

annotation:
[1] seq_name   inter_base strand    
<0 rows> (or 0-length row.names)
> cat("\n")

> 
> cat("interval_intersection\n")
interval_intersection
> fullShow( close_intervals( interval_intersection(i,j) ) ) # x
Object of class Genome_intervals_stranded
3 base intervals and 0 inter-base intervals(*):
chr01 + [1, 1] 
chr02 - [8, 8] 
chr02 + [12, 12] 
annotation:
  inter_base seq_name strand
1      FALSE    chr01      +
2      FALSE    chr02      -
3      FALSE    chr02      +
> fullShow( close_intervals( interval_intersection(i,k) ) ) # x
Object of class Genome_intervals_stranded
1 base interval and 0 inter-base intervals(*):
chr02 + [12, 12] 
annotation:
  inter_base seq_name strand
1      FALSE    chr02      +
> fullShow( close_intervals( interval_intersection(i,e) ) ) # x
Object of class Genome_intervals_stranded
0 base intervals and 0 inter-base intervals(*):

annotation:
[1] inter_base seq_name   strand    
<0 rows> (or 0-length row.names)
> cat("\n")

> 
> cat("interval_complement\n")
interval_complement
> fullShow( close_intervals( interval_complement(j) ) )	# x
Object of class Genome_intervals_stranded
9 base intervals and 0 inter-base intervals(*):
chr01 + [-Inf, 0] 
chr01 + [2, 5] 
chr01 + [11, Inf] 
chr02 + [-Inf, 11] 
chr02 + [16, Inf] 
chr01 - [-Inf, 3] 
chr01 - [6, Inf] 
chr02 - [-Inf, 7] 
chr02 - [9, Inf] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01      FALSE      +
4    chr02      FALSE      +
5    chr02      FALSE      +
6    chr01      FALSE      -
7    chr01      FALSE      -
8    chr02      FALSE      -
9    chr02      FALSE      -
> fullShow( close_intervals( interval_complement(j0) ) )	# x
Object of class Genome_intervals
6 base intervals and 0 inter-base intervals(*):
chr01 [-Inf, 0] 
chr01 [2, 3] 
chr01 [11, Inf] 
chr02 [-Inf, 7] 
chr02 [9, 11] 
chr02 [16, Inf] 
annotation:
  inter_base seq_name
1      FALSE    chr01
2      FALSE    chr01
3      FALSE    chr01
4      FALSE    chr02
5      FALSE    chr02
6      FALSE    chr02
> fullShow( close_intervals( interval_complement(k) ) ) # x
Object of class Genome_intervals_stranded
7 base intervals and 6 inter-base intervals(*):
chr01 + [-Inf, 5] 
chr01 + [11, Inf] 
chr01 + [-Inf, 0] *
chr01 + [2, Inf] *
chr02 + [-Inf, 11] 
chr02 + [16, Inf] 
chr02 + [-Inf, Inf] *
chr01 - [-Inf, 3] 
chr01 - [6, Inf] 
chr01 - [-Inf, Inf] *
chr02 - [-Inf, Inf] 
chr02 - [-Inf, 7] *
chr02 - [9, Inf] *
annotation:
   seq_name inter_base strand
1     chr01      FALSE      +
2     chr01      FALSE      +
3     chr01       TRUE      +
4     chr01       TRUE      +
5     chr02      FALSE      +
6     chr02      FALSE      +
7     chr02       TRUE      +
8     chr01      FALSE      -
9     chr01      FALSE      -
10    chr01       TRUE      -
11    chr02      FALSE      -
12    chr02       TRUE      -
13    chr02       TRUE      -
> fullShow( close_intervals( interval_complement(e) ) ) # x
Object of class Genome_intervals_stranded
4 base intervals and 2 inter-base intervals(*):
chr01 + [-Inf, Inf] 
chr01 + [-Inf, Inf] *
chr02 + [-Inf, Inf] 
chr02 + [-Inf, Inf] *
chr01 - [-Inf, Inf] 
chr02 - [-Inf, Inf] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01       TRUE      +
3    chr02      FALSE      +
4    chr02       TRUE      +
5    chr01      FALSE      -
6    chr02      FALSE      -
> cat("\n")

> 
> 

genomeIntervals.Rcheck/tests_i386/consistency-tests.Rout


R Under development (unstable) (2019-03-09 r76216) -- "Unsuffered Consequences"
Copyright (C) 2019 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.

> # consistency test
> #
> # Author: julien.gagneur
> ###############################################################################
> 
> 
> library( genomeIntervals )
Loading required package: intervals
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, sd, var, xtabs

The following objects are masked from 'package:base':

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

> 
> options(warn = -1)
> 
> #---------
> # settings
> #---------
> # size of random objects
> n = 1e+3
> # chrom length
> l = 1e+3
> # nb of chroms
> k = 3
> 
> #---------
> # data generation
> #---------
> 
> randGenint = function(n,l,k){
+     m = matrix( sample(l, 2*n, replace=TRUE), nc = 2 )
+     m = cbind( apply( m, 1, min), apply( m, 1, max ) )
+ 
+     cl = matrix( sample( c(FALSE,TRUE), 2*n, replace =TRUE), nc=2 )
+     new(
+         "Genome_intervals_stranded",
+         m,
+         closed = cl,
+         annotation = data.frame(
+                 seq_name = paste("chr", sample(k, n, replace=TRUE) ),
+                 inter_base = sample( c(FALSE,TRUE), n, replace =TRUE),
+                 strand = sample(c("-", "+"), n, replace =TRUE)
+         )
+     )
+ }
> 
> i = randGenint(n,l,k)
> j = randGenint(n,l,k)
> i0 = as(i, "Genome_intervals")
> j0 = as(j, "Genome_intervals")
> 
> #---------
> # checks
> #---------
> 
> # distances from i to j
> dn = distance_to_nearest(i,j)
> 
> # distance is NA or >=0
> if( any( !is.na(dn) & dn < 0) ) stop("negative distance.")
> 
> # distance == 0 if and only if the interval overlaps another one:
> io = interval_overlap(i,j)
> if( any( ( sapply(io, length) >0 )  != (!is.na(dn) & dn ==0) ) )
+     stop("The property 'distance == 0 if and only if the interval overlaps another one' is not followed for at least one instance.")
> 
> # same test for not stranded objects
> dn0 = distance_to_nearest(i0,j0)
> if( any( !is.na(dn0) & dn0 < 0) ) stop("negative distance.")
> 
> io = interval_overlap(i0,j0)
> if( any( ( sapply(io, length) >0 )  != (!is.na(dn0) & dn0 ==0) ) )
+     stop("The property 'distance == 0 if and only if the interval overlaps another one' is not followed for at least one instance.")
> 
> # unstranded distance <= stranded distance
> delta = dn - dn0
> if( any(!is.na(delta)  & delta < 0) ) stop("some unstranded distance larger than a stranded one.")
> 
> # intersection with complement is empty
> stopifnot( nrow( interval_intersection(i, interval_complement(i) ) ) == 0 )
> 
> # distance of union with complement is 1
> # test must be done for not inter-base (or inter-base) independently
> a = interval_union(i[!inter_base(i),] )
> b = interval_complement(i[!inter_base(i),])
> 
> if(!(all.equal( distance_to_nearest( a, b ), rep(1, nrow(a) )  ) ) )
+     stop("distance of union with complement is not 1.")
> 
> # width is reported consistently
> # they should all be 4 in length (we alternate the open/closed state of the intervals
> # pairwise)
> gi <- GenomeIntervals(start=c(6,6,5,5),
+                       end=c(10,9,10,9),
+                       chromosome=rep("chr1",4),
+                       leftOpen = c(FALSE,FALSE,TRUE,TRUE),
+                       rightOpen=c(TRUE,FALSE,TRUE,FALSE))
> 
> stopifnot(all(width(gi)==4))
> 
> proc.time()
   user  system elapsed 
   4.54    0.28    4.79 

genomeIntervals.Rcheck/tests_x64/consistency-tests.Rout


R Under development (unstable) (2019-03-09 r76216) -- "Unsuffered Consequences"
Copyright (C) 2019 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.

> # consistency test
> #
> # Author: julien.gagneur
> ###############################################################################
> 
> 
> library( genomeIntervals )
Loading required package: intervals
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, sd, var, xtabs

The following objects are masked from 'package:base':

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

> 
> options(warn = -1)
> 
> #---------
> # settings
> #---------
> # size of random objects
> n = 1e+3
> # chrom length
> l = 1e+3
> # nb of chroms
> k = 3
> 
> #---------
> # data generation
> #---------
> 
> randGenint = function(n,l,k){
+     m = matrix( sample(l, 2*n, replace=TRUE), nc = 2 )
+     m = cbind( apply( m, 1, min), apply( m, 1, max ) )
+ 
+     cl = matrix( sample( c(FALSE,TRUE), 2*n, replace =TRUE), nc=2 )
+     new(
+         "Genome_intervals_stranded",
+         m,
+         closed = cl,
+         annotation = data.frame(
+                 seq_name = paste("chr", sample(k, n, replace=TRUE) ),
+                 inter_base = sample( c(FALSE,TRUE), n, replace =TRUE),
+                 strand = sample(c("-", "+"), n, replace =TRUE)
+         )
+     )
+ }
> 
> i = randGenint(n,l,k)
> j = randGenint(n,l,k)
> i0 = as(i, "Genome_intervals")
> j0 = as(j, "Genome_intervals")
> 
> #---------
> # checks
> #---------
> 
> # distances from i to j
> dn = distance_to_nearest(i,j)
> 
> # distance is NA or >=0
> if( any( !is.na(dn) & dn < 0) ) stop("negative distance.")
> 
> # distance == 0 if and only if the interval overlaps another one:
> io = interval_overlap(i,j)
> if( any( ( sapply(io, length) >0 )  != (!is.na(dn) & dn ==0) ) )
+     stop("The property 'distance == 0 if and only if the interval overlaps another one' is not followed for at least one instance.")
> 
> # same test for not stranded objects
> dn0 = distance_to_nearest(i0,j0)
> if( any( !is.na(dn0) & dn0 < 0) ) stop("negative distance.")
> 
> io = interval_overlap(i0,j0)
> if( any( ( sapply(io, length) >0 )  != (!is.na(dn0) & dn0 ==0) ) )
+     stop("The property 'distance == 0 if and only if the interval overlaps another one' is not followed for at least one instance.")
> 
> # unstranded distance <= stranded distance
> delta = dn - dn0
> if( any(!is.na(delta)  & delta < 0) ) stop("some unstranded distance larger than a stranded one.")
> 
> # intersection with complement is empty
> stopifnot( nrow( interval_intersection(i, interval_complement(i) ) ) == 0 )
> 
> # distance of union with complement is 1
> # test must be done for not inter-base (or inter-base) independently
> a = interval_union(i[!inter_base(i),] )
> b = interval_complement(i[!inter_base(i),])
> 
> if(!(all.equal( distance_to_nearest( a, b ), rep(1, nrow(a) )  ) ) )
+     stop("distance of union with complement is not 1.")
> 
> # width is reported consistently
> # they should all be 4 in length (we alternate the open/closed state of the intervals
> # pairwise)
> gi <- GenomeIntervals(start=c(6,6,5,5),
+                       end=c(10,9,10,9),
+                       chromosome=rep("chr1",4),
+                       leftOpen = c(FALSE,FALSE,TRUE,TRUE),
+                       rightOpen=c(TRUE,FALSE,TRUE,FALSE))
> 
> stopifnot(all(width(gi)==4))
> 
> proc.time()
   user  system elapsed 
   6.10    0.23    6.35 

genomeIntervals.Rcheck/tests_i386/fullShow.Rout


R Under development (unstable) (2019-03-09 r76216) -- "Unsuffered Consequences"
Copyright (C) 2019 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.

> # the fullShow methods is a show method for Genome_intervals objects.
> # It is called by test scripts so that the full output of the tests can be checked.  
> # 
> # Author: gagneur
> ###############################################################################
> 
> fullShow <- function(object ) {
+ 	cat(
+ 			"Object of class ",
+ 			class( object ),
+ 			"\n",
+ 			sum( !inter_base(object) ),
+ 			" base interval",
+ 			ifelse( sum( !inter_base(object) ) == 1, "", "s" ),
+ 			" and ",
+ 			sum( inter_base(object) ),
+ 			" inter-base interval",
+ 			ifelse( sum( inter_base(object) ) == 1, "", "s" ),
+ 			"(*)",
+ 			":\n",
+ 			sep = ""
+ 	)
+ 	ints <- as( object, "character")
+ 	if ( !is.null( rownames( object ) ) ) {
+ 		fmt <- sprintf( "%%%is", max( nchar( rownames( object ) ) ) )
+ 		ints <- paste( sprintf( fmt, rownames( object ) ), ints )
+ 	}
+ 	cat( ints, sep = "\n" )
+ 	cat( "annotation:\n")
+ 	show( annotation(object) )
+ }
> 
> 
> 
> 
> proc.time()
   user  system elapsed 
   0.18    0.04    0.21 

genomeIntervals.Rcheck/tests_x64/fullShow.Rout


R Under development (unstable) (2019-03-09 r76216) -- "Unsuffered Consequences"
Copyright (C) 2019 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.

> # the fullShow methods is a show method for Genome_intervals objects.
> # It is called by test scripts so that the full output of the tests can be checked.  
> # 
> # Author: gagneur
> ###############################################################################
> 
> fullShow <- function(object ) {
+ 	cat(
+ 			"Object of class ",
+ 			class( object ),
+ 			"\n",
+ 			sum( !inter_base(object) ),
+ 			" base interval",
+ 			ifelse( sum( !inter_base(object) ) == 1, "", "s" ),
+ 			" and ",
+ 			sum( inter_base(object) ),
+ 			" inter-base interval",
+ 			ifelse( sum( inter_base(object) ) == 1, "", "s" ),
+ 			"(*)",
+ 			":\n",
+ 			sep = ""
+ 	)
+ 	ints <- as( object, "character")
+ 	if ( !is.null( rownames( object ) ) ) {
+ 		fmt <- sprintf( "%%%is", max( nchar( rownames( object ) ) ) )
+ 		ints <- paste( sprintf( fmt, rownames( object ) ), ints )
+ 	}
+ 	cat( ints, sep = "\n" )
+ 	cat( "annotation:\n")
+ 	show( annotation(object) )
+ }
> 
> 
> 
> 
> proc.time()
   user  system elapsed 
   0.28    0.03    0.29 

genomeIntervals.Rcheck/tests_i386/benchmarking-tests.Rout


R Under development (unstable) (2019-03-09 r76216) -- "Unsuffered Consequences"
Copyright (C) 2019 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.

> # benchmarking tests
> # 
> # on modifications, regenerate .Rout.save with:
> # R --vanilla <./benchmarking-tests.R >& ./benchmarking-tests.Rout.save
> # and use svn' diff to check for differences
> #
> # Author: julien.gagneur
> ###############################################################################
> 
> library(genomeIntervals)
Loading required package: intervals
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, sd, var, xtabs

The following objects are masked from 'package:base':

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

> source("fullShow.R")
> options(warn = -1)
> 
> #---------------
> # make data
> #---------------
> # toy examples
> data("gen_ints")
> 
> # non-stranded versions
> i0 = as(i, "Genome_intervals")
> j0 = as(j, "Genome_intervals")
> k0 = as(k, "Genome_intervals")
> 
> # empty intervals
> e = k[1:3,]
> e[,2] = e[,1]
> closed(e) = FALSE
> 
> #---------------
> # checks
> #---------------
> # distance to nearest
> cat("distance_to_nearest\n")
distance_to_nearest
> print( distance_to_nearest(i,j) )		# x
[1]  0  2  3  0  0  0 NA
> print( distance_to_nearest(j,i) )		# x
[1]  0  2 NA  0  0
> print( distance_to_nearest(i,k) )		# x
[1] 0.0 1.5 2.5 0.5 0.0 0.0  NA
> print( distance_to_nearest(i,e) )		# x
[1] NA NA NA NA NA NA NA
> print( distance_to_nearest(e,i) )		# x
[1] NA NA NA
> 
> print( distance_to_nearest(i0,j0) )		# x
[1]  0  0  1  0  0  0 NA
> print( distance_to_nearest(j0,i0) )		# x
[1] 0 2 0 0 0
> cat("\n")

> 
> # interval overlap
> cat("interval_overlap\n")
interval_overlap
> print( interval_overlap(i,k) )			# x
[[1]]
[1] 1

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
integer(0)

[[5]]
[1] 5

[[6]]
[1] 4

[[7]]
integer(0)

> print( interval_overlap(i,e) )			# x
[[1]]
integer(0)

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
integer(0)

[[5]]
integer(0)

[[6]]
integer(0)

[[7]]
integer(0)

> print( interval_overlap(i0,j0) )		# x
[[1]]
[1] 1

[[2]]
[1] 3

[[3]]
integer(0)

[[4]]
[1] 5

[[5]]
[1] 5

[[6]]
[1] 4 5

[[7]]
integer(0)

> cat("\n")

> 
> 
> # set operations
> cat("interval_union\n")
interval_union
> fullShow( close_intervals( interval_union(i) ) )		# x
Object of class Genome_intervals_stranded
4 base intervals and 0 inter-base intervals(*):
chr01 + [1, 4] 
chr02 + [4, 12] 
chr03 + [2, 5] 
chr02 - [5, 11] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr02      FALSE      +
3    chr03      FALSE      +
4    chr02      FALSE      -
> fullShow( close_intervals( interval_union(i,k) ) )		# x
Object of class Genome_intervals_stranded
6 base intervals and 2 inter-base intervals(*):
chr01 + [1, 4] 
chr01 + [6, 10] 
chr01 + [1, 1] *
chr02 + [4, 15] 
chr03 + [2, 5] 
chr01 - [4, 5] 
chr02 - [5, 11] 
chr02 - [8, 8] *
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01       TRUE      +
4    chr02      FALSE      +
5    chr03      FALSE      +
6    chr01      FALSE      -
7    chr02      FALSE      -
8    chr02       TRUE      -
> fullShow( close_intervals( interval_union(i0,k0) ) )	# x
Object of class Genome_intervals
3 base intervals and 2 inter-base intervals(*):
chr01 [1, 10] 
chr01 [1, 1] *
chr02 [4, 15] 
chr02 [8, 8] *
chr03 [2, 5] 
annotation:
  inter_base seq_name
1      FALSE    chr01
2       TRUE    chr01
3      FALSE    chr02
4       TRUE    chr02
5      FALSE    chr03
> fullShow( close_intervals( interval_union(e) ) )		# x
Object of class Genome_intervals_stranded
0 base intervals and 0 inter-base intervals(*):

annotation:
[1] seq_name   inter_base strand    
<0 rows> (or 0-length row.names)
> cat("\n")

> 
> cat("interval_intersection\n")
interval_intersection
> fullShow( close_intervals( interval_intersection(i,j) ) ) # x
Object of class Genome_intervals_stranded
3 base intervals and 0 inter-base intervals(*):
chr01 + [1, 1] 
chr02 - [8, 8] 
chr02 + [12, 12] 
annotation:
  inter_base seq_name strand
1      FALSE    chr01      +
2      FALSE    chr02      -
3      FALSE    chr02      +
> fullShow( close_intervals( interval_intersection(i,k) ) ) # x
Object of class Genome_intervals_stranded
1 base interval and 0 inter-base intervals(*):
chr02 + [12, 12] 
annotation:
  inter_base seq_name strand
1      FALSE    chr02      +
> fullShow( close_intervals( interval_intersection(i,e) ) ) # x
Object of class Genome_intervals_stranded
0 base intervals and 0 inter-base intervals(*):

annotation:
[1] inter_base seq_name   strand    
<0 rows> (or 0-length row.names)
> cat("\n")

> 
> cat("interval_complement\n")
interval_complement
> fullShow( close_intervals( interval_complement(j) ) )	# x
Object of class Genome_intervals_stranded
9 base intervals and 0 inter-base intervals(*):
chr01 + [-Inf, 0] 
chr01 + [2, 5] 
chr01 + [11, Inf] 
chr02 + [-Inf, 11] 
chr02 + [16, Inf] 
chr01 - [-Inf, 3] 
chr01 - [6, Inf] 
chr02 - [-Inf, 7] 
chr02 - [9, Inf] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01      FALSE      +
4    chr02      FALSE      +
5    chr02      FALSE      +
6    chr01      FALSE      -
7    chr01      FALSE      -
8    chr02      FALSE      -
9    chr02      FALSE      -
> fullShow( close_intervals( interval_complement(j0) ) )	# x
Object of class Genome_intervals
6 base intervals and 0 inter-base intervals(*):
chr01 [-Inf, 0] 
chr01 [2, 3] 
chr01 [11, Inf] 
chr02 [-Inf, 7] 
chr02 [9, 11] 
chr02 [16, Inf] 
annotation:
  inter_base seq_name
1      FALSE    chr01
2      FALSE    chr01
3      FALSE    chr01
4      FALSE    chr02
5      FALSE    chr02
6      FALSE    chr02
> fullShow( close_intervals( interval_complement(k) ) ) # x
Object of class Genome_intervals_stranded
7 base intervals and 6 inter-base intervals(*):
chr01 + [-Inf, 5] 
chr01 + [11, Inf] 
chr01 + [-Inf, 0] *
chr01 + [2, Inf] *
chr02 + [-Inf, 11] 
chr02 + [16, Inf] 
chr02 + [-Inf, Inf] *
chr01 - [-Inf, 3] 
chr01 - [6, Inf] 
chr01 - [-Inf, Inf] *
chr02 - [-Inf, Inf] 
chr02 - [-Inf, 7] *
chr02 - [9, Inf] *
annotation:
   seq_name inter_base strand
1     chr01      FALSE      +
2     chr01      FALSE      +
3     chr01       TRUE      +
4     chr01       TRUE      +
5     chr02      FALSE      +
6     chr02      FALSE      +
7     chr02       TRUE      +
8     chr01      FALSE      -
9     chr01      FALSE      -
10    chr01       TRUE      -
11    chr02      FALSE      -
12    chr02       TRUE      -
13    chr02       TRUE      -
> fullShow( close_intervals( interval_complement(e) ) ) # x
Object of class Genome_intervals_stranded
4 base intervals and 2 inter-base intervals(*):
chr01 + [-Inf, Inf] 
chr01 + [-Inf, Inf] *
chr02 + [-Inf, Inf] 
chr02 + [-Inf, Inf] *
chr01 - [-Inf, Inf] 
chr02 - [-Inf, Inf] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01       TRUE      +
3    chr02      FALSE      +
4    chr02       TRUE      +
5    chr01      FALSE      -
6    chr02      FALSE      -
> cat("\n")

> 
> 
> proc.time()
   user  system elapsed 
   4.78    0.25    5.01 

genomeIntervals.Rcheck/tests_x64/benchmarking-tests.Rout


R Under development (unstable) (2019-03-09 r76216) -- "Unsuffered Consequences"
Copyright (C) 2019 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.

> # benchmarking tests
> # 
> # on modifications, regenerate .Rout.save with:
> # R --vanilla <./benchmarking-tests.R >& ./benchmarking-tests.Rout.save
> # and use svn' diff to check for differences
> #
> # Author: julien.gagneur
> ###############################################################################
> 
> library(genomeIntervals)
Loading required package: intervals
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, sd, var, xtabs

The following objects are masked from 'package:base':

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

> source("fullShow.R")
> options(warn = -1)
> 
> #---------------
> # make data
> #---------------
> # toy examples
> data("gen_ints")
> 
> # non-stranded versions
> i0 = as(i, "Genome_intervals")
> j0 = as(j, "Genome_intervals")
> k0 = as(k, "Genome_intervals")
> 
> # empty intervals
> e = k[1:3,]
> e[,2] = e[,1]
> closed(e) = FALSE
> 
> #---------------
> # checks
> #---------------
> # distance to nearest
> cat("distance_to_nearest\n")
distance_to_nearest
> print( distance_to_nearest(i,j) )		# x
[1]  0  2  3  0  0  0 NA
> print( distance_to_nearest(j,i) )		# x
[1]  0  2 NA  0  0
> print( distance_to_nearest(i,k) )		# x
[1] 0.0 1.5 2.5 0.5 0.0 0.0  NA
> print( distance_to_nearest(i,e) )		# x
[1] NA NA NA NA NA NA NA
> print( distance_to_nearest(e,i) )		# x
[1] NA NA NA
> 
> print( distance_to_nearest(i0,j0) )		# x
[1]  0  0  1  0  0  0 NA
> print( distance_to_nearest(j0,i0) )		# x
[1] 0 2 0 0 0
> cat("\n")

> 
> # interval overlap
> cat("interval_overlap\n")
interval_overlap
> print( interval_overlap(i,k) )			# x
[[1]]
[1] 1

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
integer(0)

[[5]]
[1] 5

[[6]]
[1] 4

[[7]]
integer(0)

> print( interval_overlap(i,e) )			# x
[[1]]
integer(0)

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
integer(0)

[[5]]
integer(0)

[[6]]
integer(0)

[[7]]
integer(0)

> print( interval_overlap(i0,j0) )		# x
[[1]]
[1] 1

[[2]]
[1] 3

[[3]]
integer(0)

[[4]]
[1] 5

[[5]]
[1] 5

[[6]]
[1] 4 5

[[7]]
integer(0)

> cat("\n")

> 
> 
> # set operations
> cat("interval_union\n")
interval_union
> fullShow( close_intervals( interval_union(i) ) )		# x
Object of class Genome_intervals_stranded
4 base intervals and 0 inter-base intervals(*):
chr01 + [1, 4] 
chr02 + [4, 12] 
chr03 + [2, 5] 
chr02 - [5, 11] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr02      FALSE      +
3    chr03      FALSE      +
4    chr02      FALSE      -
> fullShow( close_intervals( interval_union(i,k) ) )		# x
Object of class Genome_intervals_stranded
6 base intervals and 2 inter-base intervals(*):
chr01 + [1, 4] 
chr01 + [6, 10] 
chr01 + [1, 1] *
chr02 + [4, 15] 
chr03 + [2, 5] 
chr01 - [4, 5] 
chr02 - [5, 11] 
chr02 - [8, 8] *
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01       TRUE      +
4    chr02      FALSE      +
5    chr03      FALSE      +
6    chr01      FALSE      -
7    chr02      FALSE      -
8    chr02       TRUE      -
> fullShow( close_intervals( interval_union(i0,k0) ) )	# x
Object of class Genome_intervals
3 base intervals and 2 inter-base intervals(*):
chr01 [1, 10] 
chr01 [1, 1] *
chr02 [4, 15] 
chr02 [8, 8] *
chr03 [2, 5] 
annotation:
  inter_base seq_name
1      FALSE    chr01
2       TRUE    chr01
3      FALSE    chr02
4       TRUE    chr02
5      FALSE    chr03
> fullShow( close_intervals( interval_union(e) ) )		# x
Object of class Genome_intervals_stranded
0 base intervals and 0 inter-base intervals(*):

annotation:
[1] seq_name   inter_base strand    
<0 rows> (or 0-length row.names)
> cat("\n")

> 
> cat("interval_intersection\n")
interval_intersection
> fullShow( close_intervals( interval_intersection(i,j) ) ) # x
Object of class Genome_intervals_stranded
3 base intervals and 0 inter-base intervals(*):
chr01 + [1, 1] 
chr02 - [8, 8] 
chr02 + [12, 12] 
annotation:
  inter_base seq_name strand
1      FALSE    chr01      +
2      FALSE    chr02      -
3      FALSE    chr02      +
> fullShow( close_intervals( interval_intersection(i,k) ) ) # x
Object of class Genome_intervals_stranded
1 base interval and 0 inter-base intervals(*):
chr02 + [12, 12] 
annotation:
  inter_base seq_name strand
1      FALSE    chr02      +
> fullShow( close_intervals( interval_intersection(i,e) ) ) # x
Object of class Genome_intervals_stranded
0 base intervals and 0 inter-base intervals(*):

annotation:
[1] inter_base seq_name   strand    
<0 rows> (or 0-length row.names)
> cat("\n")

> 
> cat("interval_complement\n")
interval_complement
> fullShow( close_intervals( interval_complement(j) ) )	# x
Object of class Genome_intervals_stranded
9 base intervals and 0 inter-base intervals(*):
chr01 + [-Inf, 0] 
chr01 + [2, 5] 
chr01 + [11, Inf] 
chr02 + [-Inf, 11] 
chr02 + [16, Inf] 
chr01 - [-Inf, 3] 
chr01 - [6, Inf] 
chr02 - [-Inf, 7] 
chr02 - [9, Inf] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01      FALSE      +
4    chr02      FALSE      +
5    chr02      FALSE      +
6    chr01      FALSE      -
7    chr01      FALSE      -
8    chr02      FALSE      -
9    chr02      FALSE      -
> fullShow( close_intervals( interval_complement(j0) ) )	# x
Object of class Genome_intervals
6 base intervals and 0 inter-base intervals(*):
chr01 [-Inf, 0] 
chr01 [2, 3] 
chr01 [11, Inf] 
chr02 [-Inf, 7] 
chr02 [9, 11] 
chr02 [16, Inf] 
annotation:
  inter_base seq_name
1      FALSE    chr01
2      FALSE    chr01
3      FALSE    chr01
4      FALSE    chr02
5      FALSE    chr02
6      FALSE    chr02
> fullShow( close_intervals( interval_complement(k) ) ) # x
Object of class Genome_intervals_stranded
7 base intervals and 6 inter-base intervals(*):
chr01 + [-Inf, 5] 
chr01 + [11, Inf] 
chr01 + [-Inf, 0] *
chr01 + [2, Inf] *
chr02 + [-Inf, 11] 
chr02 + [16, Inf] 
chr02 + [-Inf, Inf] *
chr01 - [-Inf, 3] 
chr01 - [6, Inf] 
chr01 - [-Inf, Inf] *
chr02 - [-Inf, Inf] 
chr02 - [-Inf, 7] *
chr02 - [9, Inf] *
annotation:
   seq_name inter_base strand
1     chr01      FALSE      +
2     chr01      FALSE      +
3     chr01       TRUE      +
4     chr01       TRUE      +
5     chr02      FALSE      +
6     chr02      FALSE      +
7     chr02       TRUE      +
8     chr01      FALSE      -
9     chr01      FALSE      -
10    chr01       TRUE      -
11    chr02      FALSE      -
12    chr02       TRUE      -
13    chr02       TRUE      -
> fullShow( close_intervals( interval_complement(e) ) ) # x
Object of class Genome_intervals_stranded
4 base intervals and 2 inter-base intervals(*):
chr01 + [-Inf, Inf] 
chr01 + [-Inf, Inf] *
chr02 + [-Inf, Inf] 
chr02 + [-Inf, Inf] *
chr01 - [-Inf, Inf] 
chr02 - [-Inf, Inf] 
annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01       TRUE      +
3    chr02      FALSE      +
4    chr02       TRUE      +
5    chr01      FALSE      -
6    chr02      FALSE      -
> cat("\n")

> 
> 
> proc.time()
   user  system elapsed 
   5.51    0.20    5.70 

Example timings

genomeIntervals.Rcheck/examples_i386/genomeIntervals-Ex.timings

nameusersystemelapsed
GenomeIntervals-constructor0.080.000.07
Genome_intervals-class0.030.000.04
Genome_intervals-coercion-methods000
Genome_intervals-ordering0.050.000.04
Genome_intervals_stranded-class0.080.000.08
c.Genome_intervals0.090.020.11
core_annotated0.080.000.07
distance_to_nearest-methods0.290.000.32
genomeIntervals-readGff31.60.92.5
getGffAttribute0.080.000.07
interval_overlap-methods0.100.020.13
interval_set_operations-methods0.430.000.42
parseGffAttributes0.040.000.05

genomeIntervals.Rcheck/examples_x64/genomeIntervals-Ex.timings

nameusersystemelapsed
GenomeIntervals-constructor0.080.000.08
Genome_intervals-class0.030.000.03
Genome_intervals-coercion-methods000
Genome_intervals-ordering0.040.000.04
Genome_intervals_stranded-class0.050.000.05
c.Genome_intervals0.060.010.08
core_annotated0.070.000.06
distance_to_nearest-methods0.220.000.22
genomeIntervals-readGff31.010.611.62
getGffAttribute0.050.020.07
interval_overlap-methods0.090.000.09
interval_set_operations-methods0.580.000.58
parseGffAttributes0.050.000.04