Back to Multiple platform build/check report for BioC 3.6
AB[C]DEFGHIJKLMNOPQRSTUVWXYZ

CHECK report for csaw on tokay1

This page was generated on 2018-04-12 13:25:13 -0400 (Thu, 12 Apr 2018).

Package 314/1472HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
csaw 1.12.0
Aaron Lun
Snapshot Date: 2018-04-11 16:45:18 -0400 (Wed, 11 Apr 2018)
URL: https://git.bioconductor.org/packages/csaw
Branch: RELEASE_3_6
Last Commit: c9f2f1a
Last Changed Date: 2017-10-30 12:40:43 -0400 (Mon, 30 Oct 2017)
malbec1 Linux (Ubuntu 16.04.1 LTS) / x86_64  OK  OK  OK UNNEEDED, same version exists in internal repository
tokay1 Windows Server 2012 R2 Standard / x64  OK  OK [ OK ] OK UNNEEDED, same version exists in internal repository
veracruz1 OS X 10.11.6 El Capitan / x86_64  OK  OK  OK  OK UNNEEDED, same version exists in internal repository

Summary

Package: csaw
Version: 1.12.0
Command: rm -rf csaw.buildbin-libdir csaw.Rcheck && mkdir csaw.buildbin-libdir csaw.Rcheck && C:\Users\biocbuild\bbs-3.6-bioc\R\bin\R.exe CMD INSTALL --build --merge-multiarch --library=csaw.buildbin-libdir csaw_1.12.0.tar.gz >csaw.Rcheck\00install.out 2>&1 && cp csaw.Rcheck\00install.out csaw-install.out && C:\Users\biocbuild\bbs-3.6-bioc\R\bin\R.exe CMD check --library=csaw.buildbin-libdir --install="check:csaw-install.out" --force-multiarch --no-vignettes --timings csaw_1.12.0.tar.gz
StartedAt: 2018-04-11 23:17:32 -0400 (Wed, 11 Apr 2018)
EndedAt: 2018-04-11 23:26:25 -0400 (Wed, 11 Apr 2018)
EllapsedTime: 532.8 seconds
RetCode: 0
Status:  OK  
CheckDir: csaw.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   rm -rf csaw.buildbin-libdir csaw.Rcheck && mkdir csaw.buildbin-libdir csaw.Rcheck && C:\Users\biocbuild\bbs-3.6-bioc\R\bin\R.exe CMD INSTALL --build --merge-multiarch --library=csaw.buildbin-libdir csaw_1.12.0.tar.gz >csaw.Rcheck\00install.out 2>&1 && cp csaw.Rcheck\00install.out csaw-install.out  &&  C:\Users\biocbuild\bbs-3.6-bioc\R\bin\R.exe CMD check --library=csaw.buildbin-libdir --install="check:csaw-install.out" --force-multiarch --no-vignettes --timings csaw_1.12.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'C:/Users/biocbuild/bbs-3.6-bioc/meat/csaw.Rcheck'
* using R version 3.4.4 (2018-03-15)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using option '--no-vignettes'
* checking for file 'csaw/DESCRIPTION' ... OK
* this is package 'csaw' version '1.12.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 'csaw' 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 ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* 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 line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for GNU extensions in Makefiles ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... NOTE
Note: information on .o files for i386 is not available
Note: information on .o files for x64 is not available
File 'C:/Users/biocbuild/bbs-3.6-bioc/meat/csaw.buildbin-libdir/csaw/libs/i386/csaw.dll':
  Found '_exit', possibly from '_exit' (C)
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
  Found 'exit', possibly from 'exit' (C), 'stop' (Fortran)
  Found 'printf', possibly from 'printf' (C)
  Found 'putchar', possibly from 'putchar' (C)
  Found 'puts', possibly from 'printf' (C), 'puts' (C)
  Found 'rand', possibly from 'rand' (C)

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs. The detected symbols are linked into the code but
might come from libraries and not actually be called.

See 'Writing portable packages' in the 'Writing R Extensions' manual.
* checking installed files from 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ...
** running examples for arch 'i386' ... OK
Examples with CPU or elapsed time > 5s
              user system elapsed
detailRanges 10.61   0.38   10.99
** running examples for arch 'x64' ... OK
Examples with CPU or elapsed time > 5s
              user system elapsed
detailRanges 13.97   0.25   14.22
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
** running tests for arch 'i386' ...
  Running 'test-basic.R'
  Comparing 'test-basic.Rout' to 'test-basic.Rout.save' ...255,258d254
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
261,264d256
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
267,270d258
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
296,299d283
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
308,311d291
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
Warning message:
running command '"diff" -bw "C:\Users\biocbuild\bbs-3.6-bioc\tmpdir\RtmpUJl7e5\Rdiffa261c6f84c62" "C:\Users\biocbuild\bbs-3.6-bioc\tmpdir\RtmpUJl7e5\Rdiffb261c5d887196"' had status 1 
 OK
** running tests for arch 'x64' ...
  Running 'test-basic.R'
  Comparing 'test-basic.Rout' to 'test-basic.Rout.save' ...255,258d254
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
261,264d256
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
267,270d258
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
296,299d283
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
308,311d291
< Warning message:
< 'se.out=NULL' is deprecated.
< Use 'se.out=TRUE' instead.
< See help("Deprecated") 
Warning message:
running command '"diff" -bw "C:\Users\biocbuild\bbs-3.6-bioc\tmpdir\RtmpcRu9AT\Rdiffac1454621bc5" "C:\Users\biocbuild\bbs-3.6-bioc\tmpdir\RtmpcRu9AT\Rdiffbc1470532e6d"' had status 1 
 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 NOTE
See
  'C:/Users/biocbuild/bbs-3.6-bioc/meat/csaw.Rcheck/00check.log'
for details.



Installation output

csaw.Rcheck/00install.out


install for i386

* installing *source* package 'csaw' ...
** libs
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c annotator.cpp -o annotator.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c bam_utils.cpp -o bam_utils.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c best_in_cluster.cpp -o best_in_cluster.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c check_bimodality.cpp -o check_bimodality.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c correlate_reads.cpp -o correlate_reads.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c find_maxima.cpp -o find_maxima.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c get_cluster_stats.cpp -o get_cluster_stats.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c get_profile.cpp -o get_profile.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c get_rle_counts.cpp -o get_rle_counts.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c init.cpp -o init.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c merge_windows.cpp -o merge_windows.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c pair_reads.cpp -o pair_reads.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c single_reads.cpp -o single_reads.o
C:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c utils.cpp -o utils.o
C:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o csaw.dll tmp.def annotator.o bam_utils.o best_in_cluster.o check_bimodality.o correlate_reads.o find_maxima.o get_cluster_stats.o get_profile.o get_rle_counts.o init.o merge_windows.o pair_reads.o single_reads.o utils.o -LC:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/lib/i386 -lhts -lz -pthread -lws2_32 -LC:/local323/lib/i386 -LC:/local323/lib -LC:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/bin/i386 -lR
installing to C:/Users/biocbuild/bbs-3.6-bioc/meat/csaw.buildbin-libdir/csaw/libs/i386
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
  converting help for package 'csaw'
    finding HTML links ... done
    SEmethods                               html  
    finding level-2 HTML links ... done

    checkBimodality                         html  
    clusterFDR                              html  
    clusterWindows                          html  
    combineTests                            html  
    consolidateClusters                     html  
    consolidateSizes                        html  
    correlateReads                          html  
    csawUsersGuide                          html  
    detailRanges                            html  
    empiricalFDR                            html  
    extractReads                            html  
    filterWindows                           html  
    findMaxima                              html  
    getBestTest                             html  
    getPESizes                              html  
    getWidths                               html  
    maximizeCcf                             html  
    mergeWindows                            html  
    mixedClusters                           html  
    normOffsets                             html  
    overlapStats                            html  
    profileSites                            html  
    readParam                               html  
    regionCounts                            html  
    scaledAverage                           html  
    strandedCounts                          html  
    upweightSummit                          html  
    windowCounts                            html  
    wwhm                                    html  
** building package indices
** installing vignettes
** testing if installed package can be loaded
In R CMD INSTALL

install for x64

* installing *source* package 'csaw' ...
** libs
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c annotator.cpp -o annotator.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c bam_utils.cpp -o bam_utils.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c best_in_cluster.cpp -o best_in_cluster.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c check_bimodality.cpp -o check_bimodality.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c correlate_reads.cpp -o correlate_reads.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c find_maxima.cpp -o find_maxima.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c get_cluster_stats.cpp -o get_cluster_stats.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c get_profile.cpp -o get_profile.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c get_rle_counts.cpp -o get_rle_counts.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c init.cpp -o init.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c merge_windows.cpp -o merge_windows.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c pair_reads.cpp -o pair_reads.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c single_reads.cpp -o single_reads.o
C:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/include" -DNDEBUG  -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/zlibbioc/include" -I"C:/Users/biocbuild/bbs-3.6-bioc/R/library/Rcpp/include"   -I"C:/local323/include"     -O2 -Wall  -mtune=generic -c utils.cpp -o utils.o
C:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o csaw.dll tmp.def annotator.o bam_utils.o best_in_cluster.o check_bimodality.o correlate_reads.o find_maxima.o get_cluster_stats.o get_profile.o get_rle_counts.o init.o merge_windows.o pair_reads.o single_reads.o utils.o -LC:/Users/biocbuild/bbs-3.6-bioc/R/library/Rhtslib/lib/x64 -lhts -lz -pthread -lws2_32 -LC:/local323/lib/x64 -LC:/local323/lib -LC:/Users/BIOCBU˜1/BBS-3˜1.6-B/R/bin/x64 -lR
installing to C:/Users/biocbuild/bbs-3.6-bioc/meat/csaw.buildbin-libdir/csaw/libs/x64
** testing if installed package can be loaded
* MD5 sums
packaged installation of 'csaw' as csaw_1.12.0.zip
* DONE (csaw)
In R CMD INSTALL
In R CMD INSTALL

Tests output

csaw.Rcheck/tests_i386/test-basic.Rout.save


R Under development (unstable) (2016-10-17 r71531) -- "Unsuffered Consequences"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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

  Natural language support but running in an English locale

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

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

> # This is a testing stub that just provides a basic run-through of all the methods.
> # The real tests are located in inst/tests along with a Bash script for execution
> # and comparison. The separation into two folders is necessary to keep R CMD check
> # running with reasonable speed.
> 
> suppressWarnings(suppressPackageStartupMessages(require(csaw)))
> both.files <- system.file("exdata", c("rep1.bam", "rep2.bam"), package="csaw")
> pe.file <- system.file("exdata", "pet.bam", package="csaw")
> 
> # Checking data quality prior to counting.
> head(correlateReads(both.files))
[1] -0.0137654663  0.0005571408  0.0175021237 -0.0308470292 -0.0087488234
[6] -0.0120687468
> head(correlateReads(both.files, cross=FALSE))
[1]  1.0000000000 -0.0008601215  0.0170688852 -0.0475443596  0.0028128511
[6] -0.0030687197
> 
> getPESizes(pe.file)
$sizes
[1]  70  90  20 150  10  30  10   2

$diagnostics
  total.reads  mapped.reads        single mate.unmapped    unoriented 
           23            23             3             0             1 
    inter.chr 
            1 

> 
> # Trying to count some single-end data.
> data <- windowCounts(both.files, ext=100)
> head(assay(data))
     [,1] [,2]
[1,]   43   71
[2,]   57   89
[3,]   56  120
[4,]   53  141
[5,]   40  152
[6,]   59  135
> rowRanges(data)
GRanges object with 71 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 100]      *
   [3]     chrA   [101, 150]      *
   [4]     chrA   [151, 200]      *
   [5]     chrA   [201, 250]      *
   ...      ...          ...    ...
  [67]     chrC [1101, 1150]      *
  [68]     chrC [1151, 1200]      *
  [69]     chrC [1201, 1250]      *
  [70]     chrC [1251, 1300]      *
  [71]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome
> data$totals
[1] 1349 3291
> 
> data <- windowCounts(both.files, width=500, spacing=200)
> head(assay(data))
     [,1] [,2]
[1,]  204  455
[2,]  195  510
[3,]  186  483
[4,]  200  501
[5,]  187  468
[6,]  127  311
> rowRanges(data)
GRanges object with 19 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA  [  1,  500]      *
   [2]     chrA  [201,  700]      *
   [3]     chrA  [401,  900]      *
   [4]     chrA  [601, 1100]      *
   [5]     chrA  [801, 1298]      *
   ...      ...          ...    ...
  [15]     chrC [ 401,  900]      *
  [16]     chrC [ 601, 1100]      *
  [17]     chrC [ 801, 1300]      *
  [18]     chrC [1001, 1345]      *
  [19]     chrC [1201, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome
> data$totals
[1] 1349 3291
> 
> data <- windowCounts(both.files, ext=100, param=readParam(minq=100))
> data$totals
[1]  914 2152
> data <- windowCounts(both.files, ext=100, param=readParam(dedup=TRUE))
> data$totals
[1] 1056 2582
> data <- windowCounts(both.files, ext=100, param=readParam(discard=GRanges("chrA", IRanges(50, 500))))
> data$totals
[1] 1186 2916
> data <- windowCounts(both.files, ext=100, param=readParam(restrict="chrA"))
> data$totals
[1]  451 1093
> 
> # Trying to count some paired-end data.
> out <- windowCounts(pe.file, param=readParam(pe="both"), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    3
[2,]    4
[3,]    2
[4,]    1
[5,]    4
[6,]    3
> out$totals
[1] 8
> rowRanges(out)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrA [151, 200]      *
  [5]     chrB [  1, 100]      *
  [6]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> out <- windowCounts(pe.file, param=readParam(pe="both", max.frag=100), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    2
[2,]    3
[3,]    1
[4,]    4
[5,]    3
> out$totals
[1] 7
> rowRanges(out)
GRanges object with 5 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrB [  1, 100]      *
  [5]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> out <- windowCounts(pe.file, param=readParam(pe="first"), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    3
[2,]    4
[3,]    4
[4,]    2
[5,]    6
[6,]    6
> out$totals
[1] 10
> rowRanges(out)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrA [151, 200]      *
  [5]     chrB [  1, 100]      *
  [6]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> 
> # Trying to convert it to a DGEList.
> asDGEList(data)
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1      451            1
Sample2     1     1093            1

> asDGEList(data, lib.size=c(10, 10))
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1       10            1
Sample2     1       10            1

> asDGEList(data, norm=c(1,2))
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1      451            1
Sample2     1     1093            2

> 
> temp <- data 
> temp$totals <- NULL 
> asDGEList(temp) # Should spit out a warning.
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1     1293            1
Sample2     1     3142            1

Warning message:
In .local(object, ...) :
  library sizes not found in 'totals', setting to NULL
> 
> # Running some basic normalization.
> data <- windowCounts(both.files, ext=100, param=readParam(minq=100, dedup=TRUE))
> 
> normOffsets(assay(data), lib.size=data$totals)
[1] 1.001197 0.998804
> normOffsets(assay(data), lib.size=data$totals, logratioTrim=.2)
[1] 1.003816 0.996199
> normOffsets(assay(data), lib.size=data$totals, method="RLE")
[1] 1.0037890 0.9962253
> normOffsets(data)
[1] 1.001197 0.998804
> normOffsets(data, logratioTrim=0.1)
[1] 1.0026764 0.9973307
> normOffsets(data, method="upperquartile")
[1] 0.9834651 1.0168129
> 
> head(normOffsets(assay(data), lib.size=data$totals, type="loess"))
           [,1]      [,2]
[1,] -0.4047876 0.4047876
[2,] -0.4328410 0.4328410
[3,] -0.3864553 0.3864553
[4,] -0.4101296 0.4101296
[5,] -0.3788945 0.3788945
[6,] -0.3514597 0.3514597
> head(normOffsets(assay(data), lib.size=data$totals, type="loess", span=0.7))
           [,1]      [,2]
[1,] -0.4297765 0.4297765
[2,] -0.4391936 0.4391936
[3,] -0.3867962 0.3867962
[4,] -0.4215479 0.4215479
[5,] -0.3858107 0.3858107
[6,] -0.3915074 0.3915074
> head(normOffsets(data, type="loess"))
           [,1]      [,2]
[1,] -0.4047876 0.4047876
[2,] -0.4328410 0.4328410
[3,] -0.3864553 0.3864553
[4,] -0.4101296 0.4101296
[5,] -0.3788945 0.3788945
[6,] -0.3514597 0.3514597
> head(normOffsets(data, type="loess", span=0.5))
           [,1]      [,2]
[1,] -0.4120470 0.4120470
[2,] -0.4350054 0.4350054
[3,] -0.3740611 0.3740611
[4,] -0.4122536 0.4122536
[5,] -0.3722926 0.3722926
[6,] -0.3835921 0.3835921
> 
> # Assuming someone went around and pulled out some p-values for everybody.
> set.seed(128145-19238)
> nr <- nrow(data)
> tabled <- data.frame(logFC=rnorm(nr), logCPM=rnorm(nr), PValue=rbeta(nr, 1, 2))
> weighting <- rgamma(nr, 2, 1)
> 
> mergeWindows(rowRanges(data), -1)
$id
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
[51] 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

$region
GRanges object with 71 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 100]      *
   [3]     chrA   [101, 150]      *
   [4]     chrA   [151, 200]      *
   [5]     chrA   [201, 250]      *
   ...      ...          ...    ...
  [67]     chrC [1101, 1150]      *
  [68]     chrC [1151, 1200]      *
  [69]     chrC [1201, 1250]      *
  [70]     chrC [1251, 1300]      *
  [71]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> mergeWindows(rowRanges(data), 100)
$id
 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
[39] 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

$region
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrA [1, 1298]      *
  [2]     chrB [1,  870]      *
  [3]     chrC [1, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> mergeWindows(rowRanges(data), 100, max.width=500)
$id
 [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5
[39] 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8

$region
GRanges object with 8 ranges and 0 metadata columns:
      seqnames      ranges strand
         <Rle>   <IRanges>  <Rle>
  [1]     chrA [  1,  450]      *
  [2]     chrA [451,  850]      *
  [3]     chrA [851, 1298]      *
  [4]     chrB [  1,  450]      *
  [5]     chrB [451,  870]      *
  [6]     chrC [  1,  450]      *
  [7]     chrC [451,  900]      *
  [8]     chrC [901, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> merged <- mergeWindows(rowRanges(data), 100, sign=tabled$logFC > 0)
> merged
$id
 [1]  1  2  2  3  4  4  4  5  5  6  7  8  9  9  9  9 10 10 11 12 13 14 15 15 15
[26] 15 16 17 18 18 18 18 18 19 19 20 21 22 23 24 24 25 25 26 27 28 29 29 30 30
[51] 31 31 31 31 32 33 34 34 34 34 35 36 37 37 38 39 40 41 41 42 43

$region
GRanges object with 43 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 150]      *
   [3]     chrA   [151, 200]      *
   [4]     chrA   [201, 350]      *
   [5]     chrA   [351, 450]      *
   ...      ...          ...    ...
  [39]     chrC [1051, 1100]      *
  [40]     chrC [1101, 1150]      *
  [41]     chrC [1151, 1250]      *
  [42]     chrC [1251, 1300]      *
  [43]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> 
> head(combineTests(merged$id, tabled))
  nWindows logFC.up logFC.down     PValue       FDR direction
1        1        0          0 0.46328451 0.5622769        up
2        2        0          0 0.79272727 0.8116017      down
3        1        1          0 0.27967201 0.5047602        up
4        3        0          1 0.08956765 0.4125151      down
5        2        1          0 0.28172663 0.5047602        up
6        1        0          1 0.01949563 0.4125151      down
> head(combineTests(merged$id, tabled, weight=weighting))
  nWindows logFC.up logFC.down     PValue       FDR direction
1        1        0          0 0.46328451 0.5622769        up
2        2        0          0 0.79272727 0.8116017      down
3        1        1          0 0.27967201 0.5228651        up
4        3        0          1 0.04669873 0.4255938      down
5        2        1          0 0.24536526 0.4795776        up
6        1        0          1 0.01949563 0.3373185      down
> 
> head(getBestTest(merged$id, tabled))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5783419
2    3 -0.24872062 -0.73322697 1.00000000 1.0000000
3    4  1.41995983 -0.91833741 0.27967201 0.5047602
4    5 -0.01753979  1.78172679 0.08956765 0.4442470
5    9  0.21512818  1.42847478 0.28172663 0.5047602
6   10 -1.10068046 -0.09313516 0.01949563 0.4442470
> head(getBestTest(merged$id, tabled, weight=weighting))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5783419
2    2 -0.41696325  1.60566251 1.00000000 1.0000000
3    4  1.41995983 -0.91833741 0.27967201 0.5228651
4    5 -0.01753979  1.78172679 0.04669873 0.4255938
5    9  0.21512818  1.42847478 0.24536526 0.4795776
6   10 -1.10068046 -0.09313516 0.01949563 0.3373185
> head(getBestTest(merged$id, tabled, by.pval=FALSE))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5622769
2    2 -0.41696325  1.60566251 0.79272727 0.8116017
3    4  1.41995983 -0.91833741 0.27967201 0.5228651
4    5 -0.01753979  1.78172679 0.02985588 0.2567606
5    9  0.21512818  1.42847478 0.14086332 0.4038082
6   10 -1.10068046 -0.09313516 0.01949563 0.2567606
> 
> # Pulling out some diagnostics.
> suppressPackageStartupMessages(require(org.Mm.eg.db))
> suppressPackageStartupMessages(require(TxDb.Mmusculus.UCSC.mm10.knownGene))
> 
> current <- readRDS(system.file("exdata", "exrange.rds", package="csaw"))
> output <- detailRanges(current, TxDb.Mmusculus.UCSC.mm10.knownGene, org.Mm.eg.db)
> head(output$overlap)
[1] "Nrxn3|8|+"         ""                  ""                 
[4] "1700007G11Rik|I|+" "Mannr|2|+"         ""                 
> head(output$right)
[1] "Nrxn3|9|+[3846]" "Rprm|1|-[2293]"  ""                ""               
[5] ""                ""               
> head(output$left)
[1] ""                        ""                       
[3] ""                        "1700007G11Rik|5|+[2890]"
[5] ""                        ""                       
> 
> # Pulling out some reads. 
> extractReads(both.files[1], GRanges("chrA", IRanges(100, 500)))
GRanges object with 143 ranges and 0 metadata columns:
        seqnames     ranges strand
           <Rle>  <IRanges>  <Rle>
    [1]     chrA [ 94, 103]      +
    [2]     chrA [106, 115]      +
    [3]     chrA [120, 129]      +
    [4]     chrA [120, 129]      +
    [5]     chrA [129, 138]      +
    ...      ...        ...    ...
  [139]     chrA [467, 476]      -
  [140]     chrA [482, 491]      -
  [141]     chrA [490, 499]      -
  [142]     chrA [491, 500]      -
  [143]     chrA [499, 508]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(both.files[1], GRanges("chrA", IRanges(50, 100)))
GRanges object with 27 ranges and 0 metadata columns:
       seqnames    ranges strand
          <Rle> <IRanges>  <Rle>
   [1]     chrA  [43, 52]      +
   [2]     chrA  [51, 60]      +
   [3]     chrA  [57, 66]      +
   [4]     chrA  [62, 71]      +
   [5]     chrA  [63, 72]      +
   ...      ...       ...    ...
  [23]     chrA [79,  88]      -
  [24]     chrA [83,  92]      -
  [25]     chrA [88,  97]      -
  [26]     chrA [89,  98]      -
  [27]     chrA [93, 102]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(both.files[1], GRanges("chrA", IRanges(50, 100)), param=readParam(dedup=TRUE))
GRanges object with 19 ranges and 0 metadata columns:
       seqnames    ranges strand
          <Rle> <IRanges>  <Rle>
   [1]     chrA  [51, 60]      +
   [2]     chrA  [57, 66]      +
   [3]     chrA  [62, 71]      +
   [4]     chrA  [63, 72]      +
   [5]     chrA  [76, 85]      +
   ...      ...       ...    ...
  [15]     chrA [79,  88]      -
  [16]     chrA [79,  88]      -
  [17]     chrA [88,  97]      -
  [18]     chrA [89,  98]      -
  [19]     chrA [93, 102]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(pe.file, GRanges("chrB", IRanges(50, 100)), param=readParam(pe="both"))
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrB [50,  79]      *
  [2]     chrB [90,  99]      *
  [3]     chrB [99, 100]      *
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(pe.file, GRanges("chrB", IRanges(50, 100)), param=readParam(pe="second"))
GRanges object with 4 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrB [75,  84]      +
  [2]     chrB [90,  99]      +
  [3]     chrB [70,  79]      -
  [4]     chrB [99, 100]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> 
> 
> proc.time()
   user  system elapsed 
 14.248   0.228  14.563 

csaw.Rcheck/tests_x64/test-basic.Rout.save


R Under development (unstable) (2016-10-17 r71531) -- "Unsuffered Consequences"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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

  Natural language support but running in an English locale

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

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

> # This is a testing stub that just provides a basic run-through of all the methods.
> # The real tests are located in inst/tests along with a Bash script for execution
> # and comparison. The separation into two folders is necessary to keep R CMD check
> # running with reasonable speed.
> 
> suppressWarnings(suppressPackageStartupMessages(require(csaw)))
> both.files <- system.file("exdata", c("rep1.bam", "rep2.bam"), package="csaw")
> pe.file <- system.file("exdata", "pet.bam", package="csaw")
> 
> # Checking data quality prior to counting.
> head(correlateReads(both.files))
[1] -0.0137654663  0.0005571408  0.0175021237 -0.0308470292 -0.0087488234
[6] -0.0120687468
> head(correlateReads(both.files, cross=FALSE))
[1]  1.0000000000 -0.0008601215  0.0170688852 -0.0475443596  0.0028128511
[6] -0.0030687197
> 
> getPESizes(pe.file)
$sizes
[1]  70  90  20 150  10  30  10   2

$diagnostics
  total.reads  mapped.reads        single mate.unmapped    unoriented 
           23            23             3             0             1 
    inter.chr 
            1 

> 
> # Trying to count some single-end data.
> data <- windowCounts(both.files, ext=100)
> head(assay(data))
     [,1] [,2]
[1,]   43   71
[2,]   57   89
[3,]   56  120
[4,]   53  141
[5,]   40  152
[6,]   59  135
> rowRanges(data)
GRanges object with 71 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 100]      *
   [3]     chrA   [101, 150]      *
   [4]     chrA   [151, 200]      *
   [5]     chrA   [201, 250]      *
   ...      ...          ...    ...
  [67]     chrC [1101, 1150]      *
  [68]     chrC [1151, 1200]      *
  [69]     chrC [1201, 1250]      *
  [70]     chrC [1251, 1300]      *
  [71]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome
> data$totals
[1] 1349 3291
> 
> data <- windowCounts(both.files, width=500, spacing=200)
> head(assay(data))
     [,1] [,2]
[1,]  204  455
[2,]  195  510
[3,]  186  483
[4,]  200  501
[5,]  187  468
[6,]  127  311
> rowRanges(data)
GRanges object with 19 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA  [  1,  500]      *
   [2]     chrA  [201,  700]      *
   [3]     chrA  [401,  900]      *
   [4]     chrA  [601, 1100]      *
   [5]     chrA  [801, 1298]      *
   ...      ...          ...    ...
  [15]     chrC [ 401,  900]      *
  [16]     chrC [ 601, 1100]      *
  [17]     chrC [ 801, 1300]      *
  [18]     chrC [1001, 1345]      *
  [19]     chrC [1201, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome
> data$totals
[1] 1349 3291
> 
> data <- windowCounts(both.files, ext=100, param=readParam(minq=100))
> data$totals
[1]  914 2152
> data <- windowCounts(both.files, ext=100, param=readParam(dedup=TRUE))
> data$totals
[1] 1056 2582
> data <- windowCounts(both.files, ext=100, param=readParam(discard=GRanges("chrA", IRanges(50, 500))))
> data$totals
[1] 1186 2916
> data <- windowCounts(both.files, ext=100, param=readParam(restrict="chrA"))
> data$totals
[1]  451 1093
> 
> # Trying to count some paired-end data.
> out <- windowCounts(pe.file, param=readParam(pe="both"), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    3
[2,]    4
[3,]    2
[4,]    1
[5,]    4
[6,]    3
> out$totals
[1] 8
> rowRanges(out)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrA [151, 200]      *
  [5]     chrB [  1, 100]      *
  [6]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> out <- windowCounts(pe.file, param=readParam(pe="both", max.frag=100), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    2
[2,]    3
[3,]    1
[4,]    4
[5,]    3
> out$totals
[1] 7
> rowRanges(out)
GRanges object with 5 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrB [  1, 100]      *
  [5]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> out <- windowCounts(pe.file, param=readParam(pe="first"), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    3
[2,]    4
[3,]    4
[4,]    2
[5,]    6
[6,]    6
> out$totals
[1] 10
> rowRanges(out)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrA [151, 200]      *
  [5]     chrB [  1, 100]      *
  [6]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> 
> # Trying to convert it to a DGEList.
> asDGEList(data)
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1      451            1
Sample2     1     1093            1

> asDGEList(data, lib.size=c(10, 10))
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1       10            1
Sample2     1       10            1

> asDGEList(data, norm=c(1,2))
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1      451            1
Sample2     1     1093            2

> 
> temp <- data 
> temp$totals <- NULL 
> asDGEList(temp) # Should spit out a warning.
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1     1293            1
Sample2     1     3142            1

Warning message:
In .local(object, ...) :
  library sizes not found in 'totals', setting to NULL
> 
> # Running some basic normalization.
> data <- windowCounts(both.files, ext=100, param=readParam(minq=100, dedup=TRUE))
> 
> normOffsets(assay(data), lib.size=data$totals)
[1] 1.001197 0.998804
> normOffsets(assay(data), lib.size=data$totals, logratioTrim=.2)
[1] 1.003816 0.996199
> normOffsets(assay(data), lib.size=data$totals, method="RLE")
[1] 1.0037890 0.9962253
> normOffsets(data)
[1] 1.001197 0.998804
> normOffsets(data, logratioTrim=0.1)
[1] 1.0026764 0.9973307
> normOffsets(data, method="upperquartile")
[1] 0.9834651 1.0168129
> 
> head(normOffsets(assay(data), lib.size=data$totals, type="loess"))
           [,1]      [,2]
[1,] -0.4047876 0.4047876
[2,] -0.4328410 0.4328410
[3,] -0.3864553 0.3864553
[4,] -0.4101296 0.4101296
[5,] -0.3788945 0.3788945
[6,] -0.3514597 0.3514597
> head(normOffsets(assay(data), lib.size=data$totals, type="loess", span=0.7))
           [,1]      [,2]
[1,] -0.4297765 0.4297765
[2,] -0.4391936 0.4391936
[3,] -0.3867962 0.3867962
[4,] -0.4215479 0.4215479
[5,] -0.3858107 0.3858107
[6,] -0.3915074 0.3915074
> head(normOffsets(data, type="loess"))
           [,1]      [,2]
[1,] -0.4047876 0.4047876
[2,] -0.4328410 0.4328410
[3,] -0.3864553 0.3864553
[4,] -0.4101296 0.4101296
[5,] -0.3788945 0.3788945
[6,] -0.3514597 0.3514597
> head(normOffsets(data, type="loess", span=0.5))
           [,1]      [,2]
[1,] -0.4120470 0.4120470
[2,] -0.4350054 0.4350054
[3,] -0.3740611 0.3740611
[4,] -0.4122536 0.4122536
[5,] -0.3722926 0.3722926
[6,] -0.3835921 0.3835921
> 
> # Assuming someone went around and pulled out some p-values for everybody.
> set.seed(128145-19238)
> nr <- nrow(data)
> tabled <- data.frame(logFC=rnorm(nr), logCPM=rnorm(nr), PValue=rbeta(nr, 1, 2))
> weighting <- rgamma(nr, 2, 1)
> 
> mergeWindows(rowRanges(data), -1)
$id
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
[51] 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

$region
GRanges object with 71 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 100]      *
   [3]     chrA   [101, 150]      *
   [4]     chrA   [151, 200]      *
   [5]     chrA   [201, 250]      *
   ...      ...          ...    ...
  [67]     chrC [1101, 1150]      *
  [68]     chrC [1151, 1200]      *
  [69]     chrC [1201, 1250]      *
  [70]     chrC [1251, 1300]      *
  [71]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> mergeWindows(rowRanges(data), 100)
$id
 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
[39] 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

$region
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrA [1, 1298]      *
  [2]     chrB [1,  870]      *
  [3]     chrC [1, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> mergeWindows(rowRanges(data), 100, max.width=500)
$id
 [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5
[39] 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8

$region
GRanges object with 8 ranges and 0 metadata columns:
      seqnames      ranges strand
         <Rle>   <IRanges>  <Rle>
  [1]     chrA [  1,  450]      *
  [2]     chrA [451,  850]      *
  [3]     chrA [851, 1298]      *
  [4]     chrB [  1,  450]      *
  [5]     chrB [451,  870]      *
  [6]     chrC [  1,  450]      *
  [7]     chrC [451,  900]      *
  [8]     chrC [901, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> merged <- mergeWindows(rowRanges(data), 100, sign=tabled$logFC > 0)
> merged
$id
 [1]  1  2  2  3  4  4  4  5  5  6  7  8  9  9  9  9 10 10 11 12 13 14 15 15 15
[26] 15 16 17 18 18 18 18 18 19 19 20 21 22 23 24 24 25 25 26 27 28 29 29 30 30
[51] 31 31 31 31 32 33 34 34 34 34 35 36 37 37 38 39 40 41 41 42 43

$region
GRanges object with 43 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 150]      *
   [3]     chrA   [151, 200]      *
   [4]     chrA   [201, 350]      *
   [5]     chrA   [351, 450]      *
   ...      ...          ...    ...
  [39]     chrC [1051, 1100]      *
  [40]     chrC [1101, 1150]      *
  [41]     chrC [1151, 1250]      *
  [42]     chrC [1251, 1300]      *
  [43]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> 
> head(combineTests(merged$id, tabled))
  nWindows logFC.up logFC.down     PValue       FDR direction
1        1        0          0 0.46328451 0.5622769        up
2        2        0          0 0.79272727 0.8116017      down
3        1        1          0 0.27967201 0.5047602        up
4        3        0          1 0.08956765 0.4125151      down
5        2        1          0 0.28172663 0.5047602        up
6        1        0          1 0.01949563 0.4125151      down
> head(combineTests(merged$id, tabled, weight=weighting))
  nWindows logFC.up logFC.down     PValue       FDR direction
1        1        0          0 0.46328451 0.5622769        up
2        2        0          0 0.79272727 0.8116017      down
3        1        1          0 0.27967201 0.5228651        up
4        3        0          1 0.04669873 0.4255938      down
5        2        1          0 0.24536526 0.4795776        up
6        1        0          1 0.01949563 0.3373185      down
> 
> head(getBestTest(merged$id, tabled))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5783419
2    3 -0.24872062 -0.73322697 1.00000000 1.0000000
3    4  1.41995983 -0.91833741 0.27967201 0.5047602
4    5 -0.01753979  1.78172679 0.08956765 0.4442470
5    9  0.21512818  1.42847478 0.28172663 0.5047602
6   10 -1.10068046 -0.09313516 0.01949563 0.4442470
> head(getBestTest(merged$id, tabled, weight=weighting))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5783419
2    2 -0.41696325  1.60566251 1.00000000 1.0000000
3    4  1.41995983 -0.91833741 0.27967201 0.5228651
4    5 -0.01753979  1.78172679 0.04669873 0.4255938
5    9  0.21512818  1.42847478 0.24536526 0.4795776
6   10 -1.10068046 -0.09313516 0.01949563 0.3373185
> head(getBestTest(merged$id, tabled, by.pval=FALSE))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5622769
2    2 -0.41696325  1.60566251 0.79272727 0.8116017
3    4  1.41995983 -0.91833741 0.27967201 0.5228651
4    5 -0.01753979  1.78172679 0.02985588 0.2567606
5    9  0.21512818  1.42847478 0.14086332 0.4038082
6   10 -1.10068046 -0.09313516 0.01949563 0.2567606
> 
> # Pulling out some diagnostics.
> suppressPackageStartupMessages(require(org.Mm.eg.db))
> suppressPackageStartupMessages(require(TxDb.Mmusculus.UCSC.mm10.knownGene))
> 
> current <- readRDS(system.file("exdata", "exrange.rds", package="csaw"))
> output <- detailRanges(current, TxDb.Mmusculus.UCSC.mm10.knownGene, org.Mm.eg.db)
> head(output$overlap)
[1] "Nrxn3|8|+"         ""                  ""                 
[4] "1700007G11Rik|I|+" "Mannr|2|+"         ""                 
> head(output$right)
[1] "Nrxn3|9|+[3846]" "Rprm|1|-[2293]"  ""                ""               
[5] ""                ""               
> head(output$left)
[1] ""                        ""                       
[3] ""                        "1700007G11Rik|5|+[2890]"
[5] ""                        ""                       
> 
> # Pulling out some reads. 
> extractReads(both.files[1], GRanges("chrA", IRanges(100, 500)))
GRanges object with 143 ranges and 0 metadata columns:
        seqnames     ranges strand
           <Rle>  <IRanges>  <Rle>
    [1]     chrA [ 94, 103]      +
    [2]     chrA [106, 115]      +
    [3]     chrA [120, 129]      +
    [4]     chrA [120, 129]      +
    [5]     chrA [129, 138]      +
    ...      ...        ...    ...
  [139]     chrA [467, 476]      -
  [140]     chrA [482, 491]      -
  [141]     chrA [490, 499]      -
  [142]     chrA [491, 500]      -
  [143]     chrA [499, 508]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(both.files[1], GRanges("chrA", IRanges(50, 100)))
GRanges object with 27 ranges and 0 metadata columns:
       seqnames    ranges strand
          <Rle> <IRanges>  <Rle>
   [1]     chrA  [43, 52]      +
   [2]     chrA  [51, 60]      +
   [3]     chrA  [57, 66]      +
   [4]     chrA  [62, 71]      +
   [5]     chrA  [63, 72]      +
   ...      ...       ...    ...
  [23]     chrA [79,  88]      -
  [24]     chrA [83,  92]      -
  [25]     chrA [88,  97]      -
  [26]     chrA [89,  98]      -
  [27]     chrA [93, 102]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(both.files[1], GRanges("chrA", IRanges(50, 100)), param=readParam(dedup=TRUE))
GRanges object with 19 ranges and 0 metadata columns:
       seqnames    ranges strand
          <Rle> <IRanges>  <Rle>
   [1]     chrA  [51, 60]      +
   [2]     chrA  [57, 66]      +
   [3]     chrA  [62, 71]      +
   [4]     chrA  [63, 72]      +
   [5]     chrA  [76, 85]      +
   ...      ...       ...    ...
  [15]     chrA [79,  88]      -
  [16]     chrA [79,  88]      -
  [17]     chrA [88,  97]      -
  [18]     chrA [89,  98]      -
  [19]     chrA [93, 102]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(pe.file, GRanges("chrB", IRanges(50, 100)), param=readParam(pe="both"))
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrB [50,  79]      *
  [2]     chrB [90,  99]      *
  [3]     chrB [99, 100]      *
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(pe.file, GRanges("chrB", IRanges(50, 100)), param=readParam(pe="second"))
GRanges object with 4 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrB [75,  84]      +
  [2]     chrB [90,  99]      +
  [3]     chrB [70,  79]      -
  [4]     chrB [99, 100]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> 
> 
> proc.time()
   user  system elapsed 
 14.248   0.228  14.563 

csaw.Rcheck/tests_i386/test-basic.Rout


R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 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.

> # This is a testing stub that just provides a basic run-through of all the methods.
> # The real tests are located in inst/tests along with a Bash script for execution
> # and comparison. The separation into two folders is necessary to keep R CMD check
> # running with reasonable speed.
> 
> suppressWarnings(suppressPackageStartupMessages(require(csaw)))
> both.files <- system.file("exdata", c("rep1.bam", "rep2.bam"), package="csaw")
> pe.file <- system.file("exdata", "pet.bam", package="csaw")
> 
> # Checking data quality prior to counting.
> head(correlateReads(both.files))
[1] -0.0137654663  0.0005571408  0.0175021237 -0.0308470292 -0.0087488234
[6] -0.0120687468
> head(correlateReads(both.files, cross=FALSE))
[1]  1.0000000000 -0.0008601215  0.0170688852 -0.0475443596  0.0028128511
[6] -0.0030687197
> 
> getPESizes(pe.file)
$sizes
[1]  70  90  20 150  10  30  10   2

$diagnostics
  total.reads  mapped.reads        single mate.unmapped    unoriented 
           23            23             3             0             1 
    inter.chr 
            1 

> 
> # Trying to count some single-end data.
> data <- windowCounts(both.files, ext=100)
> head(assay(data))
     [,1] [,2]
[1,]   43   71
[2,]   57   89
[3,]   56  120
[4,]   53  141
[5,]   40  152
[6,]   59  135
> rowRanges(data)
GRanges object with 71 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 100]      *
   [3]     chrA   [101, 150]      *
   [4]     chrA   [151, 200]      *
   [5]     chrA   [201, 250]      *
   ...      ...          ...    ...
  [67]     chrC [1101, 1150]      *
  [68]     chrC [1151, 1200]      *
  [69]     chrC [1201, 1250]      *
  [70]     chrC [1251, 1300]      *
  [71]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome
> data$totals
[1] 1349 3291
> 
> data <- windowCounts(both.files, width=500, spacing=200)
> head(assay(data))
     [,1] [,2]
[1,]  204  455
[2,]  195  510
[3,]  186  483
[4,]  200  501
[5,]  187  468
[6,]  127  311
> rowRanges(data)
GRanges object with 19 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA  [  1,  500]      *
   [2]     chrA  [201,  700]      *
   [3]     chrA  [401,  900]      *
   [4]     chrA  [601, 1100]      *
   [5]     chrA  [801, 1298]      *
   ...      ...          ...    ...
  [15]     chrC [ 401,  900]      *
  [16]     chrC [ 601, 1100]      *
  [17]     chrC [ 801, 1300]      *
  [18]     chrC [1001, 1345]      *
  [19]     chrC [1201, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome
> data$totals
[1] 1349 3291
> 
> data <- windowCounts(both.files, ext=100, param=readParam(minq=100))
> data$totals
[1]  914 2152
> data <- windowCounts(both.files, ext=100, param=readParam(dedup=TRUE))
> data$totals
[1] 1056 2582
> data <- windowCounts(both.files, ext=100, param=readParam(discard=GRanges("chrA", IRanges(50, 500))))
> data$totals
[1] 1186 2916
> data <- windowCounts(both.files, ext=100, param=readParam(restrict="chrA"))
> data$totals
[1]  451 1093
> 
> # Trying to count some paired-end data.
> out <- windowCounts(pe.file, param=readParam(pe="both"), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    3
[2,]    4
[3,]    2
[4,]    1
[5,]    4
[6,]    3
> out$totals
[1] 8
> rowRanges(out)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrA [151, 200]      *
  [5]     chrB [  1, 100]      *
  [6]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> out <- windowCounts(pe.file, param=readParam(pe="both", max.frag=100), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    2
[2,]    3
[3,]    1
[4,]    4
[5,]    3
> out$totals
[1] 7
> rowRanges(out)
GRanges object with 5 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrB [  1, 100]      *
  [5]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> out <- windowCounts(pe.file, param=readParam(pe="first"), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    3
[2,]    4
[3,]    4
[4,]    2
[5,]    6
[6,]    6
> out$totals
[1] 10
> rowRanges(out)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrA [151, 200]      *
  [5]     chrB [  1, 100]      *
  [6]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> 
> # Trying to convert it to a DGEList.
> asDGEList(data)
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1      451            1
Sample2     1     1093            1

> asDGEList(data, lib.size=c(10, 10))
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1       10            1
Sample2     1       10            1

> asDGEList(data, norm=c(1,2))
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1      451            1
Sample2     1     1093            2

> 
> temp <- data 
> temp$totals <- NULL 
> asDGEList(temp) # Should spit out a warning.
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1     1293            1
Sample2     1     3142            1

Warning message:
In .local(object, ...) :
  library sizes not found in 'totals', setting to NULL
> 
> # Running some basic normalization.
> data <- windowCounts(both.files, ext=100, param=readParam(minq=100, dedup=TRUE))
> 
> normOffsets(assay(data), lib.size=data$totals)
[1] 1.001197 0.998804
> normOffsets(assay(data), lib.size=data$totals, logratioTrim=.2)
[1] 1.003816 0.996199
> normOffsets(assay(data), lib.size=data$totals, method="RLE")
[1] 1.0037890 0.9962253
> normOffsets(data)
[1] 1.001197 0.998804
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> normOffsets(data, logratioTrim=0.1)
[1] 1.0026764 0.9973307
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> normOffsets(data, method="upperquartile")
[1] 0.9834651 1.0168129
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> 
> head(normOffsets(assay(data), lib.size=data$totals, type="loess"))
           [,1]      [,2]
[1,] -0.4047876 0.4047876
[2,] -0.4328410 0.4328410
[3,] -0.3864553 0.3864553
[4,] -0.4101296 0.4101296
[5,] -0.3788945 0.3788945
[6,] -0.3514597 0.3514597
> head(normOffsets(assay(data), lib.size=data$totals, type="loess", span=0.7))
           [,1]      [,2]
[1,] -0.4297765 0.4297765
[2,] -0.4391936 0.4391936
[3,] -0.3867962 0.3867962
[4,] -0.4215479 0.4215479
[5,] -0.3858107 0.3858107
[6,] -0.3915074 0.3915074
> head(normOffsets(data, type="loess"))
           [,1]      [,2]
[1,] -0.4047876 0.4047876
[2,] -0.4328410 0.4328410
[3,] -0.3864553 0.3864553
[4,] -0.4101296 0.4101296
[5,] -0.3788945 0.3788945
[6,] -0.3514597 0.3514597
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> head(normOffsets(data, type="loess", span=0.5))
           [,1]      [,2]
[1,] -0.4120470 0.4120470
[2,] -0.4350054 0.4350054
[3,] -0.3740611 0.3740611
[4,] -0.4122536 0.4122536
[5,] -0.3722926 0.3722926
[6,] -0.3835921 0.3835921
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> 
> # Assuming someone went around and pulled out some p-values for everybody.
> set.seed(128145-19238)
> nr <- nrow(data)
> tabled <- data.frame(logFC=rnorm(nr), logCPM=rnorm(nr), PValue=rbeta(nr, 1, 2))
> weighting <- rgamma(nr, 2, 1)
> 
> mergeWindows(rowRanges(data), -1)
$id
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
[51] 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

$region
GRanges object with 71 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 100]      *
   [3]     chrA   [101, 150]      *
   [4]     chrA   [151, 200]      *
   [5]     chrA   [201, 250]      *
   ...      ...          ...    ...
  [67]     chrC [1101, 1150]      *
  [68]     chrC [1151, 1200]      *
  [69]     chrC [1201, 1250]      *
  [70]     chrC [1251, 1300]      *
  [71]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> mergeWindows(rowRanges(data), 100)
$id
 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
[39] 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

$region
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrA [1, 1298]      *
  [2]     chrB [1,  870]      *
  [3]     chrC [1, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> mergeWindows(rowRanges(data), 100, max.width=500)
$id
 [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5
[39] 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8

$region
GRanges object with 8 ranges and 0 metadata columns:
      seqnames      ranges strand
         <Rle>   <IRanges>  <Rle>
  [1]     chrA [  1,  450]      *
  [2]     chrA [451,  850]      *
  [3]     chrA [851, 1298]      *
  [4]     chrB [  1,  450]      *
  [5]     chrB [451,  870]      *
  [6]     chrC [  1,  450]      *
  [7]     chrC [451,  900]      *
  [8]     chrC [901, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> merged <- mergeWindows(rowRanges(data), 100, sign=tabled$logFC > 0)
> merged
$id
 [1]  1  2  2  3  4  4  4  5  5  6  7  8  9  9  9  9 10 10 11 12 13 14 15 15 15
[26] 15 16 17 18 18 18 18 18 19 19 20 21 22 23 24 24 25 25 26 27 28 29 29 30 30
[51] 31 31 31 31 32 33 34 34 34 34 35 36 37 37 38 39 40 41 41 42 43

$region
GRanges object with 43 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 150]      *
   [3]     chrA   [151, 200]      *
   [4]     chrA   [201, 350]      *
   [5]     chrA   [351, 450]      *
   ...      ...          ...    ...
  [39]     chrC [1051, 1100]      *
  [40]     chrC [1101, 1150]      *
  [41]     chrC [1151, 1250]      *
  [42]     chrC [1251, 1300]      *
  [43]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> 
> head(combineTests(merged$id, tabled))
  nWindows logFC.up logFC.down     PValue       FDR direction
1        1        0          0 0.46328451 0.5622769        up
2        2        0          0 0.79272727 0.8116017      down
3        1        1          0 0.27967201 0.5047602        up
4        3        0          1 0.08956765 0.4125151      down
5        2        1          0 0.28172663 0.5047602        up
6        1        0          1 0.01949563 0.4125151      down
> head(combineTests(merged$id, tabled, weight=weighting))
  nWindows logFC.up logFC.down     PValue       FDR direction
1        1        0          0 0.46328451 0.5622769        up
2        2        0          0 0.79272727 0.8116017      down
3        1        1          0 0.27967201 0.5228651        up
4        3        0          1 0.04669873 0.4255938      down
5        2        1          0 0.24536526 0.4795776        up
6        1        0          1 0.01949563 0.3373185      down
> 
> head(getBestTest(merged$id, tabled))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5783419
2    3 -0.24872062 -0.73322697 1.00000000 1.0000000
3    4  1.41995983 -0.91833741 0.27967201 0.5047602
4    5 -0.01753979  1.78172679 0.08956765 0.4442470
5    9  0.21512818  1.42847478 0.28172663 0.5047602
6   10 -1.10068046 -0.09313516 0.01949563 0.4442470
> head(getBestTest(merged$id, tabled, weight=weighting))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5783419
2    2 -0.41696325  1.60566251 1.00000000 1.0000000
3    4  1.41995983 -0.91833741 0.27967201 0.5228651
4    5 -0.01753979  1.78172679 0.04669873 0.4255938
5    9  0.21512818  1.42847478 0.24536526 0.4795776
6   10 -1.10068046 -0.09313516 0.01949563 0.3373185
> head(getBestTest(merged$id, tabled, by.pval=FALSE))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5622769
2    2 -0.41696325  1.60566251 0.79272727 0.8116017
3    4  1.41995983 -0.91833741 0.27967201 0.5228651
4    5 -0.01753979  1.78172679 0.02985588 0.2567606
5    9  0.21512818  1.42847478 0.14086332 0.4038082
6   10 -1.10068046 -0.09313516 0.01949563 0.2567606
> 
> # Pulling out some diagnostics.
> suppressPackageStartupMessages(require(org.Mm.eg.db))
> suppressPackageStartupMessages(require(TxDb.Mmusculus.UCSC.mm10.knownGene))
> 
> current <- readRDS(system.file("exdata", "exrange.rds", package="csaw"))
> output <- detailRanges(current, TxDb.Mmusculus.UCSC.mm10.knownGene, org.Mm.eg.db)
> head(output$overlap)
[1] "Nrxn3|8|+"         ""                  ""                 
[4] "1700007G11Rik|I|+" "Mannr|2|+"         ""                 
> head(output$right)
[1] "Nrxn3|9|+[3846]" "Rprm|1|-[2293]"  ""                ""               
[5] ""                ""               
> head(output$left)
[1] ""                        ""                       
[3] ""                        "1700007G11Rik|5|+[2890]"
[5] ""                        ""                       
> 
> # Pulling out some reads. 
> extractReads(both.files[1], GRanges("chrA", IRanges(100, 500)))
GRanges object with 143 ranges and 0 metadata columns:
        seqnames     ranges strand
           <Rle>  <IRanges>  <Rle>
    [1]     chrA [ 94, 103]      +
    [2]     chrA [106, 115]      +
    [3]     chrA [120, 129]      +
    [4]     chrA [120, 129]      +
    [5]     chrA [129, 138]      +
    ...      ...        ...    ...
  [139]     chrA [467, 476]      -
  [140]     chrA [482, 491]      -
  [141]     chrA [490, 499]      -
  [142]     chrA [491, 500]      -
  [143]     chrA [499, 508]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(both.files[1], GRanges("chrA", IRanges(50, 100)))
GRanges object with 27 ranges and 0 metadata columns:
       seqnames    ranges strand
          <Rle> <IRanges>  <Rle>
   [1]     chrA  [43, 52]      +
   [2]     chrA  [51, 60]      +
   [3]     chrA  [57, 66]      +
   [4]     chrA  [62, 71]      +
   [5]     chrA  [63, 72]      +
   ...      ...       ...    ...
  [23]     chrA [79,  88]      -
  [24]     chrA [83,  92]      -
  [25]     chrA [88,  97]      -
  [26]     chrA [89,  98]      -
  [27]     chrA [93, 102]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(both.files[1], GRanges("chrA", IRanges(50, 100)), param=readParam(dedup=TRUE))
GRanges object with 19 ranges and 0 metadata columns:
       seqnames    ranges strand
          <Rle> <IRanges>  <Rle>
   [1]     chrA  [51, 60]      +
   [2]     chrA  [57, 66]      +
   [3]     chrA  [62, 71]      +
   [4]     chrA  [63, 72]      +
   [5]     chrA  [76, 85]      +
   ...      ...       ...    ...
  [15]     chrA [79,  88]      -
  [16]     chrA [79,  88]      -
  [17]     chrA [88,  97]      -
  [18]     chrA [89,  98]      -
  [19]     chrA [93, 102]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(pe.file, GRanges("chrB", IRanges(50, 100)), param=readParam(pe="both"))
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrB [50,  79]      *
  [2]     chrB [90,  99]      *
  [3]     chrB [99, 100]      *
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(pe.file, GRanges("chrB", IRanges(50, 100)), param=readParam(pe="second"))
GRanges object with 4 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrB [75,  84]      +
  [2]     chrB [90,  99]      +
  [3]     chrB [70,  79]      -
  [4]     chrB [99, 100]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> 
> 
> proc.time()
   user  system elapsed 
  23.46    1.09   24.56 

csaw.Rcheck/tests_x64/test-basic.Rout


R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 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.

> # This is a testing stub that just provides a basic run-through of all the methods.
> # The real tests are located in inst/tests along with a Bash script for execution
> # and comparison. The separation into two folders is necessary to keep R CMD check
> # running with reasonable speed.
> 
> suppressWarnings(suppressPackageStartupMessages(require(csaw)))
> both.files <- system.file("exdata", c("rep1.bam", "rep2.bam"), package="csaw")
> pe.file <- system.file("exdata", "pet.bam", package="csaw")
> 
> # Checking data quality prior to counting.
> head(correlateReads(both.files))
[1] -0.0137654663  0.0005571408  0.0175021237 -0.0308470292 -0.0087488234
[6] -0.0120687468
> head(correlateReads(both.files, cross=FALSE))
[1]  1.0000000000 -0.0008601215  0.0170688852 -0.0475443596  0.0028128511
[6] -0.0030687197
> 
> getPESizes(pe.file)
$sizes
[1]  70  90  20 150  10  30  10   2

$diagnostics
  total.reads  mapped.reads        single mate.unmapped    unoriented 
           23            23             3             0             1 
    inter.chr 
            1 

> 
> # Trying to count some single-end data.
> data <- windowCounts(both.files, ext=100)
> head(assay(data))
     [,1] [,2]
[1,]   43   71
[2,]   57   89
[3,]   56  120
[4,]   53  141
[5,]   40  152
[6,]   59  135
> rowRanges(data)
GRanges object with 71 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 100]      *
   [3]     chrA   [101, 150]      *
   [4]     chrA   [151, 200]      *
   [5]     chrA   [201, 250]      *
   ...      ...          ...    ...
  [67]     chrC [1101, 1150]      *
  [68]     chrC [1151, 1200]      *
  [69]     chrC [1201, 1250]      *
  [70]     chrC [1251, 1300]      *
  [71]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome
> data$totals
[1] 1349 3291
> 
> data <- windowCounts(both.files, width=500, spacing=200)
> head(assay(data))
     [,1] [,2]
[1,]  204  455
[2,]  195  510
[3,]  186  483
[4,]  200  501
[5,]  187  468
[6,]  127  311
> rowRanges(data)
GRanges object with 19 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA  [  1,  500]      *
   [2]     chrA  [201,  700]      *
   [3]     chrA  [401,  900]      *
   [4]     chrA  [601, 1100]      *
   [5]     chrA  [801, 1298]      *
   ...      ...          ...    ...
  [15]     chrC [ 401,  900]      *
  [16]     chrC [ 601, 1100]      *
  [17]     chrC [ 801, 1300]      *
  [18]     chrC [1001, 1345]      *
  [19]     chrC [1201, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome
> data$totals
[1] 1349 3291
> 
> data <- windowCounts(both.files, ext=100, param=readParam(minq=100))
> data$totals
[1]  914 2152
> data <- windowCounts(both.files, ext=100, param=readParam(dedup=TRUE))
> data$totals
[1] 1056 2582
> data <- windowCounts(both.files, ext=100, param=readParam(discard=GRanges("chrA", IRanges(50, 500))))
> data$totals
[1] 1186 2916
> data <- windowCounts(both.files, ext=100, param=readParam(restrict="chrA"))
> data$totals
[1]  451 1093
> 
> # Trying to count some paired-end data.
> out <- windowCounts(pe.file, param=readParam(pe="both"), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    3
[2,]    4
[3,]    2
[4,]    1
[5,]    4
[6,]    3
> out$totals
[1] 8
> rowRanges(out)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrA [151, 200]      *
  [5]     chrB [  1, 100]      *
  [6]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> out <- windowCounts(pe.file, param=readParam(pe="both", max.frag=100), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    2
[2,]    3
[3,]    1
[4,]    4
[5,]    3
> out$totals
[1] 7
> rowRanges(out)
GRanges object with 5 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrB [  1, 100]      *
  [5]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> out <- windowCounts(pe.file, param=readParam(pe="first"), width=100, filter=1L)
> assay(out)
     [,1]
[1,]    3
[2,]    4
[3,]    4
[4,]    2
[5,]    6
[6,]    6
> out$totals
[1] 10
> rowRanges(out)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames     ranges strand
         <Rle>  <IRanges>  <Rle>
  [1]     chrA [  1, 100]      *
  [2]     chrA [ 51, 150]      *
  [3]     chrA [101, 200]      *
  [4]     chrA [151, 200]      *
  [5]     chrB [  1, 100]      *
  [6]     chrB [ 51, 100]      *
  -------
  seqinfo: 2 sequences from an unspecified genome
> 
> # Trying to convert it to a DGEList.
> asDGEList(data)
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1      451            1
Sample2     1     1093            1

> asDGEList(data, lib.size=c(10, 10))
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1       10            1
Sample2     1       10            1

> asDGEList(data, norm=c(1,2))
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1      451            1
Sample2     1     1093            2

> 
> temp <- data 
> temp$totals <- NULL 
> asDGEList(temp) # Should spit out a warning.
An object of class "DGEList"
$counts
  Sample1 Sample2
1      43      71
2      57      89
3      56     120
4      53     141
5      40     152
21 more rows ...

$samples
        group lib.size norm.factors
Sample1     1     1293            1
Sample2     1     3142            1

Warning message:
In .local(object, ...) :
  library sizes not found in 'totals', setting to NULL
> 
> # Running some basic normalization.
> data <- windowCounts(both.files, ext=100, param=readParam(minq=100, dedup=TRUE))
> 
> normOffsets(assay(data), lib.size=data$totals)
[1] 1.001197 0.998804
> normOffsets(assay(data), lib.size=data$totals, logratioTrim=.2)
[1] 1.003816 0.996199
> normOffsets(assay(data), lib.size=data$totals, method="RLE")
[1] 1.0037890 0.9962253
> normOffsets(data)
[1] 1.001197 0.998804
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> normOffsets(data, logratioTrim=0.1)
[1] 1.0026764 0.9973307
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> normOffsets(data, method="upperquartile")
[1] 0.9834651 1.0168129
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> 
> head(normOffsets(assay(data), lib.size=data$totals, type="loess"))
           [,1]      [,2]
[1,] -0.4047876 0.4047876
[2,] -0.4328410 0.4328410
[3,] -0.3864553 0.3864553
[4,] -0.4101296 0.4101296
[5,] -0.3788945 0.3788945
[6,] -0.3514597 0.3514597
> head(normOffsets(assay(data), lib.size=data$totals, type="loess", span=0.7))
           [,1]      [,2]
[1,] -0.4297765 0.4297765
[2,] -0.4391936 0.4391936
[3,] -0.3867962 0.3867962
[4,] -0.4215479 0.4215479
[5,] -0.3858107 0.3858107
[6,] -0.3915074 0.3915074
> head(normOffsets(data, type="loess"))
           [,1]      [,2]
[1,] -0.4047876 0.4047876
[2,] -0.4328410 0.4328410
[3,] -0.3864553 0.3864553
[4,] -0.4101296 0.4101296
[5,] -0.3788945 0.3788945
[6,] -0.3514597 0.3514597
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> head(normOffsets(data, type="loess", span=0.5))
           [,1]      [,2]
[1,] -0.4120470 0.4120470
[2,] -0.4350054 0.4350054
[3,] -0.3740611 0.3740611
[4,] -0.4122536 0.4122536
[5,] -0.3722926 0.3722926
[6,] -0.3835921 0.3835921
Warning message:
'se.out=NULL' is deprecated.
Use 'se.out=TRUE' instead.
See help("Deprecated") 
> 
> # Assuming someone went around and pulled out some p-values for everybody.
> set.seed(128145-19238)
> nr <- nrow(data)
> tabled <- data.frame(logFC=rnorm(nr), logCPM=rnorm(nr), PValue=rbeta(nr, 1, 2))
> weighting <- rgamma(nr, 2, 1)
> 
> mergeWindows(rowRanges(data), -1)
$id
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
[51] 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

$region
GRanges object with 71 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 100]      *
   [3]     chrA   [101, 150]      *
   [4]     chrA   [151, 200]      *
   [5]     chrA   [201, 250]      *
   ...      ...          ...    ...
  [67]     chrC [1101, 1150]      *
  [68]     chrC [1151, 1200]      *
  [69]     chrC [1201, 1250]      *
  [70]     chrC [1251, 1300]      *
  [71]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> mergeWindows(rowRanges(data), 100)
$id
 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
[39] 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

$region
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrA [1, 1298]      *
  [2]     chrB [1,  870]      *
  [3]     chrC [1, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> mergeWindows(rowRanges(data), 100, max.width=500)
$id
 [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5
[39] 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8

$region
GRanges object with 8 ranges and 0 metadata columns:
      seqnames      ranges strand
         <Rle>   <IRanges>  <Rle>
  [1]     chrA [  1,  450]      *
  [2]     chrA [451,  850]      *
  [3]     chrA [851, 1298]      *
  [4]     chrB [  1,  450]      *
  [5]     chrB [451,  870]      *
  [6]     chrC [  1,  450]      *
  [7]     chrC [451,  900]      *
  [8]     chrC [901, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> merged <- mergeWindows(rowRanges(data), 100, sign=tabled$logFC > 0)
> merged
$id
 [1]  1  2  2  3  4  4  4  5  5  6  7  8  9  9  9  9 10 10 11 12 13 14 15 15 15
[26] 15 16 17 18 18 18 18 18 19 19 20 21 22 23 24 24 25 25 26 27 28 29 29 30 30
[51] 31 31 31 31 32 33 34 34 34 34 35 36 37 37 38 39 40 41 41 42 43

$region
GRanges object with 43 ranges and 0 metadata columns:
       seqnames       ranges strand
          <Rle>    <IRanges>  <Rle>
   [1]     chrA   [  1,  50]      *
   [2]     chrA   [ 51, 150]      *
   [3]     chrA   [151, 200]      *
   [4]     chrA   [201, 350]      *
   [5]     chrA   [351, 450]      *
   ...      ...          ...    ...
  [39]     chrC [1051, 1100]      *
  [40]     chrC [1101, 1150]      *
  [41]     chrC [1151, 1250]      *
  [42]     chrC [1251, 1300]      *
  [43]     chrC [1301, 1345]      *
  -------
  seqinfo: 3 sequences from an unspecified genome

> 
> head(combineTests(merged$id, tabled))
  nWindows logFC.up logFC.down     PValue       FDR direction
1        1        0          0 0.46328451 0.5622769        up
2        2        0          0 0.79272727 0.8116017      down
3        1        1          0 0.27967201 0.5047602        up
4        3        0          1 0.08956765 0.4125151      down
5        2        1          0 0.28172663 0.5047602        up
6        1        0          1 0.01949563 0.4125151      down
> head(combineTests(merged$id, tabled, weight=weighting))
  nWindows logFC.up logFC.down     PValue       FDR direction
1        1        0          0 0.46328451 0.5622769        up
2        2        0          0 0.79272727 0.8116017      down
3        1        1          0 0.27967201 0.5228651        up
4        3        0          1 0.04669873 0.4255938      down
5        2        1          0 0.24536526 0.4795776        up
6        1        0          1 0.01949563 0.3373185      down
> 
> head(getBestTest(merged$id, tabled))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5783419
2    3 -0.24872062 -0.73322697 1.00000000 1.0000000
3    4  1.41995983 -0.91833741 0.27967201 0.5047602
4    5 -0.01753979  1.78172679 0.08956765 0.4442470
5    9  0.21512818  1.42847478 0.28172663 0.5047602
6   10 -1.10068046 -0.09313516 0.01949563 0.4442470
> head(getBestTest(merged$id, tabled, weight=weighting))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5783419
2    2 -0.41696325  1.60566251 1.00000000 1.0000000
3    4  1.41995983 -0.91833741 0.27967201 0.5228651
4    5 -0.01753979  1.78172679 0.04669873 0.4255938
5    9  0.21512818  1.42847478 0.24536526 0.4795776
6   10 -1.10068046 -0.09313516 0.01949563 0.3373185
> head(getBestTest(merged$id, tabled, by.pval=FALSE))
  best       logFC      logCPM     PValue       FDR
1    1  0.21317827  0.53648572 0.46328451 0.5622769
2    2 -0.41696325  1.60566251 0.79272727 0.8116017
3    4  1.41995983 -0.91833741 0.27967201 0.5228651
4    5 -0.01753979  1.78172679 0.02985588 0.2567606
5    9  0.21512818  1.42847478 0.14086332 0.4038082
6   10 -1.10068046 -0.09313516 0.01949563 0.2567606
> 
> # Pulling out some diagnostics.
> suppressPackageStartupMessages(require(org.Mm.eg.db))
> suppressPackageStartupMessages(require(TxDb.Mmusculus.UCSC.mm10.knownGene))
> 
> current <- readRDS(system.file("exdata", "exrange.rds", package="csaw"))
> output <- detailRanges(current, TxDb.Mmusculus.UCSC.mm10.knownGene, org.Mm.eg.db)
> head(output$overlap)
[1] "Nrxn3|8|+"         ""                  ""                 
[4] "1700007G11Rik|I|+" "Mannr|2|+"         ""                 
> head(output$right)
[1] "Nrxn3|9|+[3846]" "Rprm|1|-[2293]"  ""                ""               
[5] ""                ""               
> head(output$left)
[1] ""                        ""                       
[3] ""                        "1700007G11Rik|5|+[2890]"
[5] ""                        ""                       
> 
> # Pulling out some reads. 
> extractReads(both.files[1], GRanges("chrA", IRanges(100, 500)))
GRanges object with 143 ranges and 0 metadata columns:
        seqnames     ranges strand
           <Rle>  <IRanges>  <Rle>
    [1]     chrA [ 94, 103]      +
    [2]     chrA [106, 115]      +
    [3]     chrA [120, 129]      +
    [4]     chrA [120, 129]      +
    [5]     chrA [129, 138]      +
    ...      ...        ...    ...
  [139]     chrA [467, 476]      -
  [140]     chrA [482, 491]      -
  [141]     chrA [490, 499]      -
  [142]     chrA [491, 500]      -
  [143]     chrA [499, 508]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(both.files[1], GRanges("chrA", IRanges(50, 100)))
GRanges object with 27 ranges and 0 metadata columns:
       seqnames    ranges strand
          <Rle> <IRanges>  <Rle>
   [1]     chrA  [43, 52]      +
   [2]     chrA  [51, 60]      +
   [3]     chrA  [57, 66]      +
   [4]     chrA  [62, 71]      +
   [5]     chrA  [63, 72]      +
   ...      ...       ...    ...
  [23]     chrA [79,  88]      -
  [24]     chrA [83,  92]      -
  [25]     chrA [88,  97]      -
  [26]     chrA [89,  98]      -
  [27]     chrA [93, 102]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(both.files[1], GRanges("chrA", IRanges(50, 100)), param=readParam(dedup=TRUE))
GRanges object with 19 ranges and 0 metadata columns:
       seqnames    ranges strand
          <Rle> <IRanges>  <Rle>
   [1]     chrA  [51, 60]      +
   [2]     chrA  [57, 66]      +
   [3]     chrA  [62, 71]      +
   [4]     chrA  [63, 72]      +
   [5]     chrA  [76, 85]      +
   ...      ...       ...    ...
  [15]     chrA [79,  88]      -
  [16]     chrA [79,  88]      -
  [17]     chrA [88,  97]      -
  [18]     chrA [89,  98]      -
  [19]     chrA [93, 102]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(pe.file, GRanges("chrB", IRanges(50, 100)), param=readParam(pe="both"))
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrB [50,  79]      *
  [2]     chrB [90,  99]      *
  [3]     chrB [99, 100]      *
  -------
  seqinfo: 1 sequence from an unspecified genome
> extractReads(pe.file, GRanges("chrB", IRanges(50, 100)), param=readParam(pe="second"))
GRanges object with 4 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chrB [75,  84]      +
  [2]     chrB [90,  99]      +
  [3]     chrB [70,  79]      -
  [4]     chrB [99, 100]      -
  -------
  seqinfo: 1 sequence from an unspecified genome
> 
> 
> proc.time()
   user  system elapsed 
  25.01    0.64   25.64 

Example timings

csaw.Rcheck/examples_i386/csaw-Ex.timings

nameusersystemelapsed
SEmethods101
checkBimodality0.420.000.43
clusterFDR0.670.000.67
clusterWindows1.640.001.64
combineTests0.050.000.05
consolidateClusters2.370.002.38
consolidateSizes0.830.000.82
correlateReads0.220.000.22
csawUsersGuide000
detailRanges10.61 0.3810.99
empiricalFDR000
extractReads0.660.000.65
filterWindows0.450.010.47
findMaxima0.110.020.13
getBestTest0.010.000.01
getPESizes0.190.000.19
getWidths0.330.000.33
maximizeCcf000
mergeWindows0.050.000.05
mixedClusters0.010.000.01
normOffsets0.280.000.28
overlapStats0.160.000.16
profileSites0.470.030.50
readParam0.040.000.05
regionCounts0.240.000.24
scaledAverage0.280.010.29
strandedCounts0.980.021.00
upweightSummit000
windowCounts0.560.000.56
wwhm0.100.000.09

csaw.Rcheck/examples_x64/csaw-Ex.timings

nameusersystemelapsed
SEmethods1.280.011.30
checkBimodality0.580.020.59
clusterFDR0.960.000.97
clusterWindows2.220.022.23
combineTests0.070.000.07
consolidateClusters3.870.003.87
consolidateSizes0.950.010.97
correlateReads0.240.000.23
csawUsersGuide000
detailRanges13.97 0.2514.22
empiricalFDR0.010.000.02
extractReads0.770.050.81
filterWindows0.580.010.59
findMaxima0.140.000.15
getBestTest0.030.000.03
getPESizes0.210.000.21
getWidths0.390.000.39
maximizeCcf000
mergeWindows0.030.000.03
mixedClusters0.010.000.01
normOffsets0.320.020.33
overlapStats0.220.010.24
profileSites0.670.020.69
readParam0.110.000.11
regionCounts0.350.000.34
scaledAverage0.370.020.39
strandedCounts1.250.031.28
upweightSummit0.020.000.02
windowCounts0.750.010.76
wwhm0.090.000.10