[med-svn] [r-cran-pscbs] 01/09: New upstream version 0.62.0
Andreas Tille
tille at debian.org
Tue Nov 15 20:29:03 UTC 2016
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository r-cran-pscbs.
commit 9fd2d72fca4c017802dedfbb1d28131affcee27a
Author: Andreas Tille <tille at debian.org>
Date: Tue Nov 15 17:54:16 2016 +0100
New upstream version 0.62.0
---
.Rbuildignore | 58 +++
.Rinstignore | 7 +
.gitignore | 19 +
.make/Makefile | 475 +++++++++++++++++++++
.travis.yml | 48 +++
CONDUCT.md | 74 ++++
DESCRIPTION | 49 ++-
INSTALL.md | 39 ++
MD5 | 209 ---------
Makefile | 1 +
NAMESPACE | 5 +-
NEWS | 12 +-
R/AbstractCBS.HCLUST.R | 4 +-
R/AbstractCBS.PRUNE.R | 10 +-
R/AbstractCBS.R | 34 +-
R/AbstractCBS.RESTRUCT.R | 8 +-
R/CBS.CALL.R | 14 +-
R/CBS.EXTS.R | 8 +-
R/CBS.PLOT,many.R | 4 +-
R/CBS.PLOT.R | 12 +-
R/CBS.PRUNE.R | 4 +-
R/CBS.R | 20 +-
R/CBS.RESTRUCT.R | 4 +-
R/CBS.updateMeansTogether.R | 28 +-
R/DNAcopy.EXTS.R | 4 +-
R/NonPairedPSCBS.R | 8 +-
R/PSCBS.R | 37 +-
R/PSCBS.RESTRUCT.R | 2 +-
R/PairedPSCBS.BOOT.R | 10 +-
R/PairedPSCBS.BOOT.sets.R | 2 +-
R/PairedPSCBS.CALL.R | 4 +-
R/PairedPSCBS.EXTS.R | 50 ++-
R/PairedPSCBS.EXTS3.R | 34 +-
R/PairedPSCBS.PLOT,many.R | 12 +-
R/PairedPSCBS.PLOT.R | 22 +-
R/PairedPSCBS.PLOT2.R | 12 +-
R/PairedPSCBS.R | 48 ++-
R/PairedPSCBS.RESTRUCT.R | 4 +-
R/PairedPSCBS.applyByRegion.R | 2 +-
R/PairedPSCBS.callCopyNeutral.R | 40 ++
R/PairedPSCBS.callGNL.R | 2 +-
R/PairedPSCBS.callROH.R | 2 +-
R/PairedPSCBS.estimateKappa.R | 4 +-
R/PairedPSCBS.extractSegmentDataByLocus.R | 2 +-
R/PairedPSCBS.updateMeans.R | 2 +-
R/PairedPSCBS.updateMeansTogether.R | 2 +-
R/callSegmentationOutliers.R | 2 +-
R/findLargeGaps.R | 2 +-
R/segmentByCBS.R | 16 +-
R/segmentByPairedPSCBS.R | 24 +-
R/writeWIG.R | 2 +-
R/zzz.R | 2 +-
README.md | 40 ++
appveyor.yml | 78 ++++
build/vignette.rds | Bin 307 -> 0 bytes
cran-comments.md | 55 +++
incl/999.missingdocs.txt | 131 ++++++
incl/BengtssonH_etal_2010.Rd | 1 +
incl/OlshenA_etal_2011.Rd | 1 +
incl/OlshenVenkatraman_2004.Rd | 1 +
incl/VenkatramanOlshen_2007.Rd | 1 +
incl/as.DNAcopy.Rex | 13 +
incl/segmentByCBS,calls.Rex | 12 +
incl/segmentByCBS,knownSegments.Rex | 105 +++++
incl/segmentByCBS,plot.Rex | 6 +
incl/segmentByCBS,pruneBySdUndo.Rex | 33 ++
incl/segmentByCBS,tests.Rex | 84 ++++
.../segmentByCBS.Rex | 16 +-
incl/segmentByNonPairedPSCBS.Rex | 72 ++++
incl/segmentByPairedPSCBS,HetsAndHoms.Rex | 62 +++
incl/segmentByPairedPSCBS,allLOH.Rex | 43 ++
incl/segmentByPairedPSCBS.Rex | 78 ++++
inst/CITATION | 6 +-
inst/doc/CBS.R | 94 ----
inst/doc/CBS.pdf | Bin 250313 -> 0 bytes
inst/doc/CBS.tex.rsp | 305 -------------
inst/doc/PairedPSCBS.R | 92 ----
inst/doc/PairedPSCBS.pdf | Bin 283076 -> 0 bytes
inst/doc/PairedPSCBS.tex.rsp | 421 ------------------
inst/templates/rsp/CBS,report.tex.rsp | 4 +-
inst/templates/rsp/PairedPSCBS,report.tex.rsp | 15 +-
man/AbstractCBS.Rd | 1 +
man/CBS.Rd | 2 +-
man/Non-documented_objects.Rd | 3 -
man/NonPairedPSCBS.Rd | 4 +-
man/PSCBS.Rd | 3 +-
man/PairedPSCBS.Rd | 4 +-
man/estimateDeltaCN.PairedPSCBS.Rd | 52 +++
man/normalizeTotalCNs.AbstractCBS.Rd | 40 ++
man/segmentByCBS.Rd | 2 +-
revdep/README.md | 334 +++++++++++++++
revdep/check.R | 20 +
revdep/problems.md | 40 ++
revdep/timing.md | 17 +
tests/PairedPSCBS,plot.R.HIDE | 31 --
tests/segmentByCBS,futures.R | 7 +-
tests/segmentByCBS,shiftTCN.R | 4 +-
tests/segmentByPairedPSCBS,futures.R | 7 +-
vignettes/.install_extras | 8 +
vignettes/CBS.tex.rsp | 2 +-
vignettes/Makefile | 30 ++
vignettes/PSCBS.bib | 8 +-
vignettes/PairedPSCBS.tex.rsp | 2 +-
vignettes/dummy.Rnw | 11 +
104 files changed, 2512 insertions(+), 1388 deletions(-)
diff --git a/.Rbuildignore b/.Rbuildignore
new file mode 100644
index 0000000..cc3088f
--- /dev/null
+++ b/.Rbuildignore
@@ -0,0 +1,58 @@
+#----------------------------
+# Git and SVN related
+#----------------------------
+^.svn
+^.git
+^.make
+INSTALL[.]md
+OVERVIEW[.]md
+README[.]md
+CONDUCT[.]md
+
+#----------------------------
+# devtools
+#----------------------------
+^revdep
+
+#----------------------------
+# Travis-CI et al.
+#----------------------------
+^[.]travis[.]yml$
+^travis-tool[.]sh$
+^pkg-build[.]sh$
+^appveyor[.]yml$
+^covr-utils.R$
+^[.]covr[.]R$
+^[.]covr[.]rds$
+
+#----------------------------
+# R related
+#----------------------------
+Rplots.pdf$
+^cran-comments[.].*$
+^vignettes/.*[.](pdf|PDF)$
+^vignettes/.*[.](r|R)$
+^vignettes/[.]install_extras$
+^Makefile$
+^incl
+^NAMESPACE,.*[.]txt$
+^nohup.*$
+^[.]R
+^[.]benchmark
+^[.]devel
+^[.]test
+^[.]check
+^.*[.]tar[.]gz$
+
+#----------------------------
+# Package specific
+#----------------------------
+^[.]BatchJobs[.]R$
+[.]future
+
+#----------------------------
+# Miscellaneous
+#----------------------------
+^.ghi
+^.issues
+
diff --git a/.Rinstignore b/.Rinstignore
new file mode 100644
index 0000000..ccce6cc
--- /dev/null
+++ b/.Rinstignore
@@ -0,0 +1,7 @@
+doc/Makefile$
+# Certain LaTeX files (e.g. bib, bst, sty) must be part of the build
+# such that they are available for R CMD check. These are excluded
+# from the install using .Rinstignore in the top-level directory
+# such as this one.
+doc/.*[.](bib|bst|sty)$
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..86ab9cf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,19 @@
+.Rhistory
+*~
+**/*~
+.R
+.benchmark
+.check
+.devel
+.test
+*.o
+*.dll
+*.Rout
+.RData
+*.Rproj*
+*.swp
+.covr.rds
+.future
+.ghi
+.issues
+
diff --git a/.make/Makefile b/.make/Makefile
new file mode 100644
index 0000000..ce331ea
--- /dev/null
+++ b/.make/Makefile
@@ -0,0 +1,475 @@
+# Makefile for R packages
+
+# CORE MACROS
+ifeq ($(OS), Windows_NT)
+CD=cd
+CURDIR=$(subst \,/,$(shell cmd.exe /C cd))
+FSEP=;
+else
+CD=cd -P "$(CURDIR)"; cd # This handles the case when CURDIR is a softlink
+FSEP=:
+endif
+CP=cp
+MAKE=make
+MV=mv
+RM=rm -f
+MKDIR=mkdir -p
+RMDIR=$(RM) -r
+GIT=git
+
+# PACKAGE MACROS
+PKG_VERSION := $(shell grep -i ^version DESCRIPTION | cut -d : -d \ -f 2)
+PKG_NAME := $(shell grep -i ^package DESCRIPTION | cut -d : -d \ -f 2)
+PKG_DIR := $(shell basename "$(CURDIR)")
+PKG_DIR := $(CURDIR)
+PKG_TARBALL := $(PKG_NAME)_$(PKG_VERSION).tar.gz
+PKG_ZIP := $(PKG_NAME)_$(PKG_VERSION).zip
+PKG_TGZ := $(PKG_NAME)_$(PKG_VERSION).tgz
+
+# FILE MACROS
+FILES_R := $(wildcard R/*.R)
+FILES_DATA := $(wildcard data/*)
+FILES_MAN := $(wildcard man/*.Rd)
+FILES_INCL := $(wildcard incl/*)
+FILES_INST := $(wildcard inst/* inst/*/* inst/*/*/* inst/*/*/*/*)
+FILES_VIGNETTES := $(wildcard vignettes/* vignettes/.install_extras)
+FILES_SRC := $(wildcard src/* src/*/* src/*/*/* src/*/*/*/* src/*/*/*/*/* src/*/*/*/*/*/* src/*/*/*/*/*/*/* src/*/*/*/*/*/*/*/*)
+FILES_SRC_C := $(wildcard src/*.c)
+FILES_SRC_H := $(wildcard src/*.h)
+FILES_TESTS := $(wildcard tests/*.R)
+FILES_NEWS := $(wildcard NEWS inst/NEWS)
+FILES_MISC := $(wildcard README.md)
+FILES_ROOT := DESCRIPTION NAMESPACE $(wildcard .Rbuildignore .Rinstignore)
+PKG_FILES := $(FILES_ROOT) $(FILES_NEWS) $(FILES_R) $(FILES_DATA) $(FILES_MAN) $(FILES_INST) $(FILES_VIGNETTES) $(FILES_SRC) $(FILES_TESTS) $(FILES_MISC)
+FILES_MAKEFILE := $(wildcard ../../Makefile)
+
+# Has vignettes in 'vignettes/' or 'inst/doc/'?
+DIR_VIGNS := $(wildcard vignettes inst/doc)
+
+# R MACROS
+R = R
+R_SCRIPT = Rscript
+R_HOME := $(shell $(R_SCRIPT) -e "cat(R.home())")
+
+## R_USE_CRAN := $(shell $(R_SCRIPT) -e "cat(Sys.getenv('R_USE_CRAN', 'FALSE'))")
+R_NO_INIT := --no-init-file
+R_VERSION_STATUS := $(shell $(R_SCRIPT) -e "status <- tolower(R.version[['status']]); if (regexpr('unstable', status) != -1L) status <- 'devel'; cat(status)")
+R_VERSION_X_Y := $(shell $(R_SCRIPT) -e "cat(gsub('[.][0-9]+$$', '', getRversion()))")
+R_VERSION := $(shell $(R_SCRIPT) -e "cat(as.character(getRversion()))")
+R_VERSION_FULL := $(R_VERSION)$(R_VERSION_STATUS)
+R_LIBS_USER_X := $(shell $(R_SCRIPT) -e "cat(.libPaths()[1])")
+R_INCLUDE := $(shell $(R_SCRIPT) -e "cat(R.home('include'))")
+R_OUTDIR := ../_R-$(R_VERSION_FULL)
+## R_BUILD_OPTS :=
+## R_BUILD_OPTS := $(R_BUILD_OPTS) --no-build-vignettes
+R_CHECK_OUTDIR := $(R_OUTDIR)/$(PKG_NAME).Rcheck
+_R_CHECK_CRAN_INCOMING_ = $(shell $(R_SCRIPT) -e "cat(Sys.getenv('_R_CHECK_CRAN_INCOMING_', 'FALSE'))")
+_R_CHECK_XREFS_REPOSITORIES_ = $(shell if test "$(_R_CHECK_CRAN_INCOMING_)" = "TRUE"; then echo ""; else echo "invalidURL"; fi)
+_R_CHECK_FULL_ = $(shell $(R_SCRIPT) -e "cat(Sys.getenv('_R_CHECK_FULL_', ''))")
+R_CHECK_OPTS = --as-cran --timings $(shell if test "$(_R_CHECK_USE_VALGRIND_)" = "TRUE"; then echo "--use-valgrind"; fi)
+R_RD4PDF = $(shell $(R_SCRIPT) -e "if (getRversion() < 3) cat('times,hyper')")
+R_CRAN_OUTDIR := $(R_OUTDIR)/$(PKG_NAME)_$(PKG_VERSION).CRAN
+
+HAS_ASPELL := $(shell $(R_SCRIPT) -e "cat(Sys.getenv('HAS_ASPELL', !inherits(try(aspell('DESCRIPTION', control=c('--master=en_US', '--add-extra-dicts=en_GB'), dictionaries='en_stats', program='aspell'), silent=TRUE), 'try-error')))")
+
+## Git related
+GIT_BRANCH := $(shell $(GIT) symbolic-ref --short HEAD)
+GIT_BRANCH := $(subst /,-,$(GIT_BRANCH))
+GIT_COMMIT := $(shell $(GIT) log -1 --format="%h")
+R_LIBS_BRANCH := $(CURDIR)/.R/$(GIT_BRANCH)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Main
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+all: build install check
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Displays macros
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+debug:
+ @echo CURDIR=\'$(CURDIR)\'
+ @echo R_HOME=\'$(R_HOME)\'
+ @echo
+ @echo PKG_DIR=\'$(PKG_DIR)\'
+ @echo PKG_NAME=\'$(PKG_NAME)\'
+ @echo PKG_VERSION=\'$(PKG_VERSION)\'
+ @echo PKG_TARBALL=\'$(PKG_TARBALL)\'
+ @echo
+ @echo HAS_ASPELL=\'$(HAS_ASPELL)\'
+ @echo
+ @echo R=\'$(R)\'
+## @echo R_USE_CRAN=\'$(R_USE_CRAN)\'
+ @echo R_NO_INIT=\'$(R_NO_INIT)\'
+ @echo R_SCRIPT=\'$(R_SCRIPT)\'
+ @echo R_VERSION_X_Y=\'$(R_VERSION_X_Y)\'
+ @echo R_VERSION=\'$(R_VERSION)\'
+ @echo R_VERSION_STATUS=\'$(R_VERSION_STATUS)\'
+ @echo R_VERSION_FULL=\'$(R_VERSION_FULL)\'
+ @echo R_LIBS_USER_X=\'$(R_LIBS_USER_X)\'
+ @echo R_INCLUDE=\'$(R_INCLUDE)\'
+ @echo R_OUTDIR=\'$(R_OUTDIR)\'
+ @echo
+ @echo "Default packages:" $(shell $(R) --slave -e "cat(paste(getOption('defaultPackages'), collapse=', '))")
+ @echo
+ @echo R_BUILD_OPTS=\'$(R_BUILD_OPTS)\'
+ @echo
+ @echo R_CHECK_OUTDIR=\'$(R_CHECK_OUTDIR)\'
+ @echo _R_CHECK_CRAN_INCOMING_=\'$(_R_CHECK_CRAN_INCOMING_)\'
+ @echo _R_CHECK_XREFS_REPOSITORIES_=\'$(_R_CHECK_XREFS_REPOSITORIES_)\'
+ @echo _R_CHECK_FULL_=\'$(_R_CHECK_FULL_)\'
+ @echo R_CHECK_OPTS=\'$(R_CHECK_OPTS)\'
+ @echo R_RD4PDF=\'$(R_RD4PDF)\'
+ @echo
+ @echo R_CRAN_OUTDIR=\'$(R_CRAN_OUTDIR)\'
+ @echo
+
+
+debug_full: debug
+ @echo
+ @echo FILES_ROOT=\'$(FILES_ROOT)\'
+ @echo FILES_R=\'$(FILES_R)\'
+ @echo FILES_DATA=\'$(FILES_DATA)\'
+ @echo FILES_MAN=\'$(FILES_MAN)\'
+ @echo FILES_INST=\'$(FILES_INST)\'
+ @echo FILES_VIGNETTES=\'$(FILES_VIGNETTES)\'
+ @echo FILES_SRC=\'$(FILES_SRC)\'
+ @echo FILES_TESTS=\'$(FILES_TESTS)\'
+ @echo FILES_INCL=\'$(FILES_INCL)\'
+ @echo FILES_MISC=\'$(FILES_MISC)\'
+ @echo
+ @echo DIR_VIGNS=\'$(DIR_VIGNS)\'
+ @echo dirname\(DIR_VIGNS\)=\'$(shell dirname $(DIR_VIGNS))\'
+ @echo
+ @echo GIT_BRANCH=\'$(GIT_BRANCH)\'
+ @echo GIT_COMMIT=\'$(GIT_COMMIT)\'
+ @echo R_LIBS_BRANCH=\'$(R_LIBS_BRANCH)\'
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Update / install
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Update existing packages
+update:
+ $(R_SCRIPT) -e "try(update.packages(ask=FALSE)); source('http://bioconductor.org/biocLite.R'); biocLite(ask=FALSE);"
+
+# Install missing dependencies
+deps: DESCRIPTION
+ $(MAKE) update
+ $(R_SCRIPT) -e "x <- unlist(strsplit(read.dcf('DESCRIPTION',fields=c('Depends', 'Imports', 'Suggests')),',')); x <- gsub('([[:space:]]*|[(].*[)])', '', x); libs <- .libPaths()[file.access(.libPaths(), mode=2) == 0]; x <- unique(setdiff(x, c('R', rownames(installed.packages(lib.loc=libs))))); if (length(x) > 0) { try(install.packages(x)); x <- unique(setdiff(x, c('R', rownames(installed.packages(lib.loc=libs))))); source('http://bioconductor.org/biocLite.R'); biocLite(x); }"
+
+setup: update deps
+ $(R_SCRIPT) -e "source('http://aroma-project.org/hbLite.R'); hbLite('R.oo')"
+
+ns:
+ $(R_SCRIPT) -e "library('$(PKG_NAME)'); source('X:/devtools/NAMESPACE.R'); writeNamespaceSection('$(PKG_NAME)'); writeNamespaceImports('$(PKG_NAME)');"
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Build source tarball
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+$(R_OUTDIR)/$(PKG_TARBALL): $(PKG_FILES)
+ $(MKDIR) $(R_OUTDIR)
+ $(RM) $@
+ $(CD) $(R_OUTDIR);\
+ $(R) $(R_NO_INIT) CMD build $(R_BUILD_OPTS) $(PKG_DIR)
+
+build: $(R_OUTDIR)/$(PKG_TARBALL)
+
+build_force:
+ $(RM) $(R_OUTDIR)/$(PKG_TARBALL)
+ $(MAKE) install
+
+# Make sure the tarball is readable
+build_fix: $(R_OUTDIR)/$(PKG_TARBALL)
+ifeq ($(OS), Windows_NT)
+ ifeq ($(USERNAME), hb)
+ $(MKDIR) X:/tmp/$(R_VERSION_FULL)
+ $(CP) -f $< X:/tmp/$(R_VERSION_FULL)/
+ $(RM) $<
+ $(MV) X:/tmp/$(R_VERSION_FULL)/$(<F) $<
+ endif
+endif
+
+build_fast: $(PKG_FILES)
+ $(MKDIR) $(R_OUTDIR)
+ $(RM) $@
+ $(CD) $(R_OUTDIR);\
+ $(R) $(R_NO_INIT) CMD build --keep-empty-dirs --no-build-vignettes --no-manual --no-resave-data --compact-vignettes="no" $(R_BUILD_OPTS) $(PKG_DIR)
+
+build: $(R_OUTDIR)/$(PKG_TARBALL)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Install on current system
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+$(R_LIBS_USER_X)/$(PKG_NAME)/DESCRIPTION: $(R_OUTDIR)/$(PKG_TARBALL) build_fix
+ $(CD) $(R_OUTDIR);\
+ $(R) --no-init-file CMD INSTALL $(PKG_TARBALL)
+
+install: $(R_LIBS_USER_X)/$(PKG_NAME)/DESCRIPTION
+
+install_force:
+ $(RM) $(R_LIBS_USER_X)/$(PKG_NAME)/DESCRIPTION
+ $(MAKE) install
+
+install_fast:
+ $(CD) $(R_OUTDIR);\
+ $(R) --no-init-file CMD INSTALL --no-docs --no-multiarch --no-byte-compile --no-test-load $(PKG_TARBALL)
+
+
+$(R_LIBS_BRANCH)/$(PKG_NAME)/DESCRIPTION: $(R_OUTDIR)/$(PKG_TARBALL) build_fix
+ $(CD) $(R_OUTDIR);\
+ $(MKDIR) $(R_LIBS_BRANCH);\
+ $(R) --no-init-file CMD INSTALL --library=$(R_LIBS_BRANCH) $(PKG_TARBALL)
+
+install_branch: $(R_LIBS_BRANCH)/$(PKG_NAME)/DESCRIPTION
+
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Check source tarball
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+$(R_CHECK_OUTDIR)/.check.complete: $(R_OUTDIR)/$(PKG_TARBALL) build_fix
+ $(CD) $(R_OUTDIR);\
+ $(RM) -r $(PKG_NAME).Rcheck;\
+ export _R_CHECK_CRAN_INCOMING_=$(_R_CHECK_CRAN_INCOMING_);\
+ export _R_CHECK_CRAN_INCOMING_USE_ASPELL_=$(HAS_ASPELL);\
+ export _R_CHECK_XREFS_REPOSITORIES_=$(_R_CHECK_XREFS_REPOSITORIES_);\
+ export _R_CHECK_DOT_INTERNAL_=1;\
+ export _R_CHECK_USE_CODETOOLS_=1;\
+ export _R_CHECK_FORCE_SUGGESTS_=0;\
+ export R_RD4PDF=$(R_RD4PDF);\
+ export _R_CHECK_FULL_=$(_R_CHECK_FULL_);\
+ $(R) --no-init-file CMD check $(R_CHECK_OPTS) $(PKG_TARBALL);\
+ echo done > $(PKG_NAME).Rcheck/.check.complete
+
+check: $(R_CHECK_OUTDIR)/.check.complete
+
+check_force:
+ $(RM) -r $(R_CHECK_OUTDIR)
+ $(MAKE) check
+
+clang:
+ clang -c -pedantic -Wall -I$(R_INCLUDE) src/*.c
+ $(RM) *.o
+
+clang-ubsan:
+ clang -fsanitize=undefined -I$(R_INCLUDE) -c src/*.c
+ $(RM) *.o
+
+valgrind_scan:
+ grep -E "^==.*==[ ]+(at|by) 0x" $(R_CHECK_OUTDIR)/tests*/*.Rout | cat
+ grep "^==.* ERROR SUMMARY:" $(R_CHECK_OUTDIR)/tests*/*.Rout | grep -v -F "ERROR SUMMARY: 0 errors" | cat
+
+valgrind:
+ export _R_CHECK_USE_VALGRIND_=TRUE;\
+ $(MAKE) check_force
+ $(MAKE) valgrind_scan
+
+# Check the line width of incl/*.(R|Rex) files [max 100 chars in R devel]
+check_Rex:
+ $(R_SCRIPT) -e "if (!file.exists('incl')) quit(status=0); setwd('incl/'); fs <- dir(pattern='[.](R|Rex)$$'); ns <- sapply(fs, function(f) max(nchar(readLines(f)))); ns <- ns[ns > 100]; print(ns); if (length(ns) > 0L) quit(status=1)"
+
+
+covr:
+ $(R_SCRIPT) -e "source('.covr.R'); covr::shine(covr)"
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Install and build binaries
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+$(R_OUTDIR)/$(PKG_ZIP): $(R_OUTDIR)/$(PKG_TARBALL) build_fix
+ $(CD) $(R_OUTDIR);\
+ $(R) --no-init-file CMD INSTALL --build --merge-multiarch $(PKG_TARBALL)
+
+binary: $(R_OUTDIR)/$(PKG_ZIP)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Build Rd help files from Rdoc comments
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+rox:
+ $(R_SCRIPT) -e "roxygen2::roxygenize()"
+
+Rd: check_Rex
+ $(R_SCRIPT) -e "setwd('..'); Sys.setlocale(locale='C'); R.oo::compileRdoc('$(PKG_NAME)', path='$(PKG_DIR)')"
+
+%.Rd:
+ $(R_SCRIPT) -e "setwd('..'); Sys.setlocale(locale='C'); R.oo::compileRdoc('$(PKG_NAME)', path='$(PKG_DIR)', '$*.R')"
+
+missing_Rd:
+ $(R_SCRIPT) -e "x <- readLines('$(R_CHECK_OUTDIR)/00check.log'); from <- grep('Undocumented code objects:', x)+1; if (length(from) > 0L) { to <- grep('All user-level objects', x)-1; x <- x[from:to]; x <- gsub('^[ ]*', '', x); x <- gsub('[\']', '', x); cat(x, sep='\n', file='999.missingdocs.txt'); }"
+
+spell_Rd:
+ $(R_SCRIPT) -e "f <- list.files('man', pattern='[.]Rd$$', full.names=TRUE); utils::aspell(f, filter='Rd')"
+
+
+spell_NEWS:
+ $(R_SCRIPT) -e "utils::aspell('$(FILES_NEWS)')"
+
+spell:
+ $(R_SCRIPT) -e "utils::aspell('DESCRIPTION', filter='dcf')"
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Build package vignettes
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+$(R_OUTDIR)/vigns: install
+ $(MKDIR) $(R_OUTDIR)/vigns/$(shell dirname $(DIR_VIGNS))
+ $(CP) DESCRIPTION $(R_OUTDIR)/vigns/
+ $(CP) -r $(DIR_VIGNS) $(R_OUTDIR)/vigns/$(shell dirname $(DIR_VIGNS))
+ $(CD) $(R_OUTDIR)/vigns;\
+ $(R_SCRIPT) -e "v <- tools::buildVignettes(dir='.'); file.path(getwd(), v[['outputs']])"
+
+vignettes: $(R_OUTDIR)/vigns
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Run package tests
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+$(R_OUTDIR)/tests/%.R: $(FILES_TESTS)
+ $(RMDIR) $(R_OUTDIR)/tests
+ $(MKDIR) $(R_OUTDIR)/tests
+ $(CP) $? $(R_OUTDIR)/tests
+
+test_files: $(R_OUTDIR)/tests/*.R
+
+test: $(R_OUTDIR)/tests/%.R
+ $(CD) $(R_OUTDIR)/tests;\
+ $(R_SCRIPT) -e "for (f in list.files(pattern='[.]R$$')) { print(f); source(f, echo=TRUE) }"
+
+test_full: $(R_OUTDIR)/tests/%.R
+ $(CD) $(R_OUTDIR)/tests;\
+ export _R_CHECK_FULL_=TRUE;\
+ $(R_SCRIPT) -e "for (f in list.files(pattern='[.]R$$')) { print(f); source(f, echo=TRUE) }"
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Benchmarking
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+R_branch:
+ R_LIBS="$(R_LIBS_USER_X)$(FSEP)$(R_LIBS)" R_LIBS_USER="$(R_LIBS_BRANCH)" $(R)
+
+benchmark:
+ $(MKDIR) .benchmark/$(PKG_VERSION);\
+ $(CD) .benchmark/$(PKG_VERSION);\
+ $(R_SCRIPT) -e "$(PKG_NAME):::benchmark('index')"
+
+benchmark_branch:
+ $(MKDIR) .benchmark/$(PKG_VERSION)_$(GIT_BRANCH)_$(GIT_COMMIT);\
+ $(CD) .benchmark/$(PKG_VERSION)_$(GIT_BRANCH)_$(GIT_COMMIT);\
+ R_LIBS="$(R_LIBS_USER_X)$(FSEP)$(R_LIBS)" R_LIBS_USER="$(R_LIBS_BRANCH)" $(R_SCRIPT) -e "$(PKG_NAME):::benchmark('index')"
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Miscellaneous development tools
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+## Fully expanded src/*.c files
+.devel/src/%: src/% $(FILES_SRC)
+ $(MKDIR) .devel/src/;\
+ gcc -I$(R_INCLUDE) -E $< | sed -e '/./b' -e :n -e 'N;s/\n$$//;tn' > .devel/$<
+
+.devel/src/all: $(FILES_SRC)
+ for f in $(FILES_SRC_C); do\
+ echo $$f;\
+ $(MAKE) .devel/$$f;\
+ done
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Run extensive CRAN submission checks
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+$(R_CRAN_OUTDIR)/$(PKG_TARBALL): $(R_OUTDIR)/$(PKG_TARBALL) build_fix
+ $(MKDIR) $(R_CRAN_OUTDIR)
+ $(CP) $(R_OUTDIR)/$(PKG_TARBALL) $(R_CRAN_OUTDIR)
+
+$(R_CRAN_OUTDIR)/$(PKG_NAME),EmailToCRAN.txt: $(R_CRAN_OUTDIR)/$(PKG_TARBALL)
+ $(CD) $(R_CRAN_OUTDIR);\
+ $(R_SCRIPT) -e "RCmdCheckTools::testPkgsToSubmit(delta=2/3)"
+
+cran_setup: $(R_CRAN_OUTDIR)/$(PKG_TARBALL)
+ $(R_SCRIPT) -e "if (!nzchar(system.file(package='RCmdCheckTools'))) { source('http://aroma-project.org/hbLite.R'); hbLite('RCmdCheckTools', devel=TRUE); }"
+
+cran: cran_setup $(R_CRAN_OUTDIR)/$(PKG_NAME),EmailToCRAN.txt
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Send to win-builder server
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+WIN_BUILDER = win-builder.r-project.org
+win-builder-devel: $(R_OUTDIR)/$(PKG_TARBALL)
+ curl -v -T $? ftp://anonymous@$(WIN_BUILDER)/R-devel/
+
+win-builder-release: $(R_OUTDIR)/$(PKG_TARBALL)
+ curl -v -T $? ftp://anonymous@$(WIN_BUILDER)/R-release/
+
+win-builder: win-builder-devel win-builder-release
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Local repositories
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ifeq ($(OS), Windows_NT)
+REPOS_PATH = T:/My\ Repositories/braju.com/R
+else
+REPOS_PATH = /tmp/hb/repositories/braju.com/R
+endif
+REPOS_SRC := $(REPOS_PATH)/src/contrib
+
+$(REPOS_SRC):
+ $(MKDIR) "$@"
+
+$(REPOS_SRC)/$(PKG_TARBALL): $(R_OUTDIR)/$(PKG_TARBALL) $(REPOS_SRC)
+ $(CP) $(R_OUTDIR)/$(PKG_TARBALL) $(REPOS_SRC)
+
+repos: $(REPOS_SRC)/$(PKG_TARBALL)
+
+Makefile: $(FILES_MAKEFILE)
+ $(R_SCRIPT) -e "d <- 'Makefile'; s <- '../../Makefile'; if (file_test('-nt', s, d) && (regexpr('Makefile for R packages', readLines(s, n=1L)) != -1L)) file.copy(s, d, overwrite=TRUE)"
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Refresh
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.make/Makefile:
+ $(R_SCRIPT) -e "R.utils::downloadFile('https://raw.githubusercontent.com/HenrikBengtsson/r-package-files/master/.make/Makefile', path='.make/')"
+
+.make/.travis.yml.rsp:
+ $(R_SCRIPT) -e "R.utils::downloadFile('https://raw.githubusercontent.com/HenrikBengtsson/r-package-files/master/.make/.travis.yml.rsp', path='.make/')"
+
+.make/appveyor.yml.rsp:
+ $(R_SCRIPT) -e "R.utils::downloadFile('https://raw.githubusercontent.com/HenrikBengtsson/r-package-files/master/.make/appveyor.yml.rsp', path='.make/')"
+
+.make/README.md.rsp:
+ $(R_SCRIPT) -e "R.utils::downloadFile('https://raw.githubusercontent.com/HenrikBengtsson/r-package-files/master/.make/README.md.rsp', path='.make/')"
+
+.covr.R:
+ $(R_SCRIPT) -e "R.utils::downloadFile('https://raw.githubusercontent.com/HenrikBengtsson/covr-utils/master/.covr.R')"
+
+clean:
+ $(RM) .make/.travis.yml.rsp .make/appveyor.yml.rsp .make/README.md.rsp .covr.R
+ $(RM) covr-utils.R
+
+refresh: clean
+ $(MAKE) --silent .make/.travis.yml.rsp
+ $(MAKE) --silent .make/appveyor.yml.rsp
+ $(MAKE) --silent .make/README.md.rsp
+ $(MAKE) --silent .covr.R
+ $(R_SCRIPT) -e "R.utils::downloadFile('https://raw.githubusercontent.com/HenrikBengtsson/r-package-files/master/.make/Makefile', path='.make/', skip=FALSE)"
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# GitHub, Travis CI, ...
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+README.md: .make/README.md.rsp
+ $(R_SCRIPT) -e "R.rsp::rfile('$<', postprocess=FALSE)"
+
+.travis.yml: .make/.travis.yml.rsp
+ $(R_SCRIPT) -e "R.rsp::rfile('$<', postprocess=FALSE)"
+
+appveyor.yml: .make/appveyor.yml.rsp
+ $(R_SCRIPT) -e "R.rsp::rfile('$<', postprocess=FALSE)"
+
+config: .travis.yml appveyor.yml README.md
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..117a3e2
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,48 @@
+#----------------------------------------------------------------
+# Travis-CI configuration for R packages
+#
+# REFERENCES:
+# * Travis CI: https://docs.travis-ci.com/user/languages/r
+# * covr: https://github.com/jimhester/covr
+#
+# Validate your .travis.yml file at http://lint.travis-ci.org/
+#----------------------------------------------------------------
+language: r
+sudo: false
+cache: packages
+warnings_are_errors: false
+r_check_args: --as-cran
+
+matrix:
+ include:
+ - os: linux
+ r: oldrel
+ r_packages:
+ - survival
+ - os: linux
+ r: release
+ r_packages:
+ - survival
+ r_github_packages:
+ - jimhester/covr
+ after_success:
+ - Rscript -e 'covr::codecov(quiet=FALSE)'
+ env: NB='w/ covr' ## Just a label
+ - os: linux
+ r: devel
+ - os: osx
+ r: oldrel
+ r_github_packages:
+ - HenrikBengtsson/R.devices
+ - os: osx
+ r: release
+ r_github_packages:
+ - HenrikBengtsson/R.devices
+
+bioc_packages:
+ - BiocInstaller
+
+notifications:
+ email:
+ on_success: change
+ on_failure: change
diff --git a/CONDUCT.md b/CONDUCT.md
new file mode 100644
index 0000000..9c1c621
--- /dev/null
+++ b/CONDUCT.md
@@ -0,0 +1,74 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level of experience,
+nationality, personal appearance, race, religion, or sexual identity and
+orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/DESCRIPTION b/DESCRIPTION
index d07507c..1a1c6db 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,14 +1,31 @@
Package: PSCBS
-Version: 0.61.0
-Depends: R (>= 3.1.2), utils
-Imports: R.methodsS3 (>= 1.7.0), R.oo (>= 1.19.0), R.utils (>= 2.2.0),
- R.cache (>= 0.12.0), matrixStats (>= 0.50.1), DNAcopy (>=
- 1.40.0), listenv (>= 0.6.0), future (>= 0.11.0), parallel
-Suggests: Hmisc (>= 3.16-0), R.rsp (>= 0.21.0), R.devices (>= 2.13.2),
- ggplot2 (>= 1.0.1), aroma.light (>= 2.2.1)
-SuggestsNote: BioC (>= 3.0), Recommended: Hmisc, aroma.light
+Version: 0.62.0
+Depends:
+ R (>= 3.1.2),
+ utils
+Imports:
+ R.methodsS3 (>= 1.7.1),
+ R.oo (>= 1.21.0),
+ R.utils (>= 2.5.0),
+ R.cache (>= 0.12.0),
+ matrixStats (>= 0.51.0),
+ DNAcopy (>= 1.40.0),
+ listenv (>= 0.6.0),
+ future (>= 1.1.1),
+ parallel
+Suggests:
+ Hmisc (>= 3.16-0),
+ R.rsp (>= 0.30.0),
+ R.devices (>= 2.15.0),
+ ggplot2 (>= 1.0.1),
+ aroma.light (>= 2.2.1)
+SuggestsNote:
+ BioC (>= 3.0),
+ Recommended:
+ Hmisc,
+ aroma.light
VignetteBuilder: R.rsp
-Date: 2016-02-03
+Date: 2016-11-10
Title: Analysis of Parent-Specific DNA Copy Numbers
Authors at R: c(
person("Henrik", "Bengtsson", role=c("aut", "cre", "cph"),
@@ -22,18 +39,6 @@ Description: Segmentation of allele-specific DNA copy number data and detection
License: GPL (>= 2)
LazyLoad: TRUE
ByteCompile: TRUE
-biocViews: aCGH, CopyNumberVariants, SNP, Microarray, OneChannel,
- TwoChannel, Genetics
+biocViews: aCGH, CopyNumberVariants, SNP, Microarray, OneChannel, TwoChannel, Genetics
URL: https://github.com/HenrikBengtsson/PSCBS
BugReports: https://github.com/HenrikBengtsson/PSCBS/issues
-NeedsCompilation: no
-Packaged: 2016-02-04 00:30:07 UTC; hb
-Author: Henrik Bengtsson [aut, cre, cph],
- Pierre Neuvial [aut],
- Venkatraman E. Seshan [aut],
- Adam B. Olshen [aut],
- Paul T. Spellman [aut],
- Richard A. Olshen [aut]
-Maintainer: Henrik Bengtsson <henrikb at braju.com>
-Repository: CRAN
-Date/Publication: 2016-02-04 11:27:36
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644
index 0000000..06ab572
--- /dev/null
+++ b/INSTALL.md
@@ -0,0 +1,39 @@
+<% if (git_branch() == "develop") { %>
+## Parallel processing
+The package supports segmentation of the chromosomes in parallel
+(asynchronously) via [futures](https://cran.r-project.org/package=future)
+by adding the following
+```r
+future::plan("multiprocess")
+```
+to the beginning of the PSCBS script. Everything else will work the
+same. To reset to non-parallel (synchronously) processing, use
+`future::plan("eager")`.
+
+To configure this automatically whenever the package is loaded, see
+future vignette '[A Future for R: Controlling Default Future Strategy](https://cran.r-project.org/web/packages/future/vignettes/future-4-startup.html)'.
+<% } %>
+
+
+## Installation
+R package <%=pkg()%> is available on [CRAN](http://cran.r-project.org/package=<%=pkg()%>) and can be installed in R as:
+```r
+install.packages('<%=pkg()%>')
+```
+
+<% if (git_branch() != "master" && !grepl("^release/", git_branch())) { %>
+### Pre-release version
+
+To install the pre-release version that is available in branch `<%=git_branch()%>`, use:
+```r
+source('http://callr.org/install#<%=github_repos()%>@<%=git_branch()%>')
+```
+This will install the package from source. <% if (file.exists("src")) { %><%-%>
+Because of this and because this package also compiles native code,
+Windows users need to have
+[Rtools](https://cran.r-project.org/bin/windows/Rtools/) installed and
+OS X users need to have [Xcode](https://developer.apple.com/xcode/)
+installed.
+<% } # if (file.exists("src")) %>
+
+<% } # if (git_branch() != "master") %>
diff --git a/MD5 b/MD5
deleted file mode 100644
index a51a65c..0000000
--- a/MD5
+++ /dev/null
@@ -1,209 +0,0 @@
-1c3cb60a72fee9551934991351966569 *DESCRIPTION
-370db02a92db2b1e277e6d65aa92ef8f *NAMESPACE
-9b2d8b534aae419758c34be2915169a2 *NEWS
-5b3e0291bcc049d9ada9005162c5259a *R/000.R
-3e3dabecfb506b75e8e24743c5336630 *R/006.fixVarArgs.R
-93c57de5b16270cd0c7bbbe4de701afc *R/999.DEPRECATED.R
-dcb0e44d79e9859ee6006eb8c70b2837 *R/999.NonDocumentedObjects.R
-b9a22d7a3d629919b925558646512bf1 *R/999.package.R
-7d23ca0a5c853711bc616038cac8c72c *R/AbstractCBS.HCLUST.R
-42b2df2eaa3f0ee53e9107a25f0611df *R/AbstractCBS.PLOT.R
-a915b95818abe4652355c944d6b04963 *R/AbstractCBS.PRUNE.R
-233376f492d5dcdc6c85da87a3f6b7bc *R/AbstractCBS.R
-08250793df9a159d63a1e7adb635fd78 *R/AbstractCBS.REPORT.R
-cfd4ed80039034ecc2af3f1938210e64 *R/AbstractCBS.RESTRUCT.R
-172afe9107992b6a440aff2423dff4f7 *R/AbstractCBS.clearCalls.R
-b4e141bd292d96186c15ab62fccb4c4d *R/CBS.CALL.R
-ca86e31fe1a32e7d30d84d585e4d0160 *R/CBS.EXTS.R
-3c0853753de1a1c3f330d6d587a08c19 *R/CBS.IO.R
-4fa84d97b3568c0b80b39368f1afe730 *R/CBS.PLOT,many.R
-b7d874d9e15ba5cf30764c6a0ececf90 *R/CBS.PLOT.R
-665fd7d0139647f0ba86219ebf4ec694 *R/CBS.PRUNE.R
-06674bc847e8a00addfbfce9141e0f4b *R/CBS.R
-68a889a49937d29e84a7a37da6302daf *R/CBS.RESTRUCT.R
-6cbb38b5afda180074d6e7ae6944f1c2 *R/CBS.SMOOTH.R
-e32f90f662ac61156143354aa1b7ce91 *R/CBS.joinSegments.R
-6c28fb753c160132793c26ae474c36c6 *R/CBS.updateMeansTogether.R
-ed080a928098a7ee721079af992f640c *R/CNA.EXTS.R
-60584ffa1b46f3eb210bc366f802cef9 *R/DNAcopy.EXTS.R
-f69b8289ad106512524734731ed10ef0 *R/NonPairedPSCBS.R
-07f118d9fd7942687f57c76e3c4f78a3 *R/PSCBS.IO.R
-39633082d3a2008d3a425fe542f45b5e *R/PSCBS.R
-094569b0a307b6fee63b8df5859c4823 *R/PSCBS.RESTRUCT.R
-2aee730ac2c4fd29f7da91460874244a *R/PairedPSCBS.BOOT.R
-09218dbad6b5910924ad3adf409b9c92 *R/PairedPSCBS.BOOT.sets.R
-dc3ed47c532e07bb9d6a1735eea17649 *R/PairedPSCBS.CALL.R
-ba9eb33970f87d4b2cad0f8a63477d1c *R/PairedPSCBS.EXTS.R
-32b2f5f0dc98d1499078587125d93677 *R/PairedPSCBS.EXTS3.R
-6148b9f7479104b15576305fb3f79368 *R/PairedPSCBS.PLOT,many.R
-9a978662971fb8540f279f46be0a3fde *R/PairedPSCBS.PLOT.R
-1d77fd8262388a4bc0bb2d91ca80da9f *R/PairedPSCBS.PLOT2.R
-fcc580134d46f0a28634b758cdcc4123 *R/PairedPSCBS.PRUNE.R
-3012ab041d9f32d1ae3e2bac5bd121a2 *R/PairedPSCBS.R
-b7279b6199cf9b15d8376216a6f5be1d *R/PairedPSCBS.RESTRUCT.R
-7f1f261b929a85ea961e410d79cdcf67 *R/PairedPSCBS.applyByRegion.R
-695e0ebc76969b3b2fdbbe659fbb118c *R/PairedPSCBS.callAB.R
-148df4c8641d5b1cc4d678dde265309f *R/PairedPSCBS.callCopyNeutral.R
-43802ae29941da7fca08656bf76da171 *R/PairedPSCBS.callGNL.R
-c85b32a324461b8e96ef01ae33b0b6c1 *R/PairedPSCBS.callLOH.R
-34b3a002ba7c9d82881d7f47eb52bb42 *R/PairedPSCBS.callROH.R
-0b6606842467cd1f6e4b58ade02a9e21 *R/PairedPSCBS.estimateDeltaAB.R
-dc6744d8ae34728ab082853ef9fdaac2 *R/PairedPSCBS.estimateDeltaLOH.R
-444cd179dbe63fad8b592f4bbbde0807 *R/PairedPSCBS.estimateKappa.R
-554526631ab6736c85fe19089a7e86ea *R/PairedPSCBS.extractSegmentDataByLocus.R
-16ff2709a944fcf57934b9f98d6ab39b *R/PairedPSCBS.unTumorBoost.R
-194851b8b34d0355023052ad37603bcb *R/PairedPSCBS.updateMeans.R
-4e7eadf16edd24efbbf3668274a26a6a *R/PairedPSCBS.updateMeansTogether.R
-edadbbad243b8fc4687986417aa6944a *R/callSegmentationOutliers.R
-4d7a3c9ebe2cc59bc8bbdeda9d4c13d0 *R/drawLevels.DNAcopy.R
-0119fe08cdec28314ae4abfa7669dffc *R/exampleData.R
-b8d3de9af9b4ff8bb516c8c430a4b28e *R/findLargeGaps.R
-4e8025349a3933694913a4f784162692 *R/findNeutralCopyNumberState.R
-6668141241a50eb225890ca7cce13a7d *R/gapsToSegments.R
-d48f6ff09d630cac23b3db8d5819e216 *R/installDNAcopy.R
-71483b466dfb355f14ad5d4ce9ed0233 *R/prememoize.R
-9bd61b757a7ce40f2dc5288c91e62a63 *R/randomSeed.R
-23fa04ac04fee4899ed62501caed3422 *R/segmentByCBS.R
-da90c04cddc9f3d4c7253ddadf83d9fc *R/segmentByNonPairedPSCBS.R
-50c70103f3973c210b15c177046a958b *R/segmentByPairedPSCBS.R
-7d1907ae7ab66a48b4eded1d496b277b *R/testROH.R
-acea5de06a39f1fa395f67b8cb4700a3 *R/weightedQuantile.R
-08127f8c76110ee2407c9841533e08db *R/writeWIG.R
-10b3fd7f2f6a84cb0f16a75609f1a5ff *R/zzz.R
-9768f2f0def0fbcf1ca1bd7e7fa693b1 *build/vignette.rds
-a1ff7cb79a888bb3032d330227f179e0 *inst/CITATION
-14659728b7be1bb8e37e953a87060e6c *inst/data-ex/PairedPSCBS,exData,chr01.Rbin
-ee696a0e37a95e63c90f466a0fe7c663 *inst/doc/CBS.R
-533a89cf1fa4fe5ab790e3d423aec031 *inst/doc/CBS.pdf
-fe36d40a38d3201214ce662d4271b9df *inst/doc/CBS.tex.rsp
-6c46948f6e05e07e8f621aff3082fcac *inst/doc/PairedPSCBS.R
-5f5aded9937a1d2d9051daf8836ccf0a *inst/doc/PairedPSCBS.pdf
-4f1745be74ffe7b192c632445b6af5b5 *inst/doc/PairedPSCBS.tex.rsp
-56e6435959f6387651a30e915e54baab *inst/misc/_Rcache/PSCBS/segmentByCBS/sbdry/0109d43cd74c8e7e46db1abde235c808.Rcache
-17a5a6d6c343e587021f5e4c7c3ec97e *inst/misc/_Rcache/PSCBS/segmentByCBS/sbdry/2aba5b85ae757609b8b4c9fc60be1156.Rcache
-2006584e8845904693aed6fa9008235c *inst/templates/rsp/CBS,report.tex.rsp
-f605500742f015ae26c455b37fcc18b8 *inst/templates/rsp/NonPairedPSCBS,report.tex.rsp
-008dcc209acfd836649040fa600adbda *inst/templates/rsp/PSCBS.bib
-5c55c6de78ff35d48049b47a3e8e58f9 *inst/templates/rsp/PairedPSCBS,report.tex.rsp
-f01bbc88ade170e0dcb4c76fac17fe7d *inst/templates/rsp/bioinformatics-journals-abbr.bib
-5146f637b61e03ac550811e9d46de420 *inst/templates/rsp/includes/levelDensities.tex.rsp
-2d2c639e0d72962658f270675cccbf0b *inst/templates/rsp/includes/pscnSegmentationTracks.tex.rsp
-c72a4a967345e999cccdaeb0b072d01d *inst/templates/rsp/includes/pscnSegmentationTransitions.tex.rsp
-860859b29771b6fade80e4d0cebc59d6 *inst/templates/rsp/includes/references.tex.rsp
-7885a06ef57438e704c0d9d35dddc716 *inst/templates/rsp/includes/reportHeader.tex.rsp
-9a68af6ca781e60d82670869008ffe33 *inst/templates/rsp/includes/reportSetupGraphics.tex.rsp
-7615fd0b844f872869b4afb3bbdfd1bb *inst/templates/rsp/includes/reportSetupMacros.tex.rsp
-9b2e313a0483afa2ca60cc616434679f *inst/templates/rsp/includes/sessionInfo.tex.rsp
-9a88214a9db5b94992ea733bb8c6157f *inst/templates/rsp/includes/signalDensities.tex.rsp
-4cb7c97012df4c618f08acd20cf1ca63 *inst/templates/rsp/includes/summaryOfAnnotationAndGenotypeCalls.tex.rsp
-f3907cf5bef1f44c8c15558e94274a18 *inst/templates/rsp/natbib.bst
-95e5d2a8dbcc9288cc9a7f2e7fa99576 *man/AbstractCBS.Rd
-267605563ea772f416f2269b6b5d2223 *man/CBS.Rd
-287ea3c335f3c0f133f4237a6e7945ee *man/Non-documented_objects.Rd
-e12e9370d0c22d5beed4cccbfe646f7d *man/NonPairedPSCBS.Rd
-ab0330aa3eae8000ef333c9e41582efb *man/PSCBS-package.Rd
-a1f2de960f6581ff3558516a3af4da15 *man/PSCBS.Rd
-5939644c31ef19397552defc37b2232e *man/PairedPSCBS.Rd
-59ae340fe4e3a601d59da4702ec144fb *man/Restructuring_AbstractCBS_objects.Rd
-1f0aab8f0fac7a13036fe42b11d647fe *man/append.AbstractCBS.Rd
-0e47e730083c1af44f4378fa3329807d *man/append.CBS.Rd
-e79d626f47c80e89160221840e45b01c *man/append.PSCBS.Rd
-e534107eb35ccbb5e59093d2acf6e32c *man/as.CBS.DNAcopy.Rd
-22ce4b8908c97ccb56a0f134510bffc3 *man/as.DNAcopy.CBS.Rd
-a6cb223758bc39c5d9ca4e7157c410dd *man/as.data.frame.AbstractCBS.Rd
-53f2d1c6fc28166ff5cb62e476fea136 *man/as.data.frame.CBS.Rd
-bd714c1f380fd2889fea937384d961fc *man/bootstrapTCNandDHByRegion.PairedPSCBS.Rd
-6095c6f1db04d7817485853349429489 *man/callAB.PairedPSCBS.Rd
-69c7ae7eccf16bfebf15bada46d6721c *man/callAllelicBalanceByDH.PairedPSCBS.Rd
-8a177a1d31c63dcd3e3cf1aaab45b07b *man/callAmplifications.CBS.Rd
-521539eb523296c1cf58d9364167a161 *man/callCopyNeutral.PairedPSCBS.Rd
-419ed670fb8422053a9e44a41b1eef6f *man/callCopyNeutralByTCNofAB.PairedPSCBS.Rd
-c854e68744cfc82c1fcd8b51ca857fad *man/callGNL.PairedPSCBS.Rd
-9fc634c7d99b5ad734bc1057bfcca1bb *man/callGainsAndLosses.CBS.Rd
-dc41bb1efa305ed8e10dc681bc45aa23 *man/callLOH.PairedPSCBS.Rd
-2dc88b200365c204d975e1809655af6f *man/callOutliers.CBS.Rd
-838dc240a03c12ffe3874864dcf3b22e *man/callROH.PairedPSCBS.Rd
-b347080d29b70bc29aff1ff8934a28b3 *man/callSegmentationOutliers.Rd
-af589aed4e4fcf9e491c25a16a2c5c4e *man/dropChangePoints.AbstractCBS.Rd
-c2717b3db4da9f95dd8822da6bd689d0 *man/dropRegions.AbstractCBS.Rd
-927c0252a746ca7baa3f6e70c94984ac *man/estimateDeltaAB.PairedPSCBS.Rd
-271e67da730c818170d45c7815daa4d4 *man/estimateDeltaABBySmallDH.PairedPSCBS.Rd
-a7a6086b85e2a88daf979a3e75abe993 *man/estimateDeltaLOH.PairedPSCBS.Rd
-bd5b73e4f84a670dce9a9ee060b3bafa *man/estimateDeltaLOHByMinC1ForNonAB.PairedPSCBS.Rd
-722d9be399b053a6aa85908186c66617 *man/estimateKappa.PairedPSCBS.Rd
-e25d09950c2ac2aed8932081db2dc0eb *man/estimateKappaByC1Density.PairedPSCBS.Rd
-bbca3a25a2700e1040065c966c28036c *man/estimateStandardDeviation.CBS.Rd
-a8a1368fb2e836d808ab339eec5c3bf7 *man/exampleData.Rd
-dd702d33c6c9dc7c8a61db7d8e57d7e8 *man/extractMinorMajorCNs.PairedPSCBS.Rd
-2745258268eeffe5d6f8437142a0ca7f *man/extractSegmentMeansByLocus.CBS.Rd
-da4cb348dce202b19542a681c3b0a893 *man/extractTCNAndDHs.PairedPSCBS.Rd
-9dbea07287422753ab5db54fa9b547a4 *man/findLargeGaps.Rd
-aa2f91382cb975e1886c2d0a439aba90 *man/findNeutralCopyNumberState.Rd
-3699de1bee98ca4afbbfa4b93e27175a *man/gapsToSegments.data.frame.Rd
-1bd0c24ae698ca98b9e691a6b9099a73 *man/getBootstrapLocusSets.PairedPSCBS.Rd
-c27859503bff7a18bdccdb9b900a8837 *man/getCallStatistics.CBS.Rd
-01be02b70f50acdf32af74d1095bdee8 *man/getChromosomes.AbstractCBS.Rd
-8add6b64fab13e7805e73d454c2f0226 *man/getFractionOfGenomeLost.CBS.Rd
-0c00f0a1b5c95157e300a92455e38669 *man/getLocusData.AbstractCBS.Rd
-e38e4c27a96ad64c745f9db7cb07faa4 *man/getSampleName.AbstractCBS.Rd
-6f07ef6692ece0549fcabe4e63bc8832 *man/getSegments.AbstractCBS.Rd
-6d48429ce911acae62ce59a708e623ca *man/getSegments.PSCBS.Rd
-2d45f3dfbe49462191da53f7d04341ab *man/getSmoothLocusData.CBS.Rd
-2aa35c71d6043956970e091489a23ce4 *man/hclustCNs.AbstractCBS.Rd
-12d8023e7c2f8ecc5ca76c7b14381a7a *man/installDNAcopy.Rd
-c668b9975804d67f833e671635dab54b *man/joinSegments.CBS.Rd
-280fcc003932b9bc7aea70ef5a61f74f *man/load.AbstractCBS.Rd
-3e24345d7327bf88fea8b824a582e718 *man/mergeNonCalledSegments.CBS.Rd
-cf642a455c7ca06f7072e6ce3ebb1d22 *man/mergeThreeSegments.AbstractCBS.Rd
-c50de0e05e4f82bf2f7522e2f1187aa3 *man/mergeTwoSegments.AbstractCBS.Rd
-8ea75fe5a459f8b6502e75b6f6ee6eb0 *man/mergeTwoSegments.PairedPSCBS.Rd
-8e33b404462d57fa8111ec6c17def975 *man/nbrOfChangePoints.AbstractCBS.Rd
-e1913743bcf8545b5c7f3cf9b206624d *man/nbrOfChromosomes.AbstractCBS.Rd
-b05c91b6528f5dfb200d1493523b3525 *man/nbrOfLoci.AbstractCBS.Rd
-32dc5a786239d886939b19a814ea865c *man/nbrOfSegments.AbstractCBS.Rd
-b1618d544720f032c95f6563a53fc645 *man/ploidy.AbstractCBS.Rd
-285605d73ea6b1ad80d561642b2d5644 *man/plotTracks.AbstractCBS.Rd
-8e407ed8348a1ad6e1276c7c8d9a3c41 *man/plotTracks.CBS.Rd
-17a8ae7c3d0936fdd884c1af40b0c674 *man/plotTracks.PairedPSCBS.Rd
-ae6ca7420cb0fca1837b96e407f6b0d6 *man/pruneByDP.AbstractCBS.Rd
-517f08eb913a6e8c058b0f60780fe1d2 *man/pruneByHClust.AbstractCBS.Rd
-013127e4dfd9584ce18c9b246c713b50 *man/pruneBySdUndo.CBS.Rd
-0cc1a3f744dae1ca53c07f4fb61e91e6 *man/randomSeed.Rd
-6ac688a354724df8e0b3c5110949ca21 *man/report.AbstractCBS.Rd
-88b05c630f8af9a2437df4a846bab343 *man/resetSegments.AbstractCBS.Rd
-c5008992920a8e9f86507297712cdfb1 *man/save.AbstractCBS.Rd
-54783f9dba18d63f9f20a8d717109689 *man/segmentByCBS.Rd
-b3fb1177bdb0fc8680745b9315392ad9 *man/segmentByNonPairedPSCBS.Rd
-92577da258a8b83cb775754eb87db6d7 *man/segmentByPairedPSCBS.Rd
-4c4181efced223c39066439f8741c498 *man/setSampleName.AbstractCBS.Rd
-6e9676b9f9825c488bdf96d410cc9539 *man/testROH.numeric.Rd
-e9dd20a0adf9def1b9523d189a35e4f6 *man/updateMeans.AbstractCBS.Rd
-79aedb4af12fb676dc87911135275281 *man/updateMeansTogether.AbstractCBS.Rd
-a39ac96df7c724ddfa623f152881e647 *man/weightedQuantile.Rd
-63a7356f7ad4433a9361ecee5ae683c2 *man/writeSegments.CBS.Rd
-c17aa26ce4bed7b08417b45882e96276 *man/writeSegments.PSCBS.Rd
-de8847124d8ea6cdaddb1f52269f10b0 *tests/PairedPSCBS,boot.R
-3f71b69684ee05fdadad22ac64da562a *tests/PairedPSCBS,plot.R.HIDE
-a20d5e74b660794a207ebee3b146e571 *tests/findLargeGaps.R
-4f1a9d8d791a7a899eb18e19b56a98ca *tests/randomSeed.R
-41267a6a75014b780037272409dcf4a4 *tests/segmentByCBS,calls.R
-51f25e9c62540c68935272e50cfe34ad *tests/segmentByCBS,flavors.R.HIDE
-c38722b3734551a999899b59af206ca4 *tests/segmentByCBS,futures.R
-f04ed0148cf6f6b62c2af44ccdbdb7e4 *tests/segmentByCBS,median.R
-2237835c4c7d3019d0fb50a86efc5604 *tests/segmentByCBS,prune.R
-31fc411fec814fe4d12ff9b59772c9d0 *tests/segmentByCBS,report.R
-08d09f321e3267db055017c2164d7691 *tests/segmentByCBS,shiftTCN.R
-4770dcbd22a8f1f0aa7ec339059eda83 *tests/segmentByCBS,weights.R
-b6b41f53af25eb3d23d9423b3b18386c *tests/segmentByCBS.R
-065319c9e5582cb4b5c7ea4b9bbbc793 *tests/segmentByNonPairedPSCBS,medianDH.R
-d8cd7bdf20f657bcc393c55c7bce382e *tests/segmentByPairedPSCBS,DH.R
-d03756cf4f3124b51ddc4b1a7ee224ff *tests/segmentByPairedPSCBS,calls.R
-6dab868872280d879b4e27a91c403b10 *tests/segmentByPairedPSCBS,futures.R
-b5297118f74861f14db49b1a53eb4d73 *tests/segmentByPairedPSCBS,noNormalBAFs.R
-f548d6f682c19df3fb6e5872dff37686 *tests/segmentByPairedPSCBS,report.R
-5e2e0e0355667f0e403ae854ed6292b2 *tests/segmentByPairedPSCBS,seqOfSegmentsByDP.R
-f0aeff863889c75b9ffbdcf1fe675724 *tests/segmentByPairedPSCBS.R
-fe36d40a38d3201214ce662d4271b9df *vignettes/CBS.tex.rsp
-9570b3efb4e27043b33dd71622f38ebe *vignettes/PSCBS.bib
-4f1745be74ffe7b192c632445b6af5b5 *vignettes/PairedPSCBS.tex.rsp
-f3907cf5bef1f44c8c15558e94274a18 *vignettes/natbib.bst
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..522a371
--- /dev/null
+++ b/Makefile
@@ -0,0 +1 @@
+include .make/Makefile
diff --git a/NAMESPACE b/NAMESPACE
index bd16401..6c6aa7d 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -58,7 +58,7 @@ importFrom("utils",
"packageDescription")
importFrom("listenv", "listenv")
-importFrom("future", "%<=%")
+importFrom("future", "%<-%")
importFrom("parallel", "nextRNGStream")
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -76,6 +76,7 @@ export("load") # Re-export from R.oo
# From 006.fixVarArgs.R
S3method("append", "default")
+
# AbstractCBS
S3method("adjustPloidyScale", "AbstractCBS")
S3method("all.equal", "AbstractCBS")
@@ -114,6 +115,8 @@ S3method("nbrOfChangePoints", "AbstractCBS")
S3method("nbrOfChromosomes", "AbstractCBS")
S3method("nbrOfLoci", "AbstractCBS")
S3method("nbrOfSegments", "AbstractCBS")
+S3method("normalizeTotalCNs", "AbstractCBS")
+S3method("normalizeTotalCNs", "PSCBS")
S3method("ploidy", "AbstractCBS")
S3method("ploidy<-", "AbstractCBS")
S3method("plotTracks", "AbstractCBS")
diff --git a/NEWS b/NEWS
index 8b7bf0f..d820a7e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,12 +1,22 @@
Package: PSCBS
==============
+Version: 0.62.0 [2016-11-10]
+o Added normalizeTotalCNs() for PSCBS objects.
+o REPORTS: Updated report template for PairedPSCBS object such
+ that reports are also generated from DH-only data, i.e. when
+ there are no BAF signals (which may happen with DNA-Seq data).
+o Added splitters=TRUE as the default for setSegments().
+o CLEANUP: Minor internal cleanup and restructuring.
+
+
+
Version: 0.61.0 [2016-02-03]
o Package now requires R (>= 3.1.2) released October 2014, because
of its dependency on the listenv package.
o segmentByPairedPSCBS() gained argument 'rho' for paired PSCBS
segmentation on total CNs (TCNs) and decrease-of-heterozygosity
- signals (DHs) as an alternative to for instance TCN and
+ signals (DHs) as an alternative to for instance TCN and
allele B fractions (BAFs).
o BUG FIX: Segmentation using futures where not fully reproducible
when known segments where specified. Fixed by changing how the
diff --git a/R/AbstractCBS.HCLUST.R b/R/AbstractCBS.HCLUST.R
index e649004..46e6dc8 100644
--- a/R/AbstractCBS.HCLUST.R
+++ b/R/AbstractCBS.HCLUST.R
@@ -194,7 +194,7 @@ setMethodS3("pruneByHClust", "AbstractCBS", function(fit, ..., size=NULL, distMe
if (merge) {
verbose && enter(verbose, "Merging neighboring segments within each cluster");
lefts <- c();
- for (ii in seq(along=idxList)) {
+ for (ii in seq_along(idxList)) {
verbose && enter(verbose, sprintf("Cluster #%d of %d", ii, length(idxList)));
idxs <- idxList[[ii]];
verbose && cat(verbose, "Segments in cluster:");
@@ -216,7 +216,7 @@ setMethodS3("pruneByHClust", "AbstractCBS", function(fit, ..., size=NULL, distMe
verbose && enter(verbose, "Merging segments");
lefts <- rev(lefts);
- for (ii in seq(along=lefts)) {
+ for (ii in seq_along(lefts)) {
fit <- mergeTwoSegments(fit, left=lefts[ii], update=FALSE);
} # for (ii ...)
verbose && exit(verbose);
diff --git a/R/AbstractCBS.PRUNE.R b/R/AbstractCBS.PRUNE.R
index 1e1bd0d..bb78c5c 100644
--- a/R/AbstractCBS.PRUNE.R
+++ b/R/AbstractCBS.PRUNE.R
@@ -54,7 +54,7 @@ setMethodS3("seqOfSegmentsByDP", "AbstractCBS", function(fit, by, shift=+100, ..
chromosomes <- getChromosomes(fit);
fitList <- list();
- for (jj in seq(along=chromosomes)) {
+ for (jj in seq_along(chromosomes)) {
chr <- chromosomes[jj];
verbose && enter(verbose, sprintf("Chromosome #%d ('%s') of %d", jj, chr, length(chromosomes)));
@@ -85,7 +85,7 @@ setMethodS3("seqOfSegmentsByDP", "AbstractCBS", function(fit, by, shift=+100, ..
# Extract the individual known segments on this chromosome
fitListJJ <- list();
- for (kk in seq(length=nrow(knownSegmentsJJ))) {
+ for (kk in seq_len(nrow(knownSegmentsJJ))) {
verbose && enter(verbose, sprintf("Known segment #%d of %d", kk, nrow(knownSegmentsJJ)));
seg <- knownSegmentsJJ[kk,];
verbose && print(verbose, seg);
@@ -158,7 +158,7 @@ setMethodS3("seqOfSegmentsByDP", "AbstractCBS", function(fit, by, shift=+100, ..
# "DP" change-point indices (excluding the two outer/boundary ones)
segRows <- fit[[segRowsKey]];
- segIdxs <- seq(length=nrow(segRows)-1L);
+ segIdxs <- seq_len(nrow(segRows)-1L);
cpIdxs <- segRows$endRow[segIdxs];
verbose && exit(verbose);
@@ -213,14 +213,14 @@ setMethodS3("seqOfSegmentsByDP", "AbstractCBS", function(fit, by, shift=+100, ..
match(idxs, table=cpIdxs);
});
# Sanity check
- stopifnot(identical(seq(along=cpIdxs), jumpIdxList[[length(jumpIdxList)]]));
+ stopifnot(identical(seq_along(cpIdxs), jumpIdxList[[length(jumpIdxList)]]));
chrs <- segs$chromosome;
starts <- segs[[segKeys[1]]];
ends <- segs[[segKeys[2]]];
nsegs <- nrow(segs);
segList <- vector("list", length=length(jumpIdxList));
- for (kk in seq(along=segList)) {
+ for (kk in seq_along(segList)) {
verbose && enter(verbose, sprintf("Sequence #%d of %d", kk, length(segList)));
idxs <- jumpIdxList[[kk]];
verbose && cat(verbose, "Change point indices:");
diff --git a/R/AbstractCBS.R b/R/AbstractCBS.R
index 9a3735d..2878bc4 100644
--- a/R/AbstractCBS.R
+++ b/R/AbstractCBS.R
@@ -404,10 +404,10 @@ setMethodS3("nbrOfLoci", "AbstractCBS", function(fit, splitters=FALSE, ...) {
setMethodS3("getSegments", "AbstractCBS", abstract=TRUE);
-setMethodS3("setSegments", "AbstractCBS", function(fit, segments, ...) {
+setMethodS3("setSegments", "AbstractCBS", function(fit, segments, splitters=TRUE, ...) {
# Argument 'segments':
segments <- Arguments$getInstanceOf(segments, "data.frame")
- nbrOfSegs <- nbrOfSegments(fit, ...)
+ nbrOfSegs <- nbrOfSegments(fit, splitters=splitters, ...)
if (nrow(segments) != nbrOfSegs) {
throw("Cannot set segments. The number of segments to be set differ from the existing number of segments: ", nrow(segments), " != ", nbrOfSegs)
}
@@ -888,6 +888,36 @@ setMethodS3("setPloidy", "AbstractCBS", function(fit, ploidy=2L, update=TRUE, ..
setMethodS3("adjustPloidyScale", "AbstractCBS", abstract=TRUE);
+###########################################################################/**
+# @RdocMethod normalizeTotalCNs
+# @alias normalizeTotalCNs
+# @alias normalizeTotalCNs.PSCBS
+#
+# @title "Normalizes copy numbers such that the whole-genome average total copy number is two"
+#
+# \description{
+# @get "title".
+# }
+#
+# @synopsis
+#
+# \arguments{
+# \item{...}{Additional arguments passed to the normalization method.}
+# }
+#
+# \value{
+# Returns a normalized AbstractCBS object of the same class as \code{fit}.
+# }
+#
+# @author
+#
+# \seealso{
+# @seeclass.
+# }
+#*/###########################################################################
+setMethodS3("normalizeTotalCNs", "AbstractCBS", abstract=TRUE)
+
+
############################################################################
# HISTORY:
# 2013-11-05
diff --git a/R/AbstractCBS.RESTRUCT.R b/R/AbstractCBS.RESTRUCT.R
index a56f6b7..dce4c12 100644
--- a/R/AbstractCBS.RESTRUCT.R
+++ b/R/AbstractCBS.RESTRUCT.R
@@ -113,7 +113,7 @@ setMethodS3("renameChromosomes", "AbstractCBS", function(fit, from, to, ...) {
segs <- getSegments(fit, splitters=TRUE, simplify=FALSE);
knownSegments <- fit$params$knownSegments;
- for (cc in seq(length=n)) {
+ for (cc in seq_len(n)) {
chr <- from[cc];
chrN <- to[cc];
data$chromosome[data$chromosome == chr] <- chrN;
@@ -185,7 +185,7 @@ setMethodS3("extractRegions", "AbstractCBS", function(this, regions, H=1, ..., v
# Identify segments to keep
- Hs <- seq(length=H);
+ Hs <- seq_len(H);
regions <- regions - 1L;
regions <- as.list(regions);
segments <- lapply(regions, FUN=function(region) region + Hs);
@@ -454,7 +454,7 @@ setMethodS3("dropRegions", "AbstractCBS", function(this, regions, H=1, ..., asMi
}
# Identify segments to drop
- Hs <- seq(length=H);
+ Hs <- seq_len(H);
regions <- regions - 1L;
regions <- as.list(regions);
regions <- lapply(regions, FUN=function(region) region + Hs);
@@ -464,7 +464,7 @@ setMethodS3("dropRegions", "AbstractCBS", function(this, regions, H=1, ..., asMi
verbose && str(verbose, regions);
# Identify segments to keep
- allRegions <- seq(length=nbrOfSegments);
+ allRegions <- seq_len(nbrOfSegments);
keepSegments <- setdiff(allRegions, regions);
verbose && cat(verbose, "Final set of segments to be kept:");
verbose && str(verbose, keepSegments);
diff --git a/R/CBS.CALL.R b/R/CBS.CALL.R
index 1bb97f8..a89d88e 100644
--- a/R/CBS.CALL.R
+++ b/R/CBS.CALL.R
@@ -520,7 +520,7 @@ setMethodS3("callOutliers", "CBS", function(fit, adjust=1.0, method=c("ucsf-mad"
sds <- rep(naValue, times=nbrOfSegments);
naValue <- NA_real_;
- for (ss in seq(length=nbrOfSegments)) {
+ for (ss in seq_len(nbrOfSegments)) {
seg <- segs[ss,];
# Identify loci in current segment
@@ -619,7 +619,7 @@ setMethodS3("extractCallsByLocus", "CBS", function(fit, ...) {
callsL <- as.data.frame(callsL);
# For each segment...
- for (ss in seq(length=nrow(segs))) {
+ for (ss in seq_len(nrow(segs))) {
seg <- segs[ss,];
idxs <- which(chromosome == seg$chromosome &
seg$start <= x & x <= seg$end);
@@ -628,7 +628,7 @@ setMethodS3("extractCallsByLocus", "CBS", function(fit, ...) {
## stopifnot(length(idxs) == seg$nbrOfLoci);
callsSS <- seg[callCols];
- for (cc in seq(length=nbrOfCalls)) {
+ for (cc in seq_len(nbrOfCalls)) {
callsL[idxs,cc] <- callsSS[,cc];
}
} # for (ss ...)
@@ -746,7 +746,7 @@ setMethodS3("getCallStatistics", "CBS", function(fit, regions=NULL, shrinkRegion
segsT <- NULL;
verbose && cat(verbose, "Number of segments (before): ", nrow(segs));
- for (rr in seq(length=nrow(regions))) {
+ for (rr in seq_len(nrow(regions))) {
regionRR <- regions[rr,];
chrRR <- regionRR[,"chromosome"];
startRR <- regionRR[,"start"];
@@ -1021,7 +1021,7 @@ setMethodS3("getCallStatisticsByArms", "CBS", function(fit, genomeData, ...) {
regions$start <- pmin(regions$start, regions$end);
# Shrink regions
- for (rr in seq(length=nrow(regions))) {
+ for (rr in seq_len(nrow(regions))) {
chr <- regions[rr,"chromosome"];
x0 <- regions[rr,"start"];
x1 <- regions[rr,"end"];
@@ -1048,7 +1048,7 @@ setMethodS3("getCallStatisticsByArms", "CBS", function(fit, genomeData, ...) {
regions$end <- pmax(regions$end, regions$start);
# Shrink regions
- for (rr in seq(length=nrow(regions))) {
+ for (rr in seq_len(nrow(regions))) {
chr <- regions[rr,"chromosome"];
x0 <- regions[rr,"start"];
x1 <- regions[rr,"end"];
@@ -1166,7 +1166,7 @@ setMethodS3("mergeNonCalledSegments", "CBS", function(fit, ..., verbose=FALSE) {
chromosomes <- getChromosomes(fit);
fitList <- list();
- for (cc in seq(along=chromosomes)) {
+ for (cc in seq_along(chromosomes)) {
chromosome <- chromosomes[cc];
verbose && enter(verbose, sprintf("Chromosome #%d ('%s') of %d", cc, chromosome, length(chromosomes)));
diff --git a/R/CBS.EXTS.R b/R/CBS.EXTS.R
index 49ffa60..a7bc093 100644
--- a/R/CBS.EXTS.R
+++ b/R/CBS.EXTS.R
@@ -76,7 +76,7 @@ setMethodS3("as.CBS", "DNAcopy", function(fit, sample=1L, ...) {
# Add chromosome splitter
ats <- which(diff(output$chromosome) != 0) + 1L;
if (length(ats) > 0) {
- idxs <- seq(length=nrow(output));
+ idxs <- seq_len(nrow(output));
values <- rep(NA_integer_, times=length(ats));
expand <- insert(idxs, ats=ats, values=values); # R.utils::insert()
output <- output[expand,];
@@ -169,7 +169,7 @@ setMethodS3("extractChromosomes", "CBS", function(x, chromosomes, ...) {
stopifnot(all(is.finite(shifts)));
# Adjust indices
- for (cc in seq(along=chromosomes)) {
+ for (cc in seq_along(chromosomes)) {
chromosome <- chromosomes[cc];
shift <- shifts[cc];
# Nothing to do?
@@ -235,7 +235,7 @@ setMethodS3("extractSegmentMeansByLocus", "CBS", function(fit, ...) {
avgY <- estList$y;
yS <- y;
- for (ss in seq(length=nbrOfSegments)) {
+ for (ss in seq_len(nbrOfSegments)) {
seg <- segs[ss,];
idxs <- which(seg$chromosome == chromosome &
seg$start <= x & x <= seg$end);
@@ -411,7 +411,7 @@ setMethodS3("getChromosomeRanges", "CBS", function(fit, ...) {
colnames(res) <- c("start", "end", "length");
# Get start and end of each chromosome.
- for (ii in seq(length=nrow(res))) {
+ for (ii in seq_len(nrow(res))) {
chr <- chromosomes[ii];
segsII <- subset(segs, chromosome == chr);
res[ii,"start"] <- min(segsII$start, na.rm=TRUE);
diff --git a/R/CBS.PLOT,many.R b/R/CBS.PLOT,many.R
index e8f422f..6c772df 100644
--- a/R/CBS.PLOT,many.R
+++ b/R/CBS.PLOT,many.R
@@ -49,7 +49,7 @@ setMethodS3("tileChromosomes", "CBS", function(fit, ..., verbose=FALSE) {
# Offset...
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
segFields <- grep("(start|end)$", colnames(segs), value=TRUE);
- for (kk in seq(along=chromosomes)) {
+ for (kk in seq_along(chromosomes)) {
chromosome <- chromosomes[kk];
chrTag <- sprintf("Chr%02d", chromosome);
verbose && enter(verbose, sprintf("Chromosome #%d ('%s') of %d",
@@ -192,7 +192,7 @@ setMethodS3("plotTracksManyChromosomes", "CBS", function(x, scatter=TRUE, pch=20
chrLabels <- sprintf("%02d", chromosomes);
if (byIndex) {
- xs <- seq(along=x);
+ xs <- seq_along(x);
} else {
xs <- x;
}
diff --git a/R/CBS.PLOT.R b/R/CBS.PLOT.R
index 289c33f..c0a6873 100644
--- a/R/CBS.PLOT.R
+++ b/R/CBS.PLOT.R
@@ -200,10 +200,10 @@ setMethodS3("highlightCalls", "CBS", function(fit, pch=20, callCols=c(loss="red"
dataT <- NULL;
# For each non-neutral segment
- for (ss in seq(length=nbrOfSegments)) {
+ for (ss in seq_len(nbrOfSegments)) {
seg <- segsT[ss,];
- for (tt in seq(along=callTypes)) {
+ for (tt in seq_along(callTypes)) {
field <- callFields[tt];
type <- callTypes[tt];
@@ -263,7 +263,7 @@ setMethodS3("highlightLocusCalls", "CBS", function(fit, callPchs=c(negOutlier=25
nbrOfLoci <- nbrOfLoci(fitT);
# For each non-neutral segment
- for (tt in seq(along=callTypes)) {
+ for (tt in seq_along(callTypes)) {
field <- callFields[tt];
type <- callTypes[tt];
@@ -354,14 +354,14 @@ setMethodS3("drawCentromeres", "CBS", function(fit, genomeData, what=c("start",
offsets <- chrStats[,"start"] - chrStats[1,"start"];
# Centroid locations in the tiled space
- offsetsT <- offsets[seq(length=nrow(genomeData))];
+ offsetsT <- offsets[seq_len(nrow(genomeData))];
xx <- genomeData[,what,drop=FALSE];
xx <- as.matrix(xx);
xx <- offsetsT + xx;
ats <- xScale * xx;
- for (cc in seq(length=ncol(xx))) {
+ for (cc in seq_len(ncol(xx))) {
abline(v=ats[,cc], col=col, lty=lty, ...);
}
@@ -406,7 +406,7 @@ setMethodS3("highlightArmCalls", "CBS", function(fit, genomeData, minFraction=0.
col <- callCols[type];
keyA <- sprintf("%sFraction", type);
keyB <- sprintf("%sCall", type);
- for (kk in seq(length=nbrOfRegions)) {
+ for (kk in seq_len(nbrOfRegions)) {
xs <- xx[kk,];
score <- callStats[kk, keyA];
if (is.finite(score) && score > 0) {
diff --git a/R/CBS.PRUNE.R b/R/CBS.PRUNE.R
index 8aa45a8..59e69ac 100644
--- a/R/CBS.PRUNE.R
+++ b/R/CBS.PRUNE.R
@@ -81,7 +81,7 @@ setMethodS3("pruneBySdUndo", "CBS", function(fit, rho=3, sigma="DNAcopy", ..., v
nbrOfChromosomes <- length(chromosomes);
fitList <- vector("list", length=nbrOfChromosomes);
- for (cc in seq(length=nbrOfChromosomes)) {
+ for (cc in seq_len(nbrOfChromosomes)) {
chr <- chromosomes[cc];
verbose && enter(verbose, sprintf("Chromosome #%d ('Chr%s') of %d",
cc, chr, length(chromosomes)));
@@ -173,7 +173,7 @@ setMethodS3("pruneBySdUndo", "CBS", function(fit, rho=3, sigma="DNAcopy", ..., v
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create stub for a segment table
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- idxs <- seq(length=nbrOfSegsP);
+ idxs <- seq_len(nbrOfSegsP);
segsP <- segs[idxs,];
# Sanity checks
diff --git a/R/CBS.R b/R/CBS.R
index 5fc5840..3eee1e8 100644
--- a/R/CBS.R
+++ b/R/CBS.R
@@ -132,7 +132,7 @@ setMethodS3("as.character", "CBS", function(x, ...) {
callCols <- grep("Call$", colnames(segs), value=TRUE);
callTypes <- gsub("Call$", "", callCols);
s <- c(s, sprintf("Types of segment calls: [%d] %s", length(callTypes), hpaste(callTypes)));
- for (kk in seq(along=callCols)) {
+ for (kk in seq_along(callCols)) {
key <- callCols[kk];
type <- callTypes[kk];
n <- sum(segs[,key], na.rm=TRUE);
@@ -294,9 +294,9 @@ setMethodS3("getSegments", "CBS", function(fit, simplify=FALSE, splitters=TRUE,
gapsAfter <- gapsAfter[!is.na(chrs[gapsAfter])];
nGaps <- length(gapsAfter);
if (nGaps > 0L) {
- idxs <- seq(length=n);
+ idxs <- seq_len(n);
values <- rep(NA_integer_, times=nGaps);
- idxs <- insert(idxs, at=gapsAfter+1L, values=values);
+ idxs <- insert(idxs, ats=gapsAfter+1L, values=values);
segs <- segs[idxs,];
}
@@ -310,9 +310,9 @@ setMethodS3("getSegments", "CBS", function(fit, simplify=FALSE, splitters=TRUE,
gapsAfter <- gapsAfter[onSameChr];
nGaps <- length(gapsAfter);
if (nGaps > 0L) {
- idxs <- seq(length=n);
+ idxs <- seq_len(n);
values <- rep(NA_integer_, times=nGaps);
- idxs <- insert(idxs, at=gapsAfter+1L, values=values);
+ idxs <- insert(idxs, ats=gapsAfter+1L, values=values);
segs <- segs[idxs,];
}
}
@@ -374,7 +374,7 @@ setMethodS3("updateBoundaries", "CBS", function(fit, ..., verbose=FALSE) {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Update segments
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- for (ss in seq(length=nbrOfSegments)) {
+ for (ss in seq_len(nbrOfSegments)) {
verbose && enter(verbose, sprintf("Segment %d of %d", ss, nbrOfSegments));
segRow <- segRows[ss,];
seg <- segs[ss,];
@@ -505,7 +505,7 @@ setMethodS3("updateMeans", "CBS", function(fit, ..., avg=c("asis", "mean", "medi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Update segments
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- for (ss in seq(length=nbrOfSegments)) {
+ for (ss in seq_len(nbrOfSegments)) {
verbose && enter(verbose, sprintf("Segment %d of %d", ss, nbrOfSegments));
segRow <- segRows[ss,];
seg <- segs[ss,];
@@ -619,7 +619,7 @@ setMethodS3("resegment", "CBS", function(fit, ..., verbose=FALSE) {
# (d) Merge
args <- formals;
- args2 <- append(params, userArgs);
+ args2 <- c(params, userArgs);
for (kk in seq(along=args2)) {
value <- args2[[kk]];
if (!is.null(value)) {
@@ -627,13 +627,13 @@ setMethodS3("resegment", "CBS", function(fit, ..., verbose=FALSE) {
if (!is.null(key)) {
args[[key]] <- value;
} else {
- args <- append(args, list(value));
+ args <- c(args, list(value));
}
}
} # for (key ...)
verbose && str(verbose, args[names(args) != "verbose"]);
- args <- append(list(data), args);
+ args <- c(list(data), args);
verbose && cat(verbose, "Arguments with data:");
verbose && str(verbose, args[names(args) != "verbose"]);
verbose && exit(verbose);
diff --git a/R/CBS.RESTRUCT.R b/R/CBS.RESTRUCT.R
index c894aa5..7f93d12 100644
--- a/R/CBS.RESTRUCT.R
+++ b/R/CBS.RESTRUCT.R
@@ -200,7 +200,7 @@ setMethodS3("extractSegments", "CBS", function(this, idxs, ..., verbose=FALSE) {
from <- from[ok];
to <- to[ok];
keep <- logical(nrow(data));
- for (rr in seq(along=from)) {
+ for (rr in seq_along(from)) {
keep[from[rr]:to[rr]] <- TRUE;
}
keep <- which(keep);
@@ -317,7 +317,7 @@ setMethodS3("mergeTwoSegments", "CBS", function(this, left, update=TRUE, verbose
idxsUsed <- c(idxsUsed, idxs);
# "Invalidate" remaining entries
- idxsTodo <- setdiff(seq(along=fields), idxsUsed);
+ idxsTodo <- setdiff(seq_along(fields), idxsUsed);
segT[,idxsTodo] <- NA;
# Update segment table
diff --git a/R/CBS.updateMeansTogether.R b/R/CBS.updateMeansTogether.R
index 2a5c378..53a332a 100644
--- a/R/CBS.updateMeansTogether.R
+++ b/R/CBS.updateMeansTogether.R
@@ -1,7 +1,7 @@
setMethodS3("updateMeansTogether", "CBS", function(fit, idxList, ..., avg=c("mean", "median"), verbose=FALSE) {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Validate arguments
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nbrOfSegments <- nbrOfSegments(fit, splitters=TRUE);
# Argument 'idxList':
@@ -22,22 +22,22 @@ setMethodS3("updateMeansTogether", "CBS", function(fit, idxList, ..., avg=c("mea
pushState(verbose);
on.exit(popState(verbose));
}
-
+
verbose && enter(verbose, "Updating mean level estimates of multiple segments");
verbose && cat(verbose, "Segments:");
verbose && str(verbose, idxList);
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Setting up averaging functions
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
avgFUN <- get(avg, mode="function");
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Extract the data and segmentation results
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
data <- getLocusData(fit);
segs <- getSegments(fit, splitters=TRUE);
@@ -45,7 +45,7 @@ setMethodS3("updateMeansTogether", "CBS", function(fit, idxList, ..., avg=c("mea
nbrOfSegments <- nrow(segs);
verbose && cat(verbose, "Total number of segments: ", nbrOfSegments);
- for (ss in seq(along=idxList)) {
+ for (ss in seq_along(idxList)) {
idxs <- idxList[[ss]];
fitT <- extractSegments(fit, idxs);
@@ -56,22 +56,22 @@ setMethodS3("updateMeansTogether", "CBS", function(fit, idxList, ..., avg=c("mea
y <- dataT$y;
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Update the TCN segments
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
verbose && enter(verbose, "Recalculate TCN means");
# (c) Adjust for missing values
keep <- which(!is.na(y));
-
+
# (d) Update mean
gamma <- avgFUN(y[keep]);
-
+
# Sanity check
stopifnot(length(gamma) == 0 || !is.na(gamma));
-
+
mus <- c(mean=gamma);
-
+
verbose && print(verbose, mus);
verbose && exit(verbose);
@@ -89,7 +89,7 @@ setMethodS3("updateMeansTogether", "CBS", function(fit, idxList, ..., avg=c("mea
res;
}, private=TRUE) # updateMeansTogether()
-
+
############################################################################
diff --git a/R/DNAcopy.EXTS.R b/R/DNAcopy.EXTS.R
index da7a724..821f3ff 100644
--- a/R/DNAcopy.EXTS.R
+++ b/R/DNAcopy.EXTS.R
@@ -216,7 +216,7 @@ setMethodS3("extractSegmentMeansByLocus", "DNAcopy", function(fit, sample=1L, ..
avgY <- estList$y;
yS <- y;
- for (ss in seq(length=nbrOfSegments)) {
+ for (ss in seq_len(nbrOfSegments)) {
seg <- segs[ss,];
idxs <- which(seg$chrom == chr & seg$loc.start <= x & x <= seg$loc.end);
idxs <- Arguments$getIndices(idxs, max=nbrOfLoci);
@@ -234,7 +234,7 @@ setMethodS3("extractSegmentMeansByLocus", "DNAcopy", function(fit, sample=1L, ..
-setMethodS3("writeSegments", "DNAcopy", function(fit, samples=seq(length=nbrOfSamples(fit)), ...) {
+setMethodS3("writeSegments", "DNAcopy", function(fit, samples=seq_len(nbrOfSamples(fit)), ...) {
# Argument 'samples':
samples <- Arguments$getIndices(samples, max=nbrOfSamples(fit));
diff --git a/R/NonPairedPSCBS.R b/R/NonPairedPSCBS.R
index 0c865c7..073345c 100644
--- a/R/NonPairedPSCBS.R
+++ b/R/NonPairedPSCBS.R
@@ -179,7 +179,7 @@ setMethodS3("updateMeans", "NonPairedPSCBS", function(fit, from=c("loci", "segme
rho <- data$rho;
isSplitter <- isSegmentSplitter(fit);
- for (ss in seq(length=nbrOfSegments)[!isSplitter]) {
+ for (ss in seq_len(nbrOfSegments)[!isSplitter]) {
verbose && enter(verbose, sprintf("Segment %d of %d", ss, nbrOfSegments));
seg <- segs[ss,];
verbose && print(verbose, seg);
@@ -342,7 +342,7 @@ setMethodS3("resegment", "NonPairedPSCBS", function(fit, ..., verbose=FALSE) {
# (d) Merge
args <- formals;
- args2 <- append(params, userArgs);
+ args2 <- c(params, userArgs);
for (kk in seq(along=args2)) {
value <- args2[[kk]];
if (!is.null(value)) {
@@ -350,14 +350,14 @@ setMethodS3("resegment", "NonPairedPSCBS", function(fit, ..., verbose=FALSE) {
if (!is.null(key)) {
args[[key]] <- value;
} else {
- args <- append(args, list(value));
+ args <- c(args, list(value));
}
}
} # for (key ...)
verbose && str(verbose, args[names(args) != "verbose"]);
verbose && enter(verbose, sprintf("Calling %s()", segFcnName));
- args <- append(list(data), args);
+ args <- c(list(data), args);
verbose && cat(verbose, "Arguments:");
verbose && str(verbose, args[names(args) != "verbose"]);
verbose && exit(verbose);
diff --git a/R/PSCBS.R b/R/PSCBS.R
index 9e27296..7db1fa4 100644
--- a/R/PSCBS.R
+++ b/R/PSCBS.R
@@ -38,7 +38,7 @@ setConstructorS3("PSCBS", function(fit=list(), ...) {
setMethodS3("as.data.frame", "PSCBS", function(x, ...) {
- getSegments(x, splitter=TRUE, ...);
+ getSegments(x, splitters=TRUE, ...);
}, protected=TRUE)
@@ -138,9 +138,9 @@ setMethodS3("getSegments", "PSCBS", function(fit, simplify=FALSE, splitters=TRUE
gapsAfter <- gapsAfter[!is.na(chrs[gapsAfter])];
nGaps <- length(gapsAfter);
if (nGaps > 0L) {
- idxs <- seq(length=n);
+ idxs <- seq_len(n);
values <- rep(NA_integer_, times=nGaps);
- idxs <- insert(idxs, at=gapsAfter+1L, values=values);
+ idxs <- insert(idxs, ats=gapsAfter+1L, values=values);
segs <- segs[idxs,];
}
@@ -154,9 +154,9 @@ setMethodS3("getSegments", "PSCBS", function(fit, simplify=FALSE, splitters=TRUE
gapsAfter <- gapsAfter[onSameChr];
nGaps <- length(gapsAfter);
if (nGaps > 0L) {
- idxs <- seq(length=n);
+ idxs <- seq_len(n);
values <- rep(NA_integer_, times=nGaps);
- idxs <- insert(idxs, at=gapsAfter+1L, values=values);
+ idxs <- insert(idxs, ats=gapsAfter+1L, values=values);
segs <- segs[idxs,];
}
}
@@ -219,6 +219,33 @@ setMethodS3("getChangePoints", "PSCBS", function(fit, ...) {
}, private=TRUE) # getChangePoints()
+setMethodS3("normalizeTotalCNs", "PSCBS", function(fit, targetTCN=2, ...) {
+ ## Fit using locus-level data
+ data <- getLocusData(fit, ...)
+ C <- data$CT
+ stopifnot(!is.null(C))
+ mu <- median(C, na.rm=TRUE)
+ scale <- targetTCN / mu
+
+ ## (a) Rescale locus-level data
+ C <- scale * C
+ data$CT <- C
+ rm(list="C")
+ fitN <- setLocusData(fit, data)
+
+ ## (b) Rescale segment-level data
+ segs <- getSegments(fit)
+ fields <- colnames(segs)
+ cnFields <- grep("^(tcn|c1|c2)", fields, value=TRUE)
+ cnFields <- grep("(Id|Start|End|NbrOf)", cnFields, value=TRUE, invert=TRUE)
+ for (field in cnFields) {
+ segs[[field]] <- scale * segs[[field]]
+ }
+ fitN <- setSegments(fitN, segs)
+
+ invisible(fitN)
+})
+
############################################################################
# HISTORY:
diff --git a/R/PSCBS.RESTRUCT.R b/R/PSCBS.RESTRUCT.R
index 2ddddd6..583667a 100644
--- a/R/PSCBS.RESTRUCT.R
+++ b/R/PSCBS.RESTRUCT.R
@@ -141,7 +141,7 @@ setMethodS3("extractChromosomes", "PSCBS", function(x, chromosomes, ...) {
stopifnot(all(is.finite(shifts)));
# Adjust indices
- for (cc in seq(along=chromosomes)) {
+ for (cc in seq_along(chromosomes)) {
chromosome <- chromosomes[cc];
shift <- shifts[cc];
# Nothing to do?
diff --git a/R/PairedPSCBS.BOOT.R b/R/PairedPSCBS.BOOT.R
index 054d156..f9e8203 100644
--- a/R/PairedPSCBS.BOOT.R
+++ b/R/PairedPSCBS.BOOT.R
@@ -84,7 +84,7 @@ setMethodS3("bootstrapTCNandDHByRegion", "PairedPSCBS", function(fit, B=1000L, b
S <- array(NA_real_, dim=dim, dimnames=dimnames);
verbose && str(verbose, S);
- for (kk in seq(along=fields)) {
+ for (kk in seq_along(fields)) {
field <- fields[kk];
verbose && enter(verbose, sprintf("Field #%d ('%s') of %d", kk, field, length(fields)));
@@ -95,7 +95,7 @@ setMethodS3("bootstrapTCNandDHByRegion", "PairedPSCBS", function(fit, B=1000L, b
stopifnot(nrow(Xkk) == dim(X)[1L]);
stopifnot(ncol(Xkk) == B);
- for (jj in seq(length=dim(X)[1L])) {
+ for (jj in seq_len(dim(X)[1L])) {
verbose && enter(verbose, sprintf("%s #%d of %d", whatC, jj, dim(X)[1L]));
Xkkjj <- Xkk[jj,,drop=TRUE]; # A vector of length B
S[jj,,kk] <- statsFcn(Xkkjj);
@@ -154,7 +154,7 @@ setMethodS3("bootstrapTCNandDHByRegion", "PairedPSCBS", function(fit, B=1000L, b
if (any(probs < 0.10) && any(probs > 0.90)) {
tryCatch({
fields <- dimnames(S)[[3L]];
- for (kk in seq(along=fields)) {
+ for (kk in seq_along(fields)) {
field <- fields[kk];
verbose && enter(verbose, sprintf("Field #%d ('%s') of %d", kk, field, length(fields)));
@@ -564,7 +564,7 @@ setMethodS3("bootstrapSegmentsAndChangepoints", "PairedPSCBS", function(fit, B=1
isSplitter <- (is.na(chrs) & is.na(tcnIds) & is.na(dhIds));
# Get all segment indices except for "splitters"
- jjs <- seq(length=nbrOfSegments);
+ jjs <- seq_len(nbrOfSegments);
jjs <- jjs[!isSplitter];
for (jj in jjs) {
@@ -747,7 +747,7 @@ setMethodS3("bootstrapSegmentsAndChangepoints", "PairedPSCBS", function(fit, B=1
idxsDHBB <- NULL;
# Bootstrap B times
- for (bb in seq(length=B)) {
+ for (bb in seq_len(B)) {
# (1) Bootstrap DHs
if (shouldHaveDHs) {
# (a) Resample heterozygous SNPs (=> resampled DH units)
diff --git a/R/PairedPSCBS.BOOT.sets.R b/R/PairedPSCBS.BOOT.sets.R
index 196096a..f3186de 100644
--- a/R/PairedPSCBS.BOOT.sets.R
+++ b/R/PairedPSCBS.BOOT.sets.R
@@ -220,7 +220,7 @@ setMethodS3("getBootstrapLocusSets", "PairedPSCBS", function(fit, B=1000L, by=c(
isSplitter <- (is.na(chrs) & is.na(tcnIds) & is.na(dhIds));
# Get all segment indices except for "splitters"
- jjs <- seq(length=nbrOfSegments);
+ jjs <- seq_len(nbrOfSegments);
jjs <- jjs[!isSplitter];
diff --git a/R/PairedPSCBS.CALL.R b/R/PairedPSCBS.CALL.R
index 6c5b9f4..404c55c 100644
--- a/R/PairedPSCBS.CALL.R
+++ b/R/PairedPSCBS.CALL.R
@@ -84,7 +84,7 @@ setMethodS3("extractCallsByLocus", "PairedPSCBS", function(fit, ...) {
callsL <- as.data.frame(callsL);
# For each segment...
- for (ss in seq(length=nrow(segs))) {
+ for (ss in seq_len(nrow(segs))) {
seg <- segs[ss,];
idxs <- which(chromosome == seg$chromosome &
seg$tcnStart <= x & x <= seg$tcnEnd);
@@ -93,7 +93,7 @@ setMethodS3("extractCallsByLocus", "PairedPSCBS", function(fit, ...) {
## stopifnot(length(idxs) == seg$tcnNbrOfLoci);
callsSS <- seg[callCols];
- for (cc in seq(length=nbrOfCalls)) {
+ for (cc in seq_len(nbrOfCalls)) {
callsL[idxs,cc] <- callsSS[,cc];
}
} # for (ss ...)
diff --git a/R/PairedPSCBS.EXTS.R b/R/PairedPSCBS.EXTS.R
index 1d7aaf9..faf023f 100644
--- a/R/PairedPSCBS.EXTS.R
+++ b/R/PairedPSCBS.EXTS.R
@@ -124,10 +124,46 @@ setMethodS3("extractCNs", "PairedPSCBS", function(fit, splitters=TRUE, ...) {
setMethodS3("extractDeltaC1C2", "PairedPSCBS", function(...) {
- xy <- extractC1C2(..., splitters=TRUE, addGaps=TRUE);
- X <- xy[,1:2,drop=FALSE];
- dX <- colDiffs(X);
- dX;
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # Extract data
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ X <- extractC1C2(..., splitters=TRUE, addGaps=TRUE);
+
+ # (C1,C2)
+ C1C2 <- X[,1:2,drop=FALSE];
+
+ # Number of TCN and DH data points
+ counts <- X[,3:4, drop=FALSE];
+
+ # Not needed anymore
+ X <- NULL;
+
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # Calculate (dC1,dC2)
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # (dC1, dC2)
+ dC1C2 <- matrixStats::colDiffs(C1C2);
+
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # Change-point weights
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # Region weights from DH counts
+ w <- counts[,2,drop=TRUE];
+ w <- sqrt(w);
+ w <- w / sum(w, na.rm=TRUE);
+
+ # (a) Smallest of the two flanking (DH) counts
+ cpw <- cbind(w[1:(length(w)-1)], w[2:length(w)]);
+ cpw <- rowMins(cpw, na.rm=TRUE);
+ cpw[is.infinite(cpw)] <- NA;
+ cpw <- sqrt(cpw);
+ cpwMin <- cpw / sum(cpw, na.rm=TRUE);
+
+ # (b) Sum of region weights
+ cpw <- w[1:(length(w)-1)] + w[2:length(w)];
+ cpwAvg <- cpw / sum(cpw, na.rm=TRUE);
+
+ cbind(dC1=dC1C2[,1], dC2=dC1C2[,2], wMin=cpwMin, wAvg=cpwAvg);
}, protected=TRUE)
@@ -207,7 +243,7 @@ setMethodS3("postsegmentTCN", "PairedPSCBS", function(fit, ..., force=FALSE, ver
verbose && cat(verbose, "Number of chromosomes: ", nbrOfChromosomes);
verbose && print(verbose, chromosomes);
- for (cc in seq(length=nbrOfChromosomes)) {
+ for (cc in seq_len(nbrOfChromosomes)) {
chr <- chromosomes[cc];
chrTag <- sprintf("chr%02d", chr);
verbose && enter(verbose, sprintf("Chromosome %d ('%s') of %d", cc, chrTag, nbrOfChromosomes));
@@ -223,7 +259,7 @@ setMethodS3("postsegmentTCN", "PairedPSCBS", function(fit, ..., force=FALSE, ver
tcnIds <- sort(unique(segsCC[["tcnId"]]));
I <- length(tcnIds);
- for (ii in seq(length=I)) {
+ for (ii in seq_len(I)) {
tcnId <- tcnIds[ii];
verbose && enter(verbose, sprintf("TCN segment #%d ('%s') of %d", ii, tcnId, I));
@@ -255,7 +291,7 @@ setMethodS3("postsegmentTCN", "PairedPSCBS", function(fit, ..., force=FALSE, ver
# Sanity check
stopifnot(diff(segRowsRange)+1L == nbrOfTCNsBefore);
- for (jj in seq(length=J)) {
+ for (jj in seq_len(J)) {
verbose && enter(verbose, sprintf("DH segment #%d of %d", jj, J));
seg <- segsII[jj,,drop=FALSE];
tcnSegRow <- unlist(tcnSegRowsII[jj,,drop=FALSE], use.names=FALSE);
diff --git a/R/PairedPSCBS.EXTS3.R b/R/PairedPSCBS.EXTS3.R
index fec6b49..6d9e1ac 100644
--- a/R/PairedPSCBS.EXTS3.R
+++ b/R/PairedPSCBS.EXTS3.R
@@ -1,9 +1,27 @@
setMethodS3("extractLocusLevelC1C2", "PairedPSCBS", function(fit, ...) {
+ # Extract locus-level data
data <- getLocusData(fit);
C <- data$CT;
rho <- data$rho;
+
+ # Swapped (C1,C2) <-> (C2,C1) for some segments?
+ fields <- colnames(getSegments(fit));
+ if (is.element("c1c2Swap", fields)) {
+ # FIXME: When PSCBS is updated.
+ # WORKAROUND: extractSegmentDataByLocus() in PSCBS v0.40.4 requires:
+ # that fields "chromosome", "tcnStart", "tcnEnd" are always requested
+ # /2014-03-21
+ c1c2Swap <- extractSegmentDataByLocus(fit, fields=c("c1c2Swap",
+ "chromosome", "tcnStart", "tcnEnd"));
+ c1c2Swap <- c1c2Swap[["c1c2Swap"]];
+ if (any(c1c2Swap)) {
+ rho[c1c2Swap] <- -rho[c1c2Swap];
+ }
+ }
+
C1 <- 1/2*(1-rho)*C;
- C2 <- C-C1;
+ C2 <- C - C1;
+
data.frame(C1=C1, C2=C2);
}, private=TRUE) # extractLocusLevelC1C2()
@@ -18,13 +36,13 @@ setMethodS3("extractLocusLevelTCN", "PairedPSCBS", function(fit, ...) {
setMethodS3("extractDhSegment", "PairedPSCBS", function(fit, idx, what=c("hets", "SNPs", "all"), ..., verbose=FALSE) {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Validate arguments
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Argument 'what':
what <- match.arg(what);
segs <- getSegments(fit, splitters=TRUE);
- stopifnot(!is.null(segs));
+ stopifnot(!is.null(segs));
nbrOfSegments <- nrow(segs);
# Argument 'idx':
@@ -35,15 +53,15 @@ setMethodS3("extractDhSegment", "PairedPSCBS", function(fit, idx, what=c("hets",
if (verbose) {
pushState(verbose);
on.exit(popState(verbose));
- }
+ }
verbose && enter(verbose, "Extracting a specific DH segment");
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Extract the data and segmentation results
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
data <- getLocusData(fit);
stopifnot(!is.null(data));
@@ -66,7 +84,7 @@ setMethodS3("extractDhSegment", "PairedPSCBS", function(fit, idx, what=c("hets",
verbose && exit(verbose);
verbose && enter(verbose, "Subsetting data");
- units <- seq(length=nrow(data));
+ units <- seq_len(nrow(data));
# Keep only chromosome of interest
chr <- as.numeric(seg[,"chromosome"]);
@@ -143,7 +161,7 @@ setMethodS3("extractDhSegment", "PairedPSCBS", function(fit, idx, what=c("hets",
# from the aroma.cn package. The below history has been updated to
# document changes in this method too.
# 2012-02-23
-# o Made extractDhSegment() protected.
+# o Made extractDhSegment() protected.
# 2011-10-08
# o ROBUSTIFICATION: Uses drop=FALSE in mergeTwoSegments() for PairedPSCBS.
# 2010-10-26 [HB]
diff --git a/R/PairedPSCBS.PLOT,many.R b/R/PairedPSCBS.PLOT,many.R
index 0902b7f..44c9370 100644
--- a/R/PairedPSCBS.PLOT,many.R
+++ b/R/PairedPSCBS.PLOT,many.R
@@ -264,7 +264,7 @@ setMethodS3("plotTracksManyChromosomes", "PairedPSCBS", function(fit, chromosome
if (is.null(data$rho)) {
isSnp <- (!is.na(betaTN) & !is.na(muN));
isHet <- isSnp & (muN == 1/2);
- rho <- rep(NA_real_, length=nbrOfLoci);
+ rho <- rep(NA_real_, times=nbrOfLoci);
rho[isHet] <- 2*abs(betaTN[isHet]-1/2);
warning(sprintf("Locus-level DH signals ('rho') were not available in the %s object and therefore recalculated from the TumorBoost-normalized tumor BAFs ('betaTN').", class(fit)[1L]));
}
@@ -294,7 +294,7 @@ setMethodS3("plotTracksManyChromosomes", "PairedPSCBS", function(fit, chromosome
gh$callsByLocus <- callData;
}
- for (tt in seq(along=tracks)) {
+ for (tt in seq_along(tracks)) {
track <- tracks[tt];
verbose && enter(verbose, sprintf("Track #%d ('%s') of %d",
tt, track, length(tracks)));
@@ -308,7 +308,7 @@ setMethodS3("plotTracksManyChromosomes", "PairedPSCBS", function(fit, chromosome
# Color scatter plot according to calls?
if (!is.null(calls) && callLoci && length(callColumns) > 0L) {
colsT <- rep(colS[1L], times=nrow(callData));
- for (cc in seq(along=callColumns)) {
+ for (cc in seq_along(callColumns)) {
callColumn <- callColumns[cc];
callLabel <- callLabels[cc];
verbose && enter(verbose, sprintf("Call #%d ('%s') of %d",
@@ -453,7 +453,7 @@ setMethodS3("plotTracksManyChromosomes", "PairedPSCBS", function(fit, chromosome
# For each panel of tracks, annotate segments with calls?
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (!is.null(calls) && !callLoci && length(callColumns) > 0L) {
- for (cc in seq(along=callColumns)) {
+ for (cc in seq_along(callColumns)) {
callColumn <- callColumns[cc];
callLabel <- callLabels[cc];
verbose && enter(verbose, sprintf("Call #%d ('%s') of %d",
@@ -472,7 +472,7 @@ setMethodS3("plotTracksManyChromosomes", "PairedPSCBS", function(fit, chromosome
side <- 2*((cc+1) %% 2) + 1;
# For each segment called...
- for (ss in seq(length=nrow(segsT))) {
+ for (ss in seq_len(nrow(segsT))) {
x0 <- segsT[ss,1,drop=TRUE];
x1 <- segsT[ss,2,drop=TRUE];
abline(v=c(x0,x1), lty=3, col="gray");
@@ -493,7 +493,7 @@ setMethodS3("plotTracksManyChromosomes", "PairedPSCBS", function(fit, chromosome
ltyCL <- sapply(tracksT, FUN=getCallLevelLty);
trackT <- track;
- for (cc in seq(along=allCallColumns)) {
+ for (cc in seq_along(allCallColumns)) {
callColumn <- allCallColumns[cc];
callLabel <- allCallLabels[cc];
diff --git a/R/PairedPSCBS.PLOT.R b/R/PairedPSCBS.PLOT.R
index 2199e99..86b0014 100644
--- a/R/PairedPSCBS.PLOT.R
+++ b/R/PairedPSCBS.PLOT.R
@@ -156,7 +156,7 @@ setMethodS3("plotTracks1", "PairedPSCBS", function(x, tracks=c("tcn", "dh", "tcn
# If 'rho' is not available, recalculate it from tumor BAFs.
# NOTE: This should throw an error in the future. /HB 2013-10-25
if (!hasDH) {
- rho <- rep(NA_real_, length=nbrOfLoci);
+ rho <- rep(NA_real_, times=nbrOfLoci);
rho[isHet] <- 2*abs(betaTN[isHet]-1/2);
warning(sprintf("Locus-level DH signals ('rho') were not available in the %s object and therefore recalculated from the TumorBoost-normalized tumor BAFs ('betaTN').", class(fit)[1L]));
}
@@ -214,7 +214,7 @@ setMethodS3("plotTracks1", "PairedPSCBS", function(x, tracks=c("tcn", "dh", "tcn
colMu <- c("gray", "black")[(muN == 1/2) + 1]
}
- for (tt in seq(along=tracks)) {
+ for (tt in seq_along(tracks)) {
track <- tracks[tt];
verbose && enter(verbose, sprintf("Track #%d ('%s') of %d",
tt, track, length(tracks)));
@@ -342,7 +342,7 @@ setMethodS3("plotTracks1", "PairedPSCBS", function(x, tracks=c("tcn", "dh", "tcn
# For each panel of tracks, annotate with calls?
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (length(callColumns) > 0) {
- for (cc in seq(along=callColumns)) {
+ for (cc in seq_along(callColumns)) {
callColumn <- callColumns[cc];
callLabel <- callLabels[cc];
verbose && enter(verbose, sprintf("Call #%d ('%s') of %d",
@@ -361,7 +361,7 @@ setMethodS3("plotTracks1", "PairedPSCBS", function(x, tracks=c("tcn", "dh", "tcn
side <- 2*((cc+1) %% 2) + 1;
# For each segment called...
- for (ss in seq(length=nrow(segsT))) {
+ for (ss in seq_len(nrow(segsT))) {
x0 <- segsT[ss,1,drop=TRUE];
x1 <- segsT[ss,2,drop=TRUE];
abline(v=c(x0,x1), lty=3, col="gray");
@@ -372,7 +372,7 @@ setMethodS3("plotTracks1", "PairedPSCBS", function(x, tracks=c("tcn", "dh", "tcn
} # for (cc in ...)
# Add call parameter estimates, e.g. deltaAB
- for (cc in seq(along=callColumns)) {
+ for (cc in seq_along(callColumns)) {
callColumn <- callColumns[cc];
callLabel <- callLabels[cc];
h <- NULL;
@@ -540,7 +540,7 @@ setMethodS3("drawConfidenceBands", "PairedPSCBS", function(fit, what=c("tcn", "d
colQ["alpha",] <- alpha*colQ["alpha",];
colQ <- rgb(red=colQ["red",], green=colQ["green",], blue=colQ["blue",], alpha=colQ["alpha",], maxColorValue=255);
- for (kk in seq(length=nrow(segsT))) {
+ for (kk in seq_len(nrow(segsT))) {
rect(xleft=segsT[kk,1], xright=segsT[kk,2], ybottom=segsT[kk,3], ytop=segsT[kk,4], col=colQ, border=FALSE);
}
}, private=TRUE)
@@ -632,7 +632,7 @@ setMethodS3("arrowsC1C2", "PairedPSCBS", function(fit, length=0.05, ...) {
xy <- xy[,1:2,drop=FALSE];
x <- xy[,1,drop=TRUE];
y <- xy[,2,drop=TRUE];
- s <- seq(length=length(x)-1);
+ s <- seq_len(length(x)-1);
arrows(x0=x[s],y0=y[s], x1=x[s+1],y1=y[s+1], code=2, length=length, ...);
}, private=TRUE)
@@ -642,7 +642,7 @@ setMethodS3("arrowsDeltaC1C2", "PairedPSCBS", function(fit, length=0.05, ...) {
xy <- xy[,1:2,drop=FALSE];
x <- xy[,1,drop=TRUE];
y <- xy[,2,drop=TRUE];
- s <- seq(length=length(x)-1);
+ s <- seq_len(length(x)-1);
arrows(x0=x[s],y0=y[s], x1=x[s+1],y1=y[s+1], code=2, length=length, ...);
}, private=TRUE)
@@ -689,7 +689,7 @@ setMethodS3("tileChromosomes", "PairedPSCBS", function(fit, chrStarts=NULL, ...,
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (is.null(chrStarts)) {
xRange <- matrix(0, nrow=length(chromosomes), ncol=2);
- for (kk in seq(along=chromosomes)) {
+ for (kk in seq_along(chromosomes)) {
chromosome <- chromosomes[kk];
idxs <- which(data$chromosome == chromosome);
x <- data$x[idxs];
@@ -721,7 +721,7 @@ setMethodS3("tileChromosomes", "PairedPSCBS", function(fit, chrStarts=NULL, ...,
# Sanity check
stopifnot(length(segFields) > 0);
- for (kk in seq(along=chromosomes)) {
+ for (kk in seq_along(chromosomes)) {
chromosome <- chromosomes[kk];
chrTag <- sprintf("Chr%02d", chromosome);
verbose && enter(verbose, sprintf("Chromosome #%d ('%s') of %d",
@@ -809,7 +809,7 @@ setMethodS3("getChromosomeRanges", "PairedPSCBS", function(fit, ...) {
colnames(res) <- c("start", "end", "length");
# Get start and end of each chromosome.
- for (ii in seq(length=nrow(res))) {
+ for (ii in seq_len(nrow(res))) {
chr <- chromosomes[ii];
segsII <- subset(segs, chromosome == chr);
res[ii,"start"] <- min(segsII$tcnStart, na.rm=TRUE);
diff --git a/R/PairedPSCBS.PLOT2.R b/R/PairedPSCBS.PLOT2.R
index fcce49e..88e77ad 100644
--- a/R/PairedPSCBS.PLOT2.R
+++ b/R/PairedPSCBS.PLOT2.R
@@ -90,7 +90,7 @@ setMethodS3("plotTracks2", "PairedPSCBS", function(x, panels=NULL, calls=".*", p
# If 'rho' is not available, recalculate it from tumor BAFs.
# NOTE: This should throw an error in the future. /HB 2013-10-25
if (!hasDH) {
- rho <- rep(NA_real_, length=nbrOfLoci);
+ rho <- rep(NA_real_, times=nbrOfLoci);
rho[isHet] <- 2*abs(betaTN[isHet]-1/2);
warning(sprintf("Locus-level DH signals ('rho') were not available in the %s object and therefore recalculated from the TumorBoost-normalized tumor BAFs ('betaTN').", class(fit)[1L]));
}
@@ -159,7 +159,7 @@ setMethodS3("plotTracks2", "PairedPSCBS", function(x, panels=NULL, calls=".*", p
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For each panel...
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- for (pp in seq(length=nbrOfPanels)) {
+ for (pp in seq_len(nbrOfPanels)) {
panel <- panels[pp];
verbose && enter(verbose, sprintf("Panel #%d ('%s') of %d",
pp, panel, length(panels)));
@@ -210,7 +210,7 @@ setMethodS3("plotTracks2", "PairedPSCBS", function(x, panels=NULL, calls=".*", p
verbose && print(verbose, tracks);
nbrOfTracks <- length(tracks);
- for (tt in seq(length=nbrOfTracks)) {
+ for (tt in seq_len(nbrOfTracks)) {
track <- tracks[tt];
verbose && enter(verbose, sprintf("Scatter track #%d ('%s') of %d",
tt, track, nbrOfTracks));
@@ -275,7 +275,7 @@ setMethodS3("plotTracks2", "PairedPSCBS", function(x, panels=NULL, calls=".*", p
verbose && print(verbose, tracks);
nbrOfTracks <- length(tracks);
- for (tt in seq(length=nbrOfTracks)) {
+ for (tt in seq_len(nbrOfTracks)) {
track <- tracks[tt];
verbose && enter(verbose, sprintf("Level track #%d ('%s') of %d",
tt, track, nbrOfTracks));
@@ -322,7 +322,7 @@ setMethodS3("plotTracks2", "PairedPSCBS", function(x, panels=NULL, calls=".*", p
# For each panel of tracks, annotate with calls?
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (length(callColumns) > 0) {
- for (cc in seq(along=callColumns)) {
+ for (cc in seq_along(callColumns)) {
callColumn <- callColumns[cc];
callLabel <- callLabels[cc];
verbose && enter(verbose, sprintf("Call #%d ('%s') of %d",
@@ -341,7 +341,7 @@ setMethodS3("plotTracks2", "PairedPSCBS", function(x, panels=NULL, calls=".*", p
side <- 2*((cc+1) %% 2) + 1;
# For each segment called...
- for (ss in seq(length=nrow(segsT))) {
+ for (ss in seq_len(nrow(segsT))) {
x0 <- segsT[ss,1,drop=TRUE];
x1 <- segsT[ss,2,drop=TRUE];
abline(v=c(x0,x1), lty=3, col="gray");
diff --git a/R/PairedPSCBS.R b/R/PairedPSCBS.R
index 5acd558..cb8f093 100644
--- a/R/PairedPSCBS.R
+++ b/R/PairedPSCBS.R
@@ -49,10 +49,19 @@ setMethodS3("getLocusData", "PairedPSCBS", function(fit, ..., fields=c("asis", "
# Genotype calls
if (!is.element("muN", names)) {
- callNaiveGenotypes <- .use("callNaiveGenotypes", package="aroma.light");
- data$muN <- callNaiveGenotypes(data$betaN);
+ if (is.element("rho", names)) {
+ data$muN <- rep(NA_real_, times=length(data$rho))
+ data$muN[is.finite(data$rho)] <- 1/2
+ } else if (is.element("betaN", names)) {
+ callNaiveGenotypes <- .use("callNaiveGenotypes", package="aroma.light");
+ data$muN <- callNaiveGenotypes(data$betaN);
+ } else {
+ throw("Cannot identify heterozygous SNPs or genotypes")
+ }
}
- data$isHet <- (data$muN == 1/2);
+
+ data$isHet <- (data$muN == 1/2)
+
# BACKWARD COMPATIBILITY: If 'rho' does not exists, calculate
# it on the fly from 'betaT'.
# NOTE: This should give an error in the future. /HB 2013-10-25
@@ -65,17 +74,24 @@ setMethodS3("getLocusData", "PairedPSCBS", function(fit, ..., fields=c("asis", "
data$c2 <- data$CT - data$c1;
# TumorBoost BAFs
- if (!is.element("betaTN", names)) {
- normalizeTumorBoost <- .use("normalizeTumorBoost", package="aroma.light");
- data$betaTN <- normalizeTumorBoost(betaN=data$betaN, betaT=data$betaT, muN=data$muN);
- }
- data$rhoN <- 2*abs(data$betaTN-1/2);
- data$rhoN[!data$isHet] <- NA_real_;
- data$c1N <- 1/2*(1-data$rhoN)*data$CT;
- data$c2N <- data$CT - data$c1N;
+ if (!is.element("rhoN", names)) {
+ if (!is.element("betaTN", names) && is.element("betaN", names)) {
+ normalizeTumorBoost <- .use("normalizeTumorBoost", package="aroma.light");
+ data$betaTN <- normalizeTumorBoost(betaN=data$betaN, betaT=data$betaT, muN=data$muN);
+ }
+
+ if (is.element("betaTN", names)) {
+ data$rhoN <- 2*abs(data$betaTN-1/2);
+ data$rhoN[!data$isHet] <- NA_real_;
+ data$c1N <- 1/2*(1-data$rhoN)*data$CT;
+ data$c2N <- data$CT - data$c1N;
+ }
- data$isSNP <- (!is.na(data$betaT) | !is.na(data$betaN));
- data$type <- ifelse(data$isSNP, "SNP", "non-polymorphic locus");
+ if (all(is.element(c("betaN", "betaT"), names))) {
+ data$isSNP <- (!is.na(data$betaT) | !is.na(data$betaN));
+ data$type <- ifelse(data$isSNP, "SNP", "non-polymorphic locus");
+ }
+ }
# Labels
data$muNx <- c("AA", "AB", "BB")[2*data$muN + 1L];
@@ -140,7 +156,7 @@ setMethodS3("resegment", "PairedPSCBS", function(fit, ..., verbose=FALSE) {
# (d) Merge
args <- formals;
- args2 <- append(params, userArgs);
+ args2 <- c(params, userArgs);
for (kk in seq(along=args2)) {
value <- args2[[kk]];
if (!is.null(value)) {
@@ -148,14 +164,14 @@ setMethodS3("resegment", "PairedPSCBS", function(fit, ..., verbose=FALSE) {
if (!is.null(key)) {
args[[key]] <- value;
} else {
- args <- append(args, list(value));
+ args <- c(args, list(value));
}
}
} # for (key ...)
verbose && str(verbose, args[names(args) != "verbose"]);
verbose && enter(verbose, sprintf("Calling %s()", segFcnName));
- args <- append(list(data), args);
+ args <- c(list(data), args);
verbose && cat(verbose, "Arguments:");
verbose && str(verbose, args[names(args) != "verbose"]);
verbose && exit(verbose);
diff --git a/R/PairedPSCBS.RESTRUCT.R b/R/PairedPSCBS.RESTRUCT.R
index c135f30..e8cbe78 100644
--- a/R/PairedPSCBS.RESTRUCT.R
+++ b/R/PairedPSCBS.RESTRUCT.R
@@ -100,7 +100,7 @@ setMethodS3("extractSegments", "PairedPSCBS", function(this, idxs, ..., verbose=
from <- from[ok];
to <- to[ok];
keep <- logical(nrow(data));
- for (rr in seq(along=from)) {
+ for (rr in seq_along(from)) {
keep[from[rr]:to[rr]] <- TRUE;
}
keep <- which(keep);
@@ -257,7 +257,7 @@ setMethodS3("mergeTwoSegments", "PairedPSCBS", function(this, left, update=TRUE,
# "Invalidate" remaining entries
if (update) {
- idxsTodo <- setdiff(seq(along=fields), idxsUsed);
+ idxsTodo <- setdiff(seq_along(fields), idxsUsed);
segT[,idxsTodo] <- NA;
}
diff --git a/R/PairedPSCBS.applyByRegion.R b/R/PairedPSCBS.applyByRegion.R
index 9d7cd6d..cf3895d 100644
--- a/R/PairedPSCBS.applyByRegion.R
+++ b/R/PairedPSCBS.applyByRegion.R
@@ -83,7 +83,7 @@ setMethodS3("applyByRegion", "PairedPSCBS", function(fit, FUN, ..., subset=NULL,
from <- from[ok];
to <- to[ok];
keep <- logical(nrow(data));
- for (kk in seq(along=from)) {
+ for (kk in seq_along(from)) {
keep[from[kk]:to[kk]] <- TRUE;
}
dataRowsRR <- which(keep);
diff --git a/R/PairedPSCBS.callCopyNeutral.R b/R/PairedPSCBS.callCopyNeutral.R
index f4f9dcf..6bcabd9 100644
--- a/R/PairedPSCBS.callCopyNeutral.R
+++ b/R/PairedPSCBS.callCopyNeutral.R
@@ -179,6 +179,46 @@ setMethodS3("calcStatsForCopyNeutralABs", "PairedPSCBS", function(fit, ..., forc
}, protected=TRUE) # calcStatsForCopyNeutralABs()
+
+###########################################################################/**
+# @RdocMethod estimateDeltaCN
+# @alias estimateDeltaCN
+# @alias estimateDeltaCN.CBS
+#
+# @title "Estimates the length of one total copy-number (TCN) unit"
+#
+# \description{
+# @get "title"
+# }
+#
+# @synopsis
+#
+# \arguments{
+# \item{scale}{A @numeric scale factor in (0,Inf) used for rescaling
+# (multiplying) the final estimate with.}
+# \item{...}{Not used.}
+# }
+#
+# \value{
+# Returns a positive scalar @numeric.
+# }
+#
+# \details{
+# For parent-specific copy-number (PSCN) data, the TCN unit length is
+# estimated as \eqn{(1-kappa)/2}, where \eqn{kappa} is estimated from
+# data (by @see "PSCBS::estimateKappa").
+#
+# For total copy-number (TCN) data (only),
+# }
+#
+# @author "HB"
+#
+# \seealso{
+# @seeclass
+# }
+#
+# @keyword internal
+#*/###########################################################################
setMethodS3("estimateDeltaCN", "PairedPSCBS", function(fit, scale=1, kappa=estimateKappa(fit), ...) {
# Argument 'scale':
disallow <- c("NA", "NaN", "Inf");
diff --git a/R/PairedPSCBS.callGNL.R b/R/PairedPSCBS.callGNL.R
index 4af27c0..6ba2f35 100644
--- a/R/PairedPSCBS.callGNL.R
+++ b/R/PairedPSCBS.callGNL.R
@@ -266,7 +266,7 @@ setMethodS3("callGNLByTCNofABv1", "PairedPSCBS", function(fit, deltaLoss=-0.5, d
ci <- segs[,keys];
# Call states
- for (rr in seq(length=nrow(callRegions))) {
+ for (rr in seq_len(nrow(callRegions))) {
state <- rownames(callRegions)[rr];
verbose && enter(verbose, "Identify all '", state, "' segments");;
range <- callRegions[rr,];
diff --git a/R/PairedPSCBS.callROH.R b/R/PairedPSCBS.callROH.R
index d857b65..94f277f 100644
--- a/R/PairedPSCBS.callROH.R
+++ b/R/PairedPSCBS.callROH.R
@@ -61,7 +61,7 @@ setMethodS3("callROH", "PairedPSCBS", function(fit, ..., updateMeans=TRUE, force
delta <- NA_real_;
# For each segment...
- for (ss in seq(length=nbrOfSegments)) {
+ for (ss in seq_len(nbrOfSegments)) {
verbose && enter(verbose, sprintf("Segment #%d of %d", ss, nbrOfSegments));
fitT <- extractSegment(fit, ss);
diff --git a/R/PairedPSCBS.estimateKappa.R b/R/PairedPSCBS.estimateKappa.R
index fab4877..2e1ebb3 100644
--- a/R/PairedPSCBS.estimateKappa.R
+++ b/R/PairedPSCBS.estimateKappa.R
@@ -196,13 +196,13 @@ setMethodS3("estimateKappaByC1Density", "PairedPSCBS", function(this, typeOfWeig
type <- NULL; rm(list="type"); # To please R CMD check
fit <- subset(fit, type == "peak");
if (nrow(fit) < 2L) {
- throw(sprintf("Less that two modes were found in the empirical density of C1: %d", nrow(fit)));
+ throw(sprintf("Less than two modes were found in the empirical density of C1: %d", nrow(fit)));
}
nModes <- nrow(fit);
fit <- subset(fit, density >= minDensity);
if (nrow(fit) < 2L) {
- throw(sprintf("Less that two modes were found in the empirical density of C1 after removing %d modes that are too weak (density < %g): %d", nModes - nrow(fit), minDensity, nrow(fit)));
+ throw(sprintf("Less than two modes were found in the empirical density of C1 after removing %d modes that are too weak (density < %g): %d", nModes - nrow(fit), minDensity, nrow(fit)));
}
nModes <- nrow(fit);
verbose && cat(verbose, "All peaks:");
diff --git a/R/PairedPSCBS.extractSegmentDataByLocus.R b/R/PairedPSCBS.extractSegmentDataByLocus.R
index 9c45908..7bfca64 100644
--- a/R/PairedPSCBS.extractSegmentDataByLocus.R
+++ b/R/PairedPSCBS.extractSegmentDataByLocus.R
@@ -48,7 +48,7 @@ setMethodS3("extractSegmentDataByLocus", "PairedPSCBS", function(fit, fields=NUL
verbose && enter(verbose, "Extracting segment by segment");
# For each segment...
- for (ss in seq(length=nrow(segs))) {
+ for (ss in seq_len(nrow(segs))) {
verbose && enter(verbose, sprintf("Segment %d of %d", ss, nrow(segs)));
seg <- segs[ss,];
idxs <- which(chromosome == seg$chromosome &
diff --git a/R/PairedPSCBS.updateMeans.R b/R/PairedPSCBS.updateMeans.R
index 5737ff6..15f8d8e 100644
--- a/R/PairedPSCBS.updateMeans.R
+++ b/R/PairedPSCBS.updateMeans.R
@@ -97,7 +97,7 @@ setMethodS3("updateMeans", "PairedPSCBS", function(fit, from=c("loci", "segments
rho <- data$rho;
isSplitter <- isSegmentSplitter(fit);
- for (ss in seq(length=nbrOfSegments)[!isSplitter]) {
+ for (ss in seq_len(nbrOfSegments)[!isSplitter]) {
verbose && enter(verbose, sprintf("Segment %d of %d", ss, nbrOfSegments));
seg <- segs[ss,];
verbose && print(verbose, seg);
diff --git a/R/PairedPSCBS.updateMeansTogether.R b/R/PairedPSCBS.updateMeansTogether.R
index 6c29e20..e508717 100644
--- a/R/PairedPSCBS.updateMeansTogether.R
+++ b/R/PairedPSCBS.updateMeansTogether.R
@@ -49,7 +49,7 @@ setMethodS3("updateMeansTogether", "PairedPSCBS", function(fit, idxList, ..., av
nbrOfSegments <- nrow(segs);
verbose && cat(verbose, "Total number of segments: ", nbrOfSegments);
- for (ss in seq(along=idxList)) {
+ for (ss in seq_along(idxList)) {
idxs <- idxList[[ss]];
fitT <- extractSegments(fit, idxs);
diff --git a/R/callSegmentationOutliers.R b/R/callSegmentationOutliers.R
index 3e4ccd5..5e2d746 100644
--- a/R/callSegmentationOutliers.R
+++ b/R/callSegmentationOutliers.R
@@ -130,7 +130,7 @@ setMethodS3("callSegmentationOutliers", "default", function(y, chromosome=0, x=N
# For each chromosome
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
isOutlierT <- logical(nbrOfLoci);
- for (kk in seq(along=uChromosomes)) {
+ for (kk in seq_along(uChromosomes)) {
chr <- uChromosomes[kk];
verbose && enter(verbose, sprintf("Chromosome #%d ('Chr%02d') of %d", kk, chr, length(uChromosomes)));
keepKK <- which(chromosome == chr);
diff --git a/R/findLargeGaps.R b/R/findLargeGaps.R
index 1916b11..fe95673 100644
--- a/R/findLargeGaps.R
+++ b/R/findLargeGaps.R
@@ -64,7 +64,7 @@ setMethodS3("findLargeGaps", "default", function(chromosome=NULL, x, minLength,
xEmpty <- vector(mode(x), length=0L)
gaps <- data.frame(chromosome=integer(0L), start=xEmpty, end=xEmpty);
- for (cc in seq(along=allChromosomes)) {
+ for (cc in seq_along(allChromosomes)) {
chr <- allChromosomes[cc];
idxs <- which(chromosome == chr);
chromosomeCC <- chromosome[idxs];
diff --git a/R/segmentByCBS.R b/R/segmentByCBS.R
index a90594d..b9f072a 100644
--- a/R/segmentByCBS.R
+++ b/R/segmentByCBS.R
@@ -114,7 +114,7 @@
# }
# @keyword IO
#*/###########################################################################
-setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=seq(along=y), w=NULL, undo=0, avg=c("mean", "median"), ..., joinSegments=TRUE, knownSegments=NULL, seed=NULL, verbose=FALSE) {
+setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=seq_along(y), w=NULL, undo=0, avg=c("mean", "median"), ..., joinSegments=TRUE, knownSegments=NULL, seed=NULL, verbose=FALSE) {
# Local copies of DNAcopy functions
getbdry <- .use("getbdry", package="DNAcopy");
CNA <- .use("CNA", package="DNAcopy");
@@ -181,7 +181,7 @@ setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=
# Argument 'x':
if (is.null(x)) {
- x <- seq(length=nbrOfLoci);
+ x <- seq_len(nbrOfLoci);
} else {
disallow <- c("Inf");
x <- Arguments$getDoubles(x, length=length2, disallow=disallow);
@@ -189,7 +189,7 @@ setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=
# Argument 'index':
if (is.null(index)) {
- index <- seq(along=y);
+ index <- seq_along(y);
} else {
index <- Arguments$getIndices(index);
}
@@ -305,7 +305,7 @@ setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=
verbose && enter(verbose, "Ordering data along genome", level=-50);
o <- order(data$chrom, data$x, decreasing=FALSE, na.last=TRUE);
# Any change?
- if (any(o != seq(along=o))) {
+ if (any(o != seq_along(o))) {
data <- data[o,,drop=FALSE];
}
o <- NULL; # Not needed anymore
@@ -333,7 +333,7 @@ setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=
}
fitList <- listenv()
- for (kk in seq(length=nbrOfChromosomes)) {
+ for (kk in seq_len(nbrOfChromosomes)) {
chromosomeKK <- chromosomes[kk];
chrTag <- sprintf("Chr%02d", chromosomeKK);
verbose && enter(verbose, sprintf("Chromosome #%d ('%s') of %d", kk, chrTag, nbrOfChromosomes));
@@ -357,7 +357,7 @@ setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=
verbose && print(verbose, knownSegmentsKK, level=-5);
}
- fitList[[chrTag]] %<=% {
+ fitList[[chrTag]] %<-% {
fit <- segmentByCBS(y=y,
chromosome=chrom, x=x,
w=w,
@@ -487,7 +487,7 @@ setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=
}
fitList <- listenv()
- for (jj in seq(length=nbrOfSegments)) {
+ for (jj in seq_len(nbrOfSegments)) {
seg <- knownSegments[jj,];
chromosomeJJ <- seg$chromosome;
xStart <- seg$start;
@@ -530,7 +530,7 @@ setMethodS3("segmentByCBS", "default", function(y, chromosome=0L, x=NULL, index=
seedJJ <- seeds[[jj]]
- fitList[[segTag]] %<=% {
+ fitList[[segTag]] %<-% {
fit <- segmentByCBS(y=y,
chromosome=chrom, x=x,
w=w,
diff --git a/R/segmentByPairedPSCBS.R b/R/segmentByPairedPSCBS.R
index 87af6ee..d90940e 100644
--- a/R/segmentByPairedPSCBS.R
+++ b/R/segmentByPairedPSCBS.R
@@ -248,7 +248,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
# Argument 'x':
if (is.null(x)) {
- x <- seq(length=nbrOfLoci);
+ x <- seq_len(nbrOfLoci);
} else {
disallow <- c("Inf");
x <- Arguments$getDoubles(x, length=length2, disallow=disallow);
@@ -436,7 +436,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
verbose && enter(verbose, "Ordering data along genome");
o <- order(data$chromosome, data$x, decreasing=FALSE, na.last=TRUE);
# Any change?
- if (any(o != seq(along=o))) {
+ if (any(o != seq_along(o))) {
data <- data[o,,drop=FALSE];
}
o <- NULL; # Not needed anymore
@@ -444,7 +444,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
verbose && exit(verbose);
# Attach 'index' (guaranteed to be ordered)
- data$index <- seq(length=nrow(data));
+ data$index <- seq_len(nrow(data));
# Sanity check
stopifnot(nrow(data) == nbrOfLoci);
@@ -489,7 +489,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
}
fitList <- listenv()
- for (kk in seq(length=nbrOfChromosomes)) {
+ for (kk in seq_len(nbrOfChromosomes)) {
chromosomeKK <- chromosomes[kk];
chrTag <- sprintf("Chr%02d", chromosomeKK);
verbose && enter(verbose, sprintf("Chromosome #%d ('%s') of %d", kk, chrTag, nbrOfChromosomes));
@@ -509,7 +509,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
verbose && print(verbose, knownSegmentsKK);
}
- fitList[[chrTag]] %<=% {
+ fitList[[chrTag]] %<-% {
fit <- segmentByPairedPSCBS(CT=CT, thetaT=thetaT, thetaN=thetaN,
betaT=betaTN, betaN=betaN, muN=muN, rho=rho,
chromosome=chromosome, x=x,
@@ -639,7 +639,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
isHet <- isSnp & (data$muN == 1/2)
verbose && printf(verbose, "Number of heterozygous SNPs: %d (%.2f%%)\n",
sum(isHet), 100*sum(isHet)/nbrOfSnps)
- rho <- rep(NA_real_, length=nbrOfLoci)
+ rho <- rep(NA_real_, times=nbrOfLoci)
rho[isHet] <- 2*abs(data$betaTN[isHet]-1/2)
verbose && cat(verbose, "Normalized DHs:")
verbose && str(verbose, rho)
@@ -760,14 +760,14 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
# Segments
segs <- tcnSegments;
- segs[,"tcnId"] <- seq(length=nbrOfSegs);
+ segs[,"tcnId"] <- seq_len(nbrOfSegs);
segs[,"dhId"] <- rep(1L, times=nbrOfSegs);
segs[,c("tcnNbrOfSNPs", "tcnNbrOfHets", "dhNbrOfLoci")] <- 0L;
segs[,"dhStart"] <- segs[,"tcnStart"];
segs[,"dhEnd"] <- segs[,"tcnEnd"];
# For each TCN segment...
- for (kk in seq(length=nbrOfSegs)) {
+ for (kk in seq_len(nbrOfSegs)) {
tcnId <- kk;
xStart <- tcnSegments[kk,"tcnStart"];
@@ -847,7 +847,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
# For each TCN segment...
segs <- vector("list", length=nbrOfSegs);
- for (kk in seq(length=nbrOfSegs)) {
+ for (kk in seq_len(nbrOfSegs)) {
tcnId <- kk;
xStart <- tcnSegments[kk,"tcnStart"];
@@ -1063,7 +1063,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
# Combine TCN and DH segmentation results
tcndhSegments <- cbind(
tcnId=rep(kk, times=nrow(dhSegments)),
- dhId=seq(length=nrow(dhSegments)),
+ dhId=seq_len(nrow(dhSegments)),
tcnSegmentsKK,
dhSegments
);
@@ -1095,7 +1095,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
# Move 'chromosome' column to the first column
idx <- match("chromosome", names(segs));
- idxs <- c(idx, seq(length=ncol(segs))[-idx]);
+ idxs <- c(idx, seq_len(ncol(segs))[-idx]);
segs <- segs[,idxs,drop=FALSE];
verbose && print(verbose, segs);
@@ -1127,7 +1127,7 @@ setMethodS3("segmentByPairedPSCBS", "default", function(CT, thetaT=NULL, thetaN=
);
# Should we drop attributes? /HB 2010-09-24
- stopifnot(all(data$index == seq(length=nrow(data))));
+ stopifnot(all(data$index == seq_len(nrow(data))));
data$index <- NULL; # Drop, because it is guaranteed to be ordered
class(data) <- c("PairedPSCNData", class(data));
diff --git a/R/writeWIG.R b/R/writeWIG.R
index 37e73ab..0a65694 100644
--- a/R/writeWIG.R
+++ b/R/writeWIG.R
@@ -76,7 +76,7 @@ setMethodS3("extractWIG", "PSCBS", function(fit, signal=c("tcn", "dh"), ..., col
# \references{
# [1] Wiggle Track Format (WIG), UCSC Genome Browser
-# \url{http://genome.ucsc.edu/goldenPath/help/wiggle.html}
+# \url{https://genome.ucsc.edu/goldenPath/help/wiggle.html}
# }
setMethodS3("writeWIG", "AbstractCBS", function(fit, name=getSampleName(fit), tags=NULL, ext="wig", path=NULL, overwrite=FALSE, skip=FALSE, ...) {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/R/zzz.R b/R/zzz.R
index bc1bef7..032b0e7 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -33,7 +33,7 @@
# Inform user if DNAcopy is missing
if (!isPackageInstalled("DNAcopy")) {
- msg <- "The Bioconductor package 'DNAcopy' is not installed. Please see http://www.bioconductor.org/ on how to install it, or try calling PSCBS::installDNAcopy().";
+ msg <- "The Bioconductor package 'DNAcopy' is not installed. Please see https://www.bioconductor.org/ on how to install it, or try calling PSCBS::installDNAcopy().";
hrule <- paste(rep("*", times=getOption("width", 80L)-1L), collapse="");
packageStartupMessage(sprintf("%s\nNOTE: %s\n%s", hrule, msg, hrule));
}
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7bb165d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,40 @@
+# PSCBS: Analysis of Parent-Specific DNA Copy Numbers
+
+
+## Parallel processing
+The package supports segmentation of the chromosomes in parallel
+(asynchronously) via [futures](https://cran.r-project.org/package=future)
+by adding the following
+```r
+future::plan("multiprocess")
+```
+to the beginning of the PSCBS script. Everything else will work the
+same. To reset to non-parallel (synchronously) processing, use
+`future::plan("eager")`.
+
+To configure this automatically whenever the package is loaded, see
+future vignette '[A Future for R: Controlling Default Future Strategy](https://cran.r-project.org/web/packages/future/vignettes/future-4-startup.html)'.
+
+
+## Installation
+R package PSCBS is available on [CRAN](http://cran.r-project.org/package=PSCBS) and can be installed in R as:
+```r
+install.packages('PSCBS')
+```
+
+### Pre-release version
+
+To install the pre-release version that is available in branch `develop`, use:
+```r
+source('http://callr.org/install#HenrikBengtsson/PSCBS@develop')
+```
+This will install the package from source.
+
+
+## Software status
+
+| Resource: | CRAN | Travis CI | Appveyor |
+| ------------- | ------------------- | --------------- | ---------------- |
+| _Platforms:_ | _Multiple_ | _Linux & macOS_ | _Windows_ |
+| R CMD check | <a href="https://cran.r-project.org/web/checks/check_results_PSCBS.html"><img border="0" src="http://www.r-pkg.org/badges/version/PSCBS" alt="CRAN version"></a> | <a href="https://travis-ci.org/HenrikBengtsson/PSCBS"><img src="https://travis-ci.org/HenrikBengtsson/PSCBS.svg" alt="Build status"></a> | <a href="https://ci.appveyor.com/project/HenrikBengtsson/pscbs"><img src="https://ci.appveyor.com/api/projects/status/github/HenrikBengtsson/PSCBS?svg=true" alt="Build st [...]
+| Test coverage | | <a href="https://codecov.io/gh/HenrikBengtsson/PSCBS"><img src="https://codecov.io/gh/HenrikBengtsson/PSCBS/branch/develop/graph/badge.svg" alt="Coverage Status"/></a> | |
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..3ac6a36
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,78 @@
+#----------------------------------------------------------------
+# AppVeyor configuration for R packages
+#
+# REFERENCES:
+# * AppVeyor CI: https://ci.appveyor.com/
+# * r-appveyor: https://github.com/krlmlr/r-appveyor
+#
+# Validate your .appveyor.yml file at
+# https://ci.appveyor.com/tools/validate-yaml
+#----------------------------------------------------------------
+environment:
+ _R_CHECK_FORCE_SUGGESTS_: false
+
+ matrix:
+ - R_VERSION: devel
+ R_ARCH: x64
+
+ - R_VERSION: devel
+ R_ARCH: i386
+
+ - R_VERSION: release
+ R_ARCH: x64
+
+
+# DO NOT CHANGE the "init" and "install" sections below
+
+# Download script file from GitHub
+init:
+ ps: |
+ $ErrorActionPreference = "Stop"
+ Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1"
+ Import-Module '..\appveyor-tool.ps1'
+install:
+ ps: |
+ Bootstrap
+ InstallRtools
+
+# Adapt as necessary starting from here
+
+build_script:
+ - echo Current directory=%CD%
+ - travis-tool.sh install_bioc aroma.light
+ - travis-tool.sh install_r Hmisc
+
+ - travis-tool.sh install_r R.rsp
+ - travis-tool.sh install_bioc DNAcopy
+ - travis-tool.sh install_r future listenv matrixStats R.cache R.methodsS3 R.oo R.utils
+ - travis-tool.sh install_bioc aroma.light
+ - travis-tool.sh install_r ggplot2 Hmisc R.devices R.rsp
+
+test_script:
+ - travis-tool.sh run_tests
+
+after_test:
+ - 7z a all-Rout.zip *.Rcheck\**\*.Rout *.Rcheck\**\*.fail
+
+artifacts:
+ - path: '*.Rcheck\**\*.log'
+ name: Logs
+
+ - path: '*.Rcheck\**\*.out'
+ name: Logs
+
+ - path: '*.Rcheck\**\*.fail'
+ name: Logs
+
+ - path: '\*_*.tar.gz'
+ name: Bits
+
+ - path: '\*_*.zip'
+ name: Bits
+
+ - path: all-Rout.zip
+ name: AllRout
+
+on_failure:
+ - 7z a failure.zip *.Rcheck\*
+ - appveyor PushArtifact failure.zip
diff --git a/build/vignette.rds b/build/vignette.rds
deleted file mode 100644
index daf228b..0000000
Binary files a/build/vignette.rds and /dev/null differ
diff --git a/cran-comments.md b/cran-comments.md
new file mode 100644
index 0000000..5ab29ce
--- /dev/null
+++ b/cran-comments.md
@@ -0,0 +1,55 @@
+# CRAN submission PSCBS 0.62.0
+on 2015-11-10
+
+I've verified that this submission causes *no* issues for
+any of the 11 reverse (non-recursive) package dependencies
+available on CRAN and Bioconductor.
+
+Thanks in advance
+
+
+## Notes not sent to CRAN
+The package has been verified using `R CMD check --as-cran` on:
+
+* Platform x86_64-apple-darwin13.4.0 (64-bit) [Travis CI]:
+ - R 3.2.4 Revised (2016-03-16)
+ - R version 3.3.2 (2016-10-31)
+
+* Platform x86_64-unknown-linux-gnu (64-bit) [Travis CI]:
+ - R version 3.2.5 (2016-04-14)
+ - R version 3.3.1 (2016-06-21)
+ - R Under development (unstable) (2016-11-09 r71641)
+
+* Platform x86_64-pc-linux-gnu (64-bit):
+ - R version 3.1.2 (2014-10-31)
+ - R version 3.3.0 (2016-05-03)
+ - R version 3.3.2 (2016-10-31)
+ - R version 3.3.2 Patched (2016-11-09 r71642)
+
+* Platform x86_64-pc-linux-gnu (64-bit) [r-hub]:
+ - R version 3.3.1 (2016-06-21)
+ - R Under development (unstable) (2016-10-30 r71610)
+
+* Platform i686-pc-linux-gnu (32-bit):
+ - R version 3.3.2 (2016-10-31)
+
+* Platform i386-w64-mingw32 (32-bit) [Appveyor CI]:
+ - R Under development (unstable) (2016-11-09 r71642)
+
+* Platform x86_64-w64-mingw32/x64 (64-bit) [Appveyor CI]:
+ - R version 3.3.2 (2016-10-31)
+ - R Under development (unstable) (2016-11-09 r71642)
+
+* Platform x86_64-w64-mingw32 (64-bit) [r-hub]:
+ - R version 3.2.5 (2016-04-14) (*)
+ - R version 3.3.2 (2016-10-31) (*)
+
+* Platform x86_64-w64-mingw32/x64 (64-bit) [win-builder]:
+ - R version 3.3.2 (2016-10-31)
+ - R Under development (unstable) (2016-11-09 r71642)
+
+
+(*) Gives an error on r-hub for Windows, because R.cache
+tries to set up a cache directory under tempdir(), which
+is currently not availble on r-hub, cf.
+https://github.com/r-hub/rhub/issues/50
diff --git a/incl/999.missingdocs.txt b/incl/999.missingdocs.txt
new file mode 100644
index 0000000..4a9aa7d
--- /dev/null
+++ b/incl/999.missingdocs.txt
@@ -0,0 +1,131 @@
+extractWIG extractWIG.AbstractCBS extractWIG.CBS extractWIG.PSCBS
+all.equal.AbstractCBS all.equal.CBS append append.default
+ applyByRegion applyByRegion.PairedPSCBS arrowsC1C2
+ arrowsC1C2.PairedPSCBS arrowsDeltaC1C2 arrowsDeltaC1C2.PairedPSCBS
+ as.CBS as.DNAcopy as.character.CBS as.data.frame.PSCBS bootstrapCIs
+ bootstrapCIs.PairedPSCBS bootstrapDHByRegion
+ bootstrapDHByRegion.PairedPSCBS bootstrapTCNandDHByRegion
+ callAB callABandHighAI
+ callABandHighAI.PairedPSCBS callABandLowC1 callABandLowC1.PairedPSCBS
+ callAllelicBalance callAllelicBalance.default callAllelicBalanceByDH
+ callAmplifications callArms callArms.CBS
+ callExtremeAllelicImbalanceByDH
+ callExtremeAllelicImbalanceByDH.PairedPSCBS callGainsAndLosses
+ callLOH callLowC1ByC1 callLowC1ByC1.PairedPSCBS callOutliers
+ drawCentromeres drawCentromeres.CBS drawChromosomes
+ drawChromosomes.CBS drawConfidenceBands
+ drawConfidenceBands.PairedPSCBS drawLevels drawLevels.CBS
+ drawLevels.DNAcopy drawLevels.PairedPSCBS
+ dropChangePoint dropRegion dropRegions
+ estimateDeltaAB
+ estimateDeltaABBySmallDH estimateDeltaLOH
+ estimateDeltaLOHByMinC1ForNonAB estimateHighDHQuantileAtAB
+ estimateHighDHQuantileAtAB.PairedPSCBS estimateKappa
+ estimateKappaByC1Density estimateMeanForDH
+ estimateMeanForDH.PairedPSCBS estimateStandardDeviation
+ estimateStandardDeviation.DNAcopy estimateStdDevForHeterozygousBAF
+ estimateStdDevForHeterozygousBAF.PairedPSCBS
+ extractC1C2 extractCallsByLocus
+ extractCallsByLocus.PairedPSCBS
+ extractCallsByLocus.CBS extractChromosome
+ extractChromosome.AbstractCBS extractChromosomes
+ extractChromosomes.AbstractCBS extractChromosomes.CBS
+ extractChromosomes.PSCBS extractDeltaC1C2
+ extractDeltaC1C2.PairedPSCBS extractLocusLevelC1C2
+ extractLocusLevelC1C2.PairedPSCBS extractLocusLevelTCN
+ extractLocusLevelTCN.PairedPSCBS extractMinorMajorCNs extractRegion
+ extractRegion.AbstractCBS extractRegions extractRegions.AbstractCBS
+ extractSegmentMeansByLocus
+ extractSegmentMeansByLocus.DNAcopy extractTCNAndDHs getCallStatistics
+ getCallStatisticsByArms getCallStatisticsByArms.CBS
+ getChromosomeOffsets getChromosomeRanges
+ getChromosomeRanges.CBS getChromosomes getChromosomes.DNAcopy getFGA
+ getFGG getFGL getFractionOfGenomeAltered getFractionOfGenomeGained
+ getFractionOfGenomeLost getLocusData getLocusData.CBS
+ getLocusData.PSCBS getSampleName getSampleNames
+ getSampleNames.DNAcopy getSegments getSegments.CBS getSignalType
+ getSignalType.CBS highlightArmCalls highlightArmCalls.CBS
+ highlightCalls highlightCalls.CBS highlightLocusCalls
+ highlightLocusCalls.CBS isWholeChromosomeGained
+ isWholeChromosomeGained.CBS isWholeChromosomeLost
+ isWholeChromosomeLost.CBS joinSegments linesC1C2
+ linesC1C2.PairedPSCBS linesDeltaC1C2 linesDeltaC1C2.PairedPSCBS
+ mergeNonCalledSegments mergeTwoSegments mergeTwoSegments.CBS
+ nbrOfAmplifications nbrOfAmplifications.CBS nbrOfChangePoints
+ nbrOfChromosomes nbrOfGains nbrOfGains.CBS nbrOfLoci
+ nbrOfLoci.DNAcopy nbrOfLosses nbrOfLosses.CBS nbrOfSamples
+ nbrOfSamples.DNAcopy nbrOfSegments nbrOfSegments.DNAcopy plot.CBS
+ plot.PairedPSCBS plotC1C2 plotC1C2.PairedPSCBS plotDeltaC1C2
+ plotDeltaC1C2.PairedPSCBS
+ plotTracksManyChromosomes.CBS
+ pointsC1C2
+ pointsC1C2.PairedPSCBS pointsDeltaC1C2 pointsDeltaC1C2.PairedPSCBS
+ postsegmentTCN postsegmentTCN.PairedPSCBS print.AbstractCBS
+ sampleName sampleName<- setLocusData
+ setSampleName setSegments signalType
+ signalType.CBS signalType<- signalType<-.CBS subset.CBS
+ tileChromosomes tileChromosomes.AbstractCBS tileChromosomes.CBS
+ tileChromosomes.PairedPSCBS
+ writeLocusData writeLocusData.CBS
+ writeSegments
+extractSegments.AbstractCBS extractSegment.AbstractCBS
+ extractSegment extractSegments extractSegments.CBS
+ extractSegments.PairedPSCBS
+isSegmentSplitter isSegmentSplitter.CBS isSegmentSplitter.PSCBS
+ extractCNs extractCNs.AbstractCBS extractCNs.CBS
+ extractCNs.PairedPSCBS extractTotalCNs extractTotalCNs.CBS
+ getSegmentSizes getSegmentSizes.AbstractCBS getSegmentSizes.CBS
+ getSegmentSizes.PSCBS
+sampleCNs sampleCNs.AbstractCBS
+mergeThreeSegments
+callROH callROHOneSegment callROHOneSegment.PairedPSCBS
+testROH
+pruneBySdUndo updateBoundaries updateBoundaries.CBS
+resegment resegment.AbstractCBS resegment.CBS resegment.PairedPSCBS
+ hclustCNs pruneByHClust updateMeansTogether updateMeans
+drawChangePoints drawChangePoints.AbstractCBS
+drawKnownSegments drawKnownSegments.AbstractCBS
+drawChangePoints.CBS drawChangePoints.PSCBS
+ drawChangePointsC1C2 drawChangePointsC1C2.PairedPSCBS
+extractDhSegment extractDhSegment.PairedPSCBS
+callNTCN callCopyNeutral callCopyNeutralByTCNofAB
+dropChangePoints
+calcStatsForCopyNeutralABs calcStatsForCopyNeutralABs.PairedPSCBS
+callGainNeutralLoss
+callGNL
+renameChromosomes renameChromosomes.AbstractCBS
+report
+writeSegments.DNAcopy
+shiftTCN shiftTCN.AbstractCBS shiftTCN.CBS
+shiftTCN.PairedPSCBS
+getChromosomeOffsets.AbstractCBS getChromosomeRanges.PairedPSCBS
+getChromosomeRanges.AbstractCBS
+seqOfSegmentsByDP seqOfSegmentsByDP.AbstractCBS
+seqOfSegmentsByDP.CBS seqOfSegmentsByDP.PairedPSCBS
+seqOfSegmentsByDP.matrix
+getChromosomeOffsets.PairedPSCBS getLocusSignalNames
+getLocusSignalNames.AbstractCBS getLocusSignalNames.CBS
+getLocusSignalNames.PSCBS getSegmentTrackPrefixes
+getSegmentTrackPrefixes.AbstractCBS getSegmentTrackPrefixes.CBS
+getSegmentTrackPrefixes.PSCBS
+pruneByDP
+getMeanEstimators getMeanEstimators.AbstractCBS
+resegment.NonPairedPSCBS setMeanEstimators
+setMeanEstimators.AbstractCBS
+resetSegments
+getLocusData.NonPairedPSCBS getLocusData.PairedPSCBS
+plotTracks plotTracks1 plotTracks2 plotTracksManyChromosomes
+getSmoothLocusData
+bootstrapSegmentsAndChangepoints
+bootstrapSegmentsAndChangepoints.PairedPSCBS
+getChangePoints getChangePoints.AbstractCBS
+getChangePoints.CBS getChangePoints.PSCBS
+clearBootstrapSummaries clearBootstrapSummaries.PairedPSCBS
+findBootstrapSummaries findBootstrapSummaries.PairedPSCBS
+hasBootstrapSummaries hasBootstrapSummaries.PairedPSCBS
+clearCalls clearCalls.AbstractCBS
+extractSegmentDataByLocus extractSegmentDataByLocus.PairedPSCBS
+updateMeansC1C2 updateMeansC1C2.PairedPSCBS
+encodeCalls encodeCalls.data.frame
+callGLAO callGLAO.CBS
+unTumorBoost unTumorBoost.PairedPSCBS
diff --git a/incl/BengtssonH_etal_2010.Rd b/incl/BengtssonH_etal_2010.Rd
new file mode 100644
index 0000000..f42961e
--- /dev/null
+++ b/incl/BengtssonH_etal_2010.Rd
@@ -0,0 +1 @@
+H. Bengtsson, P. Neuvial and T.P. Speed, \emph{TumorBoost: Normalization of allele-specific tumor copy numbers from a single pair of tumor-normal genotyping microarrays}, BMC Bioinformatics, 2010
\ No newline at end of file
diff --git a/incl/OlshenA_etal_2011.Rd b/incl/OlshenA_etal_2011.Rd
new file mode 100644
index 0000000..32d3630
--- /dev/null
+++ b/incl/OlshenA_etal_2011.Rd
@@ -0,0 +1 @@
+A.B. Olshen, H. Bengtsson, P. Neuvial, P.T. Spellman, R.A. Olshen, V.E. Seshan, \emph{Parent-specific copy number in paired tumor-normal studies using circular binary segmentation}, Bioinformatics, 2011
diff --git a/incl/OlshenVenkatraman_2004.Rd b/incl/OlshenVenkatraman_2004.Rd
new file mode 100644
index 0000000..7aa0a0c
--- /dev/null
+++ b/incl/OlshenVenkatraman_2004.Rd
@@ -0,0 +1 @@
+A.B. Olshen, E.S. Venkatraman (aka Venkatraman E. Seshan), R. Lucito and M. Wigler, \emph{Circular binary segmentation for the analysis of array-based DNA copy number data}, Biostatistics, 2004
diff --git a/incl/VenkatramanOlshen_2007.Rd b/incl/VenkatramanOlshen_2007.Rd
new file mode 100644
index 0000000..cd39214
--- /dev/null
+++ b/incl/VenkatramanOlshen_2007.Rd
@@ -0,0 +1 @@
+E.S. Venkatraman and A.B. Olshen, \emph{A faster circular binary segmentation algorithm for the analysis of array CGH data}, Bioinformatics, 2007
diff --git a/incl/as.DNAcopy.Rex b/incl/as.DNAcopy.Rex
new file mode 100644
index 0000000..500a30f
--- /dev/null
+++ b/incl/as.DNAcopy.Rex
@@ -0,0 +1,13 @@
+
+# Coerce an CBS object to a DNAcopy object
+fitD <- as.DNAcopy(fit)
+
+# Coerce an DNAcopy object to a CBS object
+fitC <- as.CBS(fitD)
+
+# Sanity check
+fitD2 <- as.DNAcopy(fit)
+stopifnot(all.equal(fitD2, fitD))
+
+fitC2 <- as.CBS(fitD2)
+stopifnot(all.equal(fitC2, fitC))
diff --git a/incl/segmentByCBS,calls.Rex b/incl/segmentByCBS,calls.Rex
new file mode 100644
index 0000000..81a1751
--- /dev/null
+++ b/incl/segmentByCBS,calls.Rex
@@ -0,0 +1,12 @@
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# CALLS
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Call gains and losses by segments
+fitC <- callGainsAndLosses(fit)
+
+# Call amplifications by segments
+fitC <- callAmplifications(fitC)
+
+# Call outliers by loci
+fitC <- callOutliers(fitC)
diff --git a/incl/segmentByCBS,knownSegments.Rex b/incl/segmentByCBS,knownSegments.Rex
new file mode 100644
index 0000000..024ce5b
--- /dev/null
+++ b/incl/segmentByCBS,knownSegments.Rex
@@ -0,0 +1,105 @@
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Simulating copy-number data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+set.seed(0xBEEF)
+
+# Number of loci
+J <- 1000
+
+mu <- double(J)
+mu[200:300] <- mu[200:300] + 1
+mu[350:400] <- NA # centromere
+mu[650:800] <- mu[650:800] - 1
+eps <- rnorm(J, sd=1/2)
+y <- mu + eps
+x <- sort(runif(length(y), max=length(y))) * 1e5
+w <- runif(J)
+w[650:800] <- 0.001
+
+
+subplots(6, ncol=1)
+par(mar=c(2,1,1,1)+0.1);
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Segmentation
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fit <- segmentByCBS(y, x=x)
+print(fit)
+plotTracks(fit)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Segmentation with some known change points
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+knownSegments <- data.frame(
+ chromosome=c( 0, 0),
+ start =x[c( 1, 401)],
+ end =x[c(349, J)]
+)
+fit2 <- segmentByCBS(y, x=x, knownSegments=knownSegments, verbose=TRUE)
+print(fit2)
+plotTracks(fit2)
+abline(v=c(knownSegments$start, knownSegments$end)/1e6, lty=3)
+
+
+# Chromosome boundaries can be specified as -Inf and +Inf
+knownSegments <- data.frame(
+ chromosome=c( 0, 0),
+ start =c( -Inf, x[401]),
+ end =c(x[349], +Inf)
+)
+fit2b <- segmentByCBS(y, x=x, knownSegments=knownSegments, verbose=TRUE)
+print(fit2b)
+plotTracks(fit2b)
+abline(v=c(knownSegments$start, knownSegments$end)/1e6, lty=3)
+
+
+# As a proof of concept, it is possible to segment just the centromere,
+# which contains no data. All statistics will be NAs.
+knownSegments <- data.frame(
+ chromosome=c( 0),
+ start =x[c(350)],
+ end =x[c(400)]
+)
+fit3 <- segmentByCBS(y, x=x, knownSegments=knownSegments, verbose=TRUE)
+print(fit3)
+plotTracks(fit3, Clim=c(0,5), xlim=c(0,100))
+abline(v=c(knownSegments$start, knownSegments$end)/1e6, lty=3)
+
+
+
+# If one specify the (empty) centromere as a segment, then its
+# estimated statistics will be NAs, which becomes a natural
+# separator between the two "independent" arms.
+knownSegments <- data.frame(
+ chromosome=c( 0, 0, 0),
+ start =x[c( 1, 350, 401)],
+ end =x[c(349, 400, J)]
+)
+fit4 <- segmentByCBS(y, x=x, knownSegments=knownSegments, verbose=TRUE)
+print(fit4)
+plotTracks(fit4)
+abline(v=c(knownSegments$start, knownSegments$end)/1e6, lty=3)
+
+
+
+fit5 <- segmentByCBS(y, x=x, knownSegments=knownSegments, undo=Inf, verbose=TRUE)
+print(fit5)
+plotTracks(fit5)
+abline(v=c(knownSegments$start, knownSegments$end)/1e6, lty=3)
+stopifnot(nbrOfSegments(fit5) == nrow(knownSegments));
+
+
+# One can also force a separator between two segments by setting
+# 'start' and 'end' to NAs ('chromosome' has to be given)
+knownSegments <- data.frame(
+ chromosome=c( 0, 0, 0),
+ start =x[c( 1, NA, 401)],
+ end =x[c(349, NA, J)]
+)
+fit6 <- segmentByCBS(y, x=x, knownSegments=knownSegments, verbose=TRUE)
+print(fit6)
+plotTracks(fit6)
+abline(v=c(knownSegments$start, knownSegments$end)/1e6, lty=3)
+
diff --git a/incl/segmentByCBS,plot.Rex b/incl/segmentByCBS,plot.Rex
new file mode 100644
index 0000000..76cb921
--- /dev/null
+++ b/incl/segmentByCBS,plot.Rex
@@ -0,0 +1,6 @@
+
+xlab <- "Position (Mb)"
+ylim <- c(-3,3)
+xMb <- x/1e6
+plot(xMb,y, pch=20, col="#aaaaaa", xlab=xlab, ylim=ylim)
+drawLevels(fit, col="red", lwd=2, xScale=1e-6)
diff --git a/incl/segmentByCBS,pruneBySdUndo.Rex b/incl/segmentByCBS,pruneBySdUndo.Rex
new file mode 100644
index 0000000..ab6f738
--- /dev/null
+++ b/incl/segmentByCBS,pruneBySdUndo.Rex
@@ -0,0 +1,33 @@
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Simulating copy-number data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+set.seed(0xBEEF)
+
+# Number of loci
+J <- 1000
+
+mu <- double(J)
+mu[1:100] <- mu[1:100] + 0.3
+mu[200:300] <- mu[200:300] + 1
+mu[350:400] <- NA # centromere
+mu[650:800] <- mu[650:800] - 1
+eps <- rnorm(J, sd=1/2)
+y <- mu + eps
+x <- sort(runif(length(y), max=length(y))) * 1e5
+w <- runif(J)
+w[650:800] <- 0.001
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Segmentation
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fit <- segmentByCBS(y, x=x)
+print(fit)
+plotTracks(fit)
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Post-segmentation pruning
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fitP <- pruneBySdUndo(fit, rho=1)
+drawLevels(fitP, col="red")
diff --git a/incl/segmentByCBS,tests.Rex b/incl/segmentByCBS,tests.Rex
new file mode 100644
index 0000000..09df861
--- /dev/null
+++ b/incl/segmentByCBS,tests.Rex
@@ -0,0 +1,84 @@
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# TESTS
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fit <- segmentByCBS(y, x=x, seed=0xBEEF)
+print(fit)
+## id chromosome start end nbrOfLoci mean
+## 1 y 0 55167.82 20774251 201 0.0164
+## 2 y 0 20774250.85 29320105 99 1.0474
+## 3 y 0 29320104.86 65874675 349 -0.0227
+## 4 y 0 65874675.06 81348129 151 -1.0813
+## 5 y 0 81348129.20 99910827 200 -0.0612
+
+
+# Test #1: Reverse the ordering and segment
+fitR <- segmentByCBS(rev(y), x=rev(x), seed=0xBEEF)
+# Sanity check
+stopifnot(all.equal(getSegments(fitR), getSegments(fit)))
+# Sanity check
+stopifnot(all.equal(rev(getLocusData(fitR)$index), getLocusData(fit)$index))
+
+# Test #2: Reverse, but preserve ordering of 'data' object
+fitRP <- segmentByCBS(rev(y), x=rev(x), preserveOrder=TRUE)
+stopifnot(all.equal(getSegments(fitRP), getSegments(fit)))
+
+
+# (Test #3: Change points inbetween data points at the same locus)
+x[650:654] <- x[649]
+fitC <- segmentByCBS(rev(y), x=rev(x), preserveOrder=TRUE, seed=0xBEEF)
+
+# Test #4: Allow for some missing values in signals
+y[450] <- NA
+fitD <- segmentByCBS(y, x=x, seed=0xBEEF)
+
+
+# Test #5: Allow for some missing genomic annotations
+x[495] <- NA
+fitE <- segmentByCBS(y, x=x, seed=0xBEEF)
+
+
+# Test #6: Undo all change points found
+fitF <- segmentByCBS(y, x=x, undo=Inf, seed=0xBEEF)
+print(fitF)
+stopifnot(nbrOfSegments(fitF) == 1L)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# MISC.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Emulate a centromere
+x[650:699] <- NA
+fit <- segmentByCBS(y, x=x, seed=0xBEEF)
+xMb <- x/1e6
+plot(xMb,y, pch=20, col="#aaaaaa", xlab=xlab, ylim=ylim)
+drawLevels(fit, col="red", lwd=2, xScale=1e-6)
+
+fitC <- segmentByCBS(y, x=x, joinSegments=FALSE, seed=0xBEEF)
+drawLevels(fitC, col="blue", lwd=2, xScale=1e-6)
+
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Multiple chromosomes
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Appending CBS results
+fit1 <- segmentByCBS(y, chromosome=1, x=x)
+fit2 <- segmentByCBS(y, chromosome=2, x=x)
+fit <- append(fit1, fit2)
+print(fit)
+plotTracks(fit, subset=NULL, lwd=2, Clim=c(-3,3))
+
+
+# Segmenting multiple chromosomes at once
+chromosomeWG <- rep(1:2, each=J)
+xWG <- rep(x, times=2)
+yWG <- rep(y, times=2)
+fitWG <- segmentByCBS(yWG, chromosome=chromosomeWG, x=xWG)
+print(fitWG)
+plotTracks(fitWG, subset=NULL, lwd=2, Clim=c(-3,3))
+
+# Assert same results
+fit$data[,"index"] <- getLocusData(fitWG)[,"index"] # Ignore 'index'
+stopifnot(all.equal(getLocusData(fitWG), getLocusData(fit)))
+stopifnot(all.equal(getSegments(fitWG), getSegments(fit)))
diff --git a/tests/segmentByCBS,flavors.R.HIDE b/incl/segmentByCBS.Rex
similarity index 56%
rename from tests/segmentByCBS,flavors.R.HIDE
rename to incl/segmentByCBS.Rex
index 414e615..5d4bf02 100644
--- a/tests/segmentByCBS,flavors.R.HIDE
+++ b/incl/segmentByCBS.Rex
@@ -1,12 +1,3 @@
-###########################################################
-# This tests:
-# - segmentByCBS(...)
-# - segmentByCBS(..., knownSegments)
-# - tileChromosomes()
-# - plotTracks()
-###########################################################
-library("PSCBS")
-subplots <- R.utils::subplots
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Simulating copy-number data
@@ -18,6 +9,7 @@ J <- 1000
mu <- double(J)
mu[200:300] <- mu[200:300] + 1
+mu[350:400] <- NA # centromere
mu[650:800] <- mu[650:800] - 1
eps <- rnorm(J, sd=1/2)
y <- mu + eps
@@ -26,6 +18,10 @@ w <- runif(J)
w[650:800] <- 0.001
-fit <- segmentByCBS(y, x=x, verbose=TRUE)
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Segmentation
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fit <- segmentByCBS(y, x=x)
print(fit)
plotTracks(fit)
+
diff --git a/incl/segmentByNonPairedPSCBS.Rex b/incl/segmentByNonPairedPSCBS.Rex
new file mode 100644
index 0000000..19a1fcb
--- /dev/null
+++ b/incl/segmentByNonPairedPSCBS.Rex
@@ -0,0 +1,72 @@
+verbose <- R.utils::Arguments$getVerbose(-10*interactive(), timestamp=TRUE)
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Load SNP microarray data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+data <- PSCBS::exampleData("paired.chr01")
+str(data)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Paired PSCBS segmentation
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Drop single-locus outliers
+dataS <- dropSegmentationOutliers(data)
+
+# Speed up example by segmenting fewer loci
+dataS <- dataS[seq(from=1, to=nrow(data), by=20),]
+
+str(dataS)
+
+R.oo::attachLocally(dataS)
+
+# Non-Paired PSCBS segmentation
+fit <- segmentByNonPairedPSCBS(CT, betaT=betaT,
+ chromosome=chromosome, x=x,
+ seed=0xBEEF, verbose=verbose)
+print(fit)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Bootstrap segment level estimates
+# (used by the AB caller, which, if skipped here,
+# will do it automatically)
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fit <- bootstrapTCNandDHByRegion(fit, B=100, verbose=verbose)
+print(fit)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Calling segments in allelic balance (AB)
+# NOTE: Ideally, this should be done on whole-genome data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Explicitly estimate the threshold in DH for calling AB
+# (which be done by default by the caller, if skipped here)
+deltaAB <- estimateDeltaAB(fit, flavor="qq(DH)", verbose=verbose)
+print(deltaAB)
+
+fit <- callAB(fit, delta=deltaAB, verbose=verbose)
+print(fit)
+
+
+# Even if not explicitly specified, the estimated
+# threshold parameter is returned by the caller
+stopifnot(fit$params$deltaAB == deltaAB)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Calling segments in loss-of-heterozygosity (LOH)
+# NOTE: Ideally, this should be done on whole-genome data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Explicitly estimate the threshold in C1 for calling LOH
+# (which be done by default by the caller, if skipped here)
+deltaLOH <- estimateDeltaLOH(fit, flavor="minC1|nonAB", verbose=verbose)
+print(deltaLOH)
+
+fit <- callLOH(fit, delta=deltaLOH, verbose=verbose)
+print(fit)
+plotTracks(fit)
+
+# Even if not explicitly specified, the estimated
+# threshold parameter is returned by the caller
+stopifnot(fit$params$deltaLOH == deltaLOH)
diff --git a/incl/segmentByPairedPSCBS,HetsAndHoms.Rex b/incl/segmentByPairedPSCBS,HetsAndHoms.Rex
new file mode 100644
index 0000000..41e2186
--- /dev/null
+++ b/incl/segmentByPairedPSCBS,HetsAndHoms.Rex
@@ -0,0 +1,62 @@
+verbose <- R.utils::Arguments$getVerbose(-10*interactive(), timestamp=TRUE)
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Load SNP microarray data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+data <- PSCBS::exampleData("paired.chr01")
+str(data)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Paired PSCBS segmentation
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Drop single-locus outliers
+dataS <- dropSegmentationOutliers(data)
+
+# Speed up example by segmenting fewer loci
+#dataS <- dataS[seq(from=1, to=nrow(data), by=5),]
+
+str(dataS)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Paired PSCBS segmentation
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+gaps <- findLargeGaps(dataS, minLength=2e6)
+knownSegments <- gapsToSegments(gaps, dropGaps=TRUE)
+
+fit <- segmentByPairedPSCBS(dataS, knownSegments=knownSegments,
+ seed=0xBEEF, verbose=verbose)
+print(fit)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Paired PSCN mean levels of hets and homs separately
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Fix segments as above
+segs <- getSegments(fit)[,c("chromosome", "tcnStart", "tcnEnd")]
+names(segs)[2:3] <- c("start", "end")
+
+# Identify heterozygous SNPs
+isHet <- (getLocusData(fit)$muN == 1/2)
+
+fitList <- list()
+for (key in c("homozygotes", "heterozygotes")) {
+ dataT <- dataS
+ excl <- if(key == "homozygotes") isHet else !isHet
+ dataT$CT[excl] <- NA
+
+ fitT <- segmentByPairedPSCBS(dataT, knownSegments=segs,
+ undoTCN=Inf, undoDH=Inf, verbose=verbose)
+ fitList[[key]] <- fitT
+} # for (key ...)
+
+
+# Plot results
+subplots(2, ncol=1)
+for (key in names(fitList)) {
+ fitT <- fitList[[key]]
+ plotTracks(fitT, tracks="tcn,c1,c2", add=FALSE)
+ abline(h=0:6, lty=3, col="gray")
+ title(main=key)
+}
diff --git a/incl/segmentByPairedPSCBS,allLOH.Rex b/incl/segmentByPairedPSCBS,allLOH.Rex
new file mode 100644
index 0000000..b858088
--- /dev/null
+++ b/incl/segmentByPairedPSCBS,allLOH.Rex
@@ -0,0 +1,43 @@
+#############################################################
+# PROBLEMATIC CASE
+# Title: All chromosome is in LOH
+# Created by: Henrik Bengtsson
+# Created on: 2011-07-08
+#
+# Description:
+# The following example illustrates a case when the AB
+# caller fails, because Delta_AB is estimated too large,
+# resulting in all segments being called AB and none LOH.
+#
+# Use case:
+# This could happend when PSCBS runs on a single chromosome
+# that is in LOH. It is unlikely to happen when processing
+# whole-genome data.
+#############################################################
+verbose <- R.utils::Arguments$getVerbose(-10*interactive(), timestamp=TRUE)
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Load SNP microarray data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+data <- PSCBS::exampleData("paired.chr01")
+
+# Subset data (such that all regions will be in LOH)
+data <- subset(data, x <= 125e6)
+
+str(data)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Paired PSCBS segmentation
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Drop single-locus outliers
+dataS <- dropSegmentationOutliers(data)
+
+# Paired PSCBS segmentation
+fit <- segmentByPairedPSCBS(dataS, seed=0xBEEF, verbose=verbose)
+
+fit <- callAB(fit, verbose=verbose)
+fit <- callLOH(fit, verbose=verbose)
+print(fit)
+str(fit$params) # deltaAB=1.17, deltaLowC1=-Inf
+plotTracks(fit)
diff --git a/incl/segmentByPairedPSCBS.Rex b/incl/segmentByPairedPSCBS.Rex
new file mode 100644
index 0000000..8280151
--- /dev/null
+++ b/incl/segmentByPairedPSCBS.Rex
@@ -0,0 +1,78 @@
+verbose <- R.utils::Arguments$getVerbose(-10*interactive(), timestamp=TRUE)
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Load SNP microarray data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+data <- PSCBS::exampleData("paired.chr01")
+str(data)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Paired PSCBS segmentation
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Drop single-locus outliers
+dataS <- dropSegmentationOutliers(data)
+
+# Speed up example by segmenting fewer loci
+dataS <- dataS[seq(from=1, to=nrow(data), by=10),]
+
+str(dataS)
+
+R.oo::attachLocally(dataS)
+
+# Paired PSCBS segmentation
+fit <- segmentByPairedPSCBS(CT, betaT=betaT, betaN=betaN,
+ chromosome=chromosome, x=x,
+ seed=0xBEEF, verbose=verbose)
+print(fit)
+
+# Plot results
+plotTracks(fit)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Bootstrap segment level estimates
+# (used by the AB caller, which, if skipped here,
+# will do it automatically)
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fit <- bootstrapTCNandDHByRegion(fit, B=100, verbose=verbose)
+print(fit)
+plotTracks(fit)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Calling segments in allelic balance (AB)
+# NOTE: Ideally, this should be done on whole-genome data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Explicitly estimate the threshold in DH for calling AB
+# (which be done by default by the caller, if skipped here)
+deltaAB <- estimateDeltaAB(fit, flavor="qq(DH)", verbose=verbose)
+print(deltaAB)
+## [1] 0.1657131
+
+fit <- callAB(fit, delta=deltaAB, verbose=verbose)
+print(fit)
+plotTracks(fit)
+
+# Even if not explicitly specified, the estimated
+# threshold parameter is returned by the caller
+stopifnot(fit$params$deltaAB == deltaAB)
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Calling segments in loss-of-heterozygosity (LOH)
+# NOTE: Ideally, this should be done on whole-genome data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Explicitly estimate the threshold in C1 for calling LOH
+# (which be done by default by the caller, if skipped here)
+deltaLOH <- estimateDeltaLOH(fit, flavor="minC1|nonAB", verbose=verbose)
+print(deltaLOH)
+## [1] 0.625175
+
+fit <- callLOH(fit, delta=deltaLOH, verbose=verbose)
+print(fit)
+plotTracks(fit)
+
+# Even if not explicitly specified, the estimated
+# threshold parameter is returned by the caller
+stopifnot(fit$params$deltaLOH == deltaLOH)
diff --git a/inst/CITATION b/inst/CITATION
index ce802c7..b2dd350 100644
--- a/inst/CITATION
+++ b/inst/CITATION
@@ -1,4 +1,4 @@
-citHeader("Please cite one or more of the below references");
+citHeader("Please cite PSCBS using one or more of the following references:");
citEntry(
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -12,7 +12,7 @@ citEntry(
volume = "27",
number = "15",
doi = "10.1093/bioinformatics/btr329",
- url = "http://bioinformatics.oxfordjournals.org/content/27/15/2038",
+ url = "https://bioinformatics.oxfordjournals.org/content/27/15/2038",
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Plain-text citation:
@@ -39,7 +39,7 @@ citEntry(
volume = "11",
number = "245",
doi = "10.1186/1471-2105-11-245",
- url = "http://www.biomedcentral.com/1471-2105/11/245/",
+ url = "https://www.biomedcentral.com/1471-2105/11/245/",
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Plain-text citation:
diff --git a/inst/doc/CBS.R b/inst/doc/CBS.R
deleted file mode 100644
index 8e3518a..0000000
--- a/inst/doc/CBS.R
+++ /dev/null
@@ -1,94 +0,0 @@
-###########################################################################
-## This 'tangle' R script was created from an RSP document.
-## RSP source document: './CBS.tex.rsp'
-## Metadata 'title': 'Total copy-number segmentation using CBS'
-## Metadata 'author': 'Henrik Bengtsson'
-## Metadata 'engine': 'R.rsp::rsp'
-## Metadata 'keywords': 'copy numbers, genomic aberrations'
-###########################################################################
-
-t0 <- Sys.time()
-R.utils::use("R.utils")
-
-# RSP specific
-R.rsp <- R.oo::Package("R.rsp")
-withCapture <- R.utils::withCapture
-options("withCapture/newline"=FALSE)
-options(str=strOptions(strict.width="cut"))
-options(width=85)
-options(digits=3)
-
-# Graphics
-use("R.devices")
-options("devEval/args/field"="fullname") # Preferred for LaTeX
-devOptions("png", width=840)
-
-# Analysis
-use("PSCBS")
-PSCBS <- R.oo::Package("PSCBS")
-fixLocations <- function(fit, ...) {
- for (key in grep("(end|start)$", colnames(fit$output))) {
- fit$output[[key]] <- as.integer(fit$output[[key]])
- }
- fit
-} # fixLocations()
-
-signalType <- "TCN"
-R.rsp$version
-R.rsp$author
-format(as.Date(PSCBS$date), format="%B %d, %Y")
-fullname <- "PairedPSCBS,exData,chr01"
-withCapture({
-data <- PSCBS::exampleData("paired.chr01")
-data <- data[,c("chromosome", "x", "CT")]
-colnames(data)[3] <- "y"
-str(data)
-})
-signalType
-signalType
-withCapture({
-data <- dropSegmentationOutliers(data)
-})
-signalType
-withCapture({
-gaps <- findLargeGaps(data, minLength=1e6)
-gaps
-})
-withCapture({
-knownSegments <- gapsToSegments(gaps)
-knownSegments
-})
-signalType
-signalType
-withCapture({
-fit <- segmentByCBS(data, knownSegments=knownSegments, seed=0xBEEF, verbose=-10)
-})
-signalType
-nbrOfSegments(fit)
-signalType
-fit <- fixLocations(fit)
-withCapture({
-getSegments(fit, simplify=TRUE)
-})
-segs <- getSegments(fit, simplify=TRUE)
-which(segs$nbrOfLoci == 0)
-signalType
-signalType
-signalType
-toPNG(fullname, tags=c(class(fit)[1L], "tracks"), aspectRatio=0.35, {
- plotTracks(fit)
- })
-signalType
-signalType
-signalType
-signalType
-withCapture({
-fitP <- pruneByHClust(fit, h=0.25, verbose=-10)
-})
-toPNG(fullname, tags=c(class(fitP)[1L], "pruned", "tracks"), aspectRatio=0.35, {
- plotTracks(fitP)
- })
-signalType
-toLatex(sessionInfo())
-dt <- round(Sys.time()-t0, digits=2)
-attr(dt, "units")
diff --git a/inst/doc/CBS.pdf b/inst/doc/CBS.pdf
deleted file mode 100644
index 696a995..0000000
Binary files a/inst/doc/CBS.pdf and /dev/null differ
diff --git a/inst/doc/CBS.tex.rsp b/inst/doc/CBS.tex.rsp
deleted file mode 100644
index 979b1df..0000000
--- a/inst/doc/CBS.tex.rsp
+++ /dev/null
@@ -1,305 +0,0 @@
-<%@meta language="R-vignette" content="--------------------------------
-DIRECTIVES FOR R:
-
-%\VignetteIndexEntry{Total copy-number segmentation using CBS}
-%\VignetteKeyword{copy numbers}
-%\VignetteKeyword{genomic aberrations}
-%\VignetteAuthor{Henrik Bengtsson}
-%\VignetteEngine{R.rsp::rsp}
---------------------------------------------------------------------"%>
-
-<% t0 <- Sys.time() %>
-
-<%
-R.utils::use("R.utils")
-
-# RSP specific
-R.rsp <- R.oo::Package("R.rsp")
-withCapture <- R.utils::withCapture
-options("withCapture/newline"=FALSE)
-options(str=strOptions(strict.width="cut"))
-options(width=85)
-options(digits=3)
-
-# Graphics
-use("R.devices")
-options("devEval/args/field"="fullname") # Preferred for LaTeX
-devOptions("png", width=840)
-
-# Analysis
-use("PSCBS")
-PSCBS <- R.oo::Package("PSCBS")
-fixLocations <- function(fit, ...) {
- for (key in grep("(end|start)$", colnames(fit$output))) {
- fit$output[[key]] <- as.integer(fit$output[[key]])
- }
- fit
-} # fixLocations()
-
-signalType <- "TCN"
-%>
-
-\documentclass[letter]{article}
-\usepackage{xspace}
-\usepackage{alltt}
-\usepackage{xcolor}
-\usepackage{natbib} % \citep{}, \citet{}
-
-\usepackage{graphicx}
-\graphicspath{{figures/}}
-
-<%-------------------------------------------------------------------
- Assign PDF metadata
- -------------------------------------------------------------------%>
-% PDF metadata
-\usepackage{hyperref}
-% Ideally \hypersetup{hidelinks}, but for backward compatibility:
-\hypersetup{pdfborder={0 0 0}}
-\hypersetup{
- pdfauthor={<%@meta name="author"%>},
- pdftitle={<%@meta name="title"%>},
- pdfsubject={},
- pdfkeywords={<%@meta name="keywords"%>},
- pdfproducer={R.rsp v<%=R.rsp$version%> by <%=R.rsp$author%>}
-}
-
-% Page margins
-\addtolength{\oddsidemargin}{-0.5in}
-\addtolength{\evensidemargin}{-0.5in}
-\addtolength{\textwidth}{1in}
-\addtolength{\topmargin}{-0.5in}
-\addtolength{\textheight}{1in}
-
-% Placement of floats
-\setcounter{bottomnumber}{2}
-\renewcommand{\topfraction}{1.0}
-\renewcommand{\bottomfraction}{1.0}
-\renewcommand{\textfraction}{0.0}
-\renewcommand{\floatpagefraction}{1.0}
-
-% Macros
-\newcommand{\keywords}[1]{{\footnotesize{\textbf{Keywords: }#1}}\xspace}
-\newcommand{\pkg}[1]{\textsl{#1}\xspace}
-\newcommand{\file}[1]{\textsl{#1}\xspace}
-\newcommand{\code}[1]{\texttt{#1}\xspace}
-\newcommand{\bs}{$\backslash$}
-
-\newenvironment{rspVerbatim}{\vspace{-\parskip}\begin{alltt}\color{blue}}{\end{alltt}}
-\newenvironment{escapeRspVerbatim}{\vspace{-\parskip}\begin{alltt}}{\end{alltt}}
-
-
-\title{<%@meta name="title"%>}
-\author{<%@meta name="author"%>}
-\date{<%=format(as.Date(PSCBS$date), format="%B %d, %Y")%>}
-
-\begin{document}
-
-\maketitle
-\begin{abstract}
-The Circular Binary Segmentation (CBS) method partitions a genome into segments of constant total copy numbers (TCNs) based on DNA microarray data. The method also calls ....
-CBS was designed to work with data from any DNA microarray technology and generation, including Affymetrix and Illumina.
-
-This document shows how to use the \pkg{PSCBS} package to run CBS on a tumor sample.
-\end{abstract}
-
-\keywords{<%@meta name="keywords"%>}
-
-\begin{center}
-\emph{This vignette is distributed as part of the \pkg{PSCBS} package, which is available on CRAN (\url{http://cran.r-project.org/}).
-The authors very much appreciate feedback on this document.}
-\end{center}
-
-\clearpage
-\tableofcontents
-
-\clearpage
-
-<%-------------------------------------------------------------------
- BACKGROUND
- -------------------------------------------------------------------%>
-\section{Background}
-\label{secBackground}
-We will here use a small example data set to illustrate how to setup the data in a format suitable for CBS, how to identify segments, how to call them, and how to plot and export the segmentation results.
-The statistical model and the algorithm behind CBS is explained in detail in \citet{OlshenA_etal_2004, VenkatramanOlshen_2007}.
-
-
-<%-------------------------------------------------------------------
- EXAMPLE
- -------------------------------------------------------------------%>
-\section{Preparing data to be segmented}
-The CBS method requires total copy-number (TCN) estimates. More precisely, it requires TCN ratios for a sample of interest relative to a reference ($y$). The genomic location of the loci in form of chromosome and physical position are also required.
-
-
-\subsection{Locus-level total copy-number signals}
-\label{secData}
-In this example we will use a small example data set part of the \pkg{PSCBS} package. It can be loaded as:
-<%
-fullname <- "PairedPSCBS,exData,chr01"
-%>
-\begin{verbatim}
-<%=withCapture({
-data <- PSCBS::exampleData("paired.chr01")
-data <- data[,c("chromosome", "x", "CT")]
-colnames(data)[3] <- "y"
-str(data)
-})%>
-\end{verbatim}
-In additional to the mandatory fields (\code{chromosome}, \code{x}, and \code{C} this data set also contains .... The latter will not be used here.
-
-\subsection{Dropping <%=signalType%> outliers}
-\label{secTCNOutliers}
-There may be some outliers among the <%=signalType%>s. In CBS~\citep{OlshenA_etal_2004,VenkatramanOlshen_2007}, the authors propose a method for identifying outliers and then to shrink such values toward their neighbors ("smooth") before performing segmentation. At the time CBS was developed it made sense to not just to drop outliers because the resolution was low and every datapoint was valuable. With modern technologies the resolution is much higher and we can afford dropping such o [...]
-\begin{verbatim}
-<%=withCapture({
-data <- dropSegmentationOutliers(data)
-})%>
-\end{verbatim}
-Dropping <%=signalType%> outliers is optional.
-
-
-
-\section{CBS segmentation}
-
-\subsection{Skipping centromeres and other large gaps}
-\label{secGaps}
-The CBS method does not take the physical locations (in units of nucleotides) of the loci in to account when segmenting the data, only their relative ordering along the genome. This means that after having ordered the loci along genome, it will treat two "neighboring" loci that are on both sides of the centromere equally as two neighboring loci that are only few hundred bases apart. This may introduce erroneous change points that appears to be inside the centromere and biological impos [...]
-
-To avoid this, although not mandatory, we will locate all gaps of the genome where there are no observered loci. As a threshold we will consider a region to be a "gap" if the distance between the two closest loci is greater than 1Mb.
-\begin{verbatim}
-<%=withCapture({
-gaps <- findLargeGaps(data, minLength=1e6)
-gaps
-})%>
-\end{verbatim}
-which shows that there is a 20.5Mb long gap between 121.0Mb and 141.5Mb on Chromosome~1. This is the centromere of Chromosome~1.
-Gaps cannot be specified directly. Instead they need to be give as part of a set of "known" segments, which is done as:
-\begin{verbatim}
-<%=withCapture({
-knownSegments <- gapsToSegments(gaps)
-knownSegments
-})%>
-\end{verbatim}
-Below, we will use this to tell CBS to segment Chromosome~1 in three independent segments, where the first segments is from the beginning of the chromosomes (hence '-Inf') to 120.1Mb, the second from 120.1-141.5Mb (the above gap), and the third is from 141.5Mb to the end of the chromosome (hence '+Inf').
-Just as CBS segments chromosomes independently of each other, it also segments priorly known segments independently of each other.
-Specifying known segments is optional.
-
-
-\subsection{Identifying <%=signalType%> segments}
-We are now ready to segment the locus-level <%=signalType%> signals. This is done by\footnote{We fix the random seed in order for the results of this vignette to be exactly reproducible.}:
-\begin{verbatim}
-<%=withCapture({
-fit <- segmentByCBS(data, knownSegments=knownSegments, seed=0xBEEF, verbose=-10)
-})%>
-\end{verbatim}
-Note that this may take several minutes when applied to whole-genome data.
-
-The result of the segmentation is a set of segments identified to have the same underlying <%=signalType%> levels. In this particular case, <%=nbrOfSegments(fit)%> <%=signalType%> segments were found:
-<% fit <- fixLocations(fit) %>
-\begin{verbatim}
-<%=withCapture({
-getSegments(fit, simplify=TRUE)
-})%>
-\end{verbatim}
-<% segs <- getSegments(fit, simplify=TRUE) %>
-Note how Segment~\#<%=which(segs$nbrOfLoci == 0)%> has no mean-level estimates. It is because it corresponds to the centromere (the gap) that was identified above. CBS did indeed try to segment it, but since there are no data points, all estimates are missing values.
-
-
-\subsection{Displaying genomic <%=signalType%> profiles}
-To plot the <%=signalType%> segmentation results, do:
-\begin{verbatim}
-plotTracks(fit)
-\end{verbatim}
-which displays <%=signalType%> as in Figure~\ref{figTracks}.
-To zoom in on a partical region, do:
-\begin{verbatim}
-plotTracks(fit, xlim=c(120,244)*1e6)
-\end{verbatim}
-\begin{figure}[htp]
- \begin{center}
- \resizebox{0.96\textwidth}{!}{\includegraphics{<%=toPNG(fullname, tags=c(class(fit)[1L], "tracks"), aspectRatio=0.35, {
- plotTracks(fit)
- })%>}}
- \end{center}
- \caption{Segments identified by CBS.
- The <%=signalType%> signals with the <%=signalType%> mean levels (purple).
- }
- \label{figTracks}
-\end{figure}
-
-
-
-
-
-
-\section{Calling segments}
-TBA.
-
-<%---
-\subsection{Results from calling <%=signalType%> states}
-All calls are appended to the segmentation results as logical columns:
-\begin{verbatim}
-<%=withCapture({
-getSegments(fit, simplify=TRUE)
-})%>
-\end{verbatim}
-<% segs <- getSegments(fit, simplify=TRUE) %>
----%>
-
-\section{Saving results}
-
-\subsection{Writing segments to a tab-delimited text file}
-To write the <%=signalType%> segmentation results to file, do:
-\begin{verbatim}
-pathname <- writeSegments(fit, name="MySample", simplify=TRUE)
-\end{verbatim}
-
-
-\section{Experimental}
-In this section we illustrate some of the ongoing and future work of the PSCBS package. Please be aware that these methods are very much under construction, possibly incomplete and in worst case even incorrect.
-
-
-\subsection{Pruning segmentation profile}
-By using hierarchical cluster of the segment means it is possible to prune the <%=signalType%> profile such that change points with very small absolute changes are dropped. If change points are dropped this way, this results in a smaller number of segments, which are hence longer.
-\begin{verbatim}
-<%=withCapture({
-fitP <- pruneByHClust(fit, h=0.25, verbose=-10)
-})%>
-\end{verbatim}
-\begin{figure}[htp]
- \begin{center}
- \resizebox{0.96\textwidth}{!}{\includegraphics{<%=toPNG(fullname, tags=c(class(fitP)[1L], "pruned", "tracks"), aspectRatio=0.35, {
- plotTracks(fitP)
- })%>}}
- \end{center}
- \caption{Pruned <%=signalType%> segments plotted as in Figure~\ref{figTracks}.}
- \label{figTracksPruned}
-\end{figure}
-
-
-\subsection{Report generation}
-A multipage PDF report that contains both whole-genome and per-chromosome summaries and figures can be generated by:
-\begin{verbatim}
-> report(fit, sampleName="CBS", studyName="CBS-Ex", verbose=-10)
-\end{verbatim}
-By default, the reports are written to directory \code{reports/<studyName>/} under the current working directory. In addition to the PDF, that directory also contains subdirectory \code{figures/} holding all generated figure files (e.g. PNGs and PDFs) for easy inclusion elsewhere.
-
-
-
-<%-------------------------------------------------------------------
- REFERENCES
- -------------------------------------------------------------------%>
-\bibliographystyle{natbib}
-\bibliography{PSCBS}
-
-
-<%-------------------------------------------------------------------
- APPENDIX
- -------------------------------------------------------------------%>
-\clearpage
-\section*{Appendix}
-\subsection*{Session information}
-<%=toLatex(sessionInfo())%>
-This report was automatically generated using \code{rfile()} of the R.rsp package.
-Total processing time after RSP-to-R translation was <%=dt <- round(Sys.time()-t0, digits=2)%> <%=attr(dt, "units")%>.
-
-\end{document}
diff --git a/inst/doc/PairedPSCBS.R b/inst/doc/PairedPSCBS.R
deleted file mode 100644
index e1ccae6..0000000
--- a/inst/doc/PairedPSCBS.R
+++ /dev/null
@@ -1,92 +0,0 @@
-###########################################################################
-## This 'tangle' R script was created from an RSP document.
-## RSP source document: './PairedPSCBS.tex.rsp'
-## Metadata 'title': 'Parent-specific copy-number segmentation using Paired PSCBS'
-## Metadata 'author': 'Henrik Bengtsson'
-## Metadata 'engine': 'R.rsp::rsp'
-## Metadata 'keywords': 'copy numbers, allele specific, parent specific, genomic aberrations'
-###########################################################################
-
-t0 <- Sys.time()
-R.utils::use("R.utils")
-
-# RSP specific
-R.rsp <- R.oo::Package("R.rsp")
-withCapture <- R.utils::withCapture
-options("withCapture/newline"=FALSE)
-options(str=strOptions(strict.width="cut"))
-options(width=85)
-options(digits=3)
-
-# Graphics
-use("R.devices")
-options("devEval/args/field"="fullname") # Preferred for LaTeX
-devOptions("png", width=840)
-
-# Analysis
-use("PSCBS")
-PSCBS <- R.oo::Package("PSCBS")
-fixLocations <- function(fit, ...) {
- for (key in grep("(end|start)$", colnames(fit$output))) {
- fit$output[[key]] <- as.integer(fit$output[[key]])
- }
- fit
-} # fixLocations()
-R.rsp$version
-R.rsp$author
-format(as.Date(PSCBS$date), format="%B %d, %Y")
-fullname <- "PairedPSCBS,exData,chr01"
-withCapture({
-data <- PSCBS::exampleData("paired.chr01")
-str(data)
-})
-withCapture({
-data <- dropSegmentationOutliers(data)
-})
-withCapture({
-gaps <- findLargeGaps(data, minLength=1e6)
-gaps
-})
-withCapture({
-knownSegments <- gapsToSegments(gaps)
-knownSegments
-})
-withCapture({
-fit <- segmentByPairedPSCBS(data, knownSegments=knownSegments, preserveScale=FALSE, seed=0xBEEF, verbose=-10)
-})
-nbrOfSegments(fit)
-fit <- fixLocations(fit)
-withCapture({
-getSegments(fit, simplify=TRUE)
-})
-segs <- getSegments(fit, simplify=TRUE)
-which(segs$tcnNbrOfLoci == 0)
-which(segs$dhNbrOfLoci == 0)
-toPNG(fullname, tags=c(class(fit)[1L], "tracks"), aspectRatio=0.6, {
- plotTracks(fit)
- })
-withCapture({
-fit <- callROH(fit, verbose=-10)
-})
-withCapture({
-fit <- callAB(fit, verbose=-10)
-})
-withCapture({
-fit <- callLOH(fit, verbose=-10)
-})
-withCapture({
-fit <- callNTCN(fit, verbose=-10)
-})
-withCapture({
-getSegments(fit, simplify=TRUE)
-})
-segs <- getSegments(fit, simplify=TRUE)
-withCapture({
-fitP <- pruneByHClust(fit, h=0.25, verbose=-10)
-})
-toPNG(fullname, tags=c(class(fitP)[1L], "pruned", "tracks"), aspectRatio=0.6, {
- plotTracks(fitP)
- })
-toLatex(sessionInfo())
-dt <- round(Sys.time()-t0, digits=2)
-attr(dt, "units")
diff --git a/inst/doc/PairedPSCBS.pdf b/inst/doc/PairedPSCBS.pdf
deleted file mode 100644
index 8b57659..0000000
Binary files a/inst/doc/PairedPSCBS.pdf and /dev/null differ
diff --git a/inst/doc/PairedPSCBS.tex.rsp b/inst/doc/PairedPSCBS.tex.rsp
deleted file mode 100644
index 7dbe86d..0000000
--- a/inst/doc/PairedPSCBS.tex.rsp
+++ /dev/null
@@ -1,421 +0,0 @@
-<%@meta language="R-vignette" content="--------------------------------
-DIRECTIVES FOR R:
-%\VignetteIndexEntry{Parent-specific copy-number segmentation using Paired PSCBS}
-%\VignetteAuthor{Henrik Bengtsson}
-%\VignetteKeyword{copy numbers}
-%\VignetteKeyword{allele specific}
-%\VignetteKeyword{parent specific}
-%\VignetteKeyword{genomic aberrations}
-%\VignetteEngine{R.rsp::rsp}
---------------------------------------------------------------------"%>
-
-
-<% t0 <- Sys.time() %>
-
-<%
-R.utils::use("R.utils")
-
-# RSP specific
-R.rsp <- R.oo::Package("R.rsp")
-withCapture <- R.utils::withCapture
-options("withCapture/newline"=FALSE)
-options(str=strOptions(strict.width="cut"))
-options(width=85)
-options(digits=3)
-
-# Graphics
-use("R.devices")
-options("devEval/args/field"="fullname") # Preferred for LaTeX
-devOptions("png", width=840)
-
-# Analysis
-use("PSCBS")
-PSCBS <- R.oo::Package("PSCBS")
-fixLocations <- function(fit, ...) {
- for (key in grep("(end|start)$", colnames(fit$output))) {
- fit$output[[key]] <- as.integer(fit$output[[key]])
- }
- fit
-} # fixLocations()
-%>
-
-\documentclass[letter]{article}
-\usepackage{xspace}
-\usepackage{alltt}
-\usepackage{xcolor}
-\usepackage{natbib} % \citep{}, \citet{}
-
-\usepackage{graphicx}
-\graphicspath{{figures/}}
-
-<%-------------------------------------------------------------------
- Assign PDF metadata
- -------------------------------------------------------------------%>
-% PDF metadata
-\usepackage{hyperref}
-% Ideally \hypersetup{hidelinks}, but for backward compatibility:
-\hypersetup{pdfborder={0 0 0}}
-\hypersetup{
- pdfauthor={<%@meta name="author"%>},
- pdftitle={<%@meta name="title"%>},
- pdfsubject={},
- pdfkeywords={<%@meta name="keywords"%>},
- pdfproducer={R.rsp v<%=R.rsp$version%> by <%=R.rsp$author%>}
-}
-
-% Page margins
-\addtolength{\oddsidemargin}{-0.5in}
-\addtolength{\evensidemargin}{-0.5in}
-\addtolength{\textwidth}{1in}
-\addtolength{\topmargin}{-0.5in}
-\addtolength{\textheight}{1in}
-
-% Placement of floats
-\setcounter{bottomnumber}{2}
-\renewcommand{\topfraction}{1.0}
-\renewcommand{\bottomfraction}{1.0}
-\renewcommand{\textfraction}{0.0}
-\renewcommand{\floatpagefraction}{1.0}
-
-% Macros
-\newcommand{\keywords}[1]{{\footnotesize{\textbf{Keywords: }#1}}\xspace}
-\newcommand{\pkg}[1]{\textsl{#1}\xspace}
-\newcommand{\file}[1]{\textsl{#1}\xspace}
-\newcommand{\code}[1]{\texttt{#1}\xspace}
-\newcommand{\bs}{$\backslash$}
-
-\newcommand{\alphaTCN}{\alpha_{\textnormal{TCN}}\xspace}
-\newcommand{\alphaDH}{\alpha_{\textnormal{DH}}\xspace}
-\newcommand{\LOH}{\ensuremath{\textnormal{LOH}}\xspace}
-\newcommand{\AB}{\ensuremath{\textnormal{AB}}\xspace}
-
-\newenvironment{rspVerbatim}{\vspace{-\parskip}\begin{alltt}\color{blue}}{\end{alltt}}
-\newenvironment{escapeRspVerbatim}{\vspace{-\parskip}\begin{alltt}}{\end{alltt}}
-
-
-\title{<%@meta name="title"%>}
-\author{<%@meta name="author"%>}
-\date{<%=format(as.Date(PSCBS$date), format="%B %d, %Y")%>}
-
-\begin{document}
-
-\maketitle
-\begin{abstract}
-The Paired Parent-Specific Circular Binary Segmentation (Paired PSCBS) method partitions a tumor genome into segments of constant parent-specific copy numbers (PSCNs) based on SNP DNA microarray data from a matched tumor-normal pair. The method also calls segments with run of homozygosity (ROH), segments in allelic balance (AB) and segments with loss of heterozygosity (LOH).
-Paired PSCBS was designed to work with data from any SNP microarray technology and generation, including Affymetrix and Illumina.
-
-This document shows how to use the \pkg{PSCBS} package to run Paired PSCBS on a tumor-normal pair.
-\end{abstract}
-
-\keywords{<%@meta name="keywords"%>}
-
-\begin{center}
-\emph{This vignette is distributed as part of the \pkg{PSCBS} package, which is available on CRAN (\url{http://cran.r-project.org/}).
-The authors very much appreciate feedback on this document.}
-\end{center}
-
-\clearpage
-\tableofcontents
-
-\clearpage
-
-
-<%-------------------------------------------------------------------
- BACKGROUND
- -------------------------------------------------------------------%>
-\section{Background}
-\label{secBackground}
-We will here use a small example data set to illustrate how to setup the data in a format suitable for Paired PSCBS, how to identify segments, how to call them, and how to plot and export the segmentation results.
-The statistical model and the algorithm behind Paired PSCBS is explained in detail in~\citet{OlshenA_etal_2011}.
-
-
-<%-------------------------------------------------------------------
- EXAMPLE
- -------------------------------------------------------------------%>
-\section{Preparing data to be segmented}
-The Paired PSCBS~\citep{OlshenA_etal_2011} method requires tumor-normal paired parent-specific copy-number (PSCN) signals. More precisely, it requires total copy-number (TCN) estimates for the tumor relative to the matched normal ($C_T$), allele B fractions (BAFs) for the tumor ($\beta_T$) and BAFs for the matched normal ($\beta_N$). The genomic locations of the loci in form of chromosome and physical position are also required.
-
-
-\subsection{Locus-level SNP copy-number signals}
-\label{secData}
-In this example we will use a small example data set part of the \pkg{PSCBS} package. It can be loaded as:
-<%
-fullname <- "PairedPSCBS,exData,chr01"
-%>
-\begin{verbatim}
-<%=withCapture({
-data <- PSCBS::exampleData("paired.chr01")
-str(data)
-})%>
-\end{verbatim}
-In additional to the mandatory fields (\code{chromosome}, \code{x}, \code{CT}, \code{betaT}, and \code{betaN}), this data set also contains TCNs for normal (\code{CN}) relative to a large pool of normal samples. The latter will not be used here.
-
-\subsection{Dropping TCN outliers}
-\label{secTCNOutliers}
-There may be some outliers among the TCNs. In CBS~\citep{OlshenA_etal_2004,VenkatramanOlshen_2007}, the authors propose a method for identifying outliers and then to shrink such values toward their neighbors ("smooth") before performing segmentation. At the time CBS was developed it made sense to not just to drop outliers because the resolution was low and every datapoint was valuable. With modern technologies the resolution is much higher and we can afford dropping such outliers, whi [...]
-\begin{verbatim}
-<%=withCapture({
-data <- dropSegmentationOutliers(data)
-})%>
-\end{verbatim}
-Dropping TCN outliers is optional.
-
-
-
-\section{Paired PSCBS segmentation}
-
-\subsection{Skipping centromeres and other large gaps}
-\label{secGaps}
-Like the CBS method, Paired PSCBS does not take the physical locations (in units of nucleotides) of the loci in to account when segmenting the data, only their relative ordering along the genome. This means that after having ordered the loci along genome, it will treat two "neighboring" loci that are on both sides of the centromere equally to two neighboring loci that are only a few hundred bases apart. This may introduce erroneous change points that appear to be inside the centromere. [...]
-
-To avoid this, although not mandatory, we will locate all gaps of the genome where there are no observered loci. As a threshold we will consider a region to be a "gap" if the distance between the two closest loci is greater than 1Mb.
-\begin{verbatim}
-<%=withCapture({
-gaps <- findLargeGaps(data, minLength=1e6)
-gaps
-})%>
-\end{verbatim}
-which shows that there is a 20.5Mb long gap between 121.0Mb and 141.5Mb on Chromosome~1. This is the centromere of Chromosome~1.
-It is not possible to specify "gaps" to the segmentation function. Instead they need to be given as part of a set of "known" segments, which is done as:
-\begin{verbatim}
-<%=withCapture({
-knownSegments <- gapsToSegments(gaps)
-knownSegments
-})%>
-\end{verbatim}
-Below, we will use this to tell Paired PSCBS to segment Chromosome~1 into three independent segments, where the first segment is from the beginning of the chromosome (hence '-Inf') to 120.1Mb, the second one from 120.1-141.5Mb (the above gap), and the third one is from 141.5Mb to the end of the chromosome (hence '+Inf').
-Just as Paired PSCBS segments chromosomes independently of each other, it also segments priorly known segments independently of each other.
-Specifying known segments is optional.
-
-
-\subsection{Identifying PSCN segments}
-We are now ready to segment the locus-level PSCN signals. This is done by\footnote{We fix the random seed in order for the results of this vignette to be numerically reproducible.}:
-\begin{verbatim}
-<%=withCapture({
-fit <- segmentByPairedPSCBS(data, knownSegments=knownSegments, preserveScale=FALSE, seed=0xBEEF, verbose=-10)
-})%>
-\end{verbatim}
-Note that this may take several minutes when applied to whole-genome data.
-The above call will also normalize the tumor BAFs using the TumorBoost normalization method~\citep{BengtssonH_etal_2010} (without preserving the relative scale for homozygous and heterozygous BAFs; in a future version, this will be the default). If this has already been done or the tumor signals have been normalized by other means, the TumorBoost step can be skipped by setting argument \code{tbn=FALSE}.
-
-The result of the segmentation is a set of segments identified to have the same underlying PSCN levels. In this particular case, <%=nbrOfSegments(fit)%> PSCN segments were found:
-<% fit <- fixLocations(fit) %>
-\begin{verbatim}
-<%=withCapture({
-getSegments(fit, simplify=TRUE)
-})%>
-\end{verbatim}
-<% segs <- getSegments(fit, simplify=TRUE) %>
-Note that Segment~\#<%=which(segs$tcnNbrOfLoci == 0)%> has no mean-level estimates. It is because it corresponds to the centromere (the gap) that was identified above. Paired PSCBS did indeed try to segment it, but since there are no data points, all estimates are missing values.
-Similarly, for Segment~\#<%=which(segs$dhNbrOfLoci == 0)%> the DH and minor and major CNs mean estimates are all missing values. This is because, Paired PSCBS identified that segment by first segmenting the TCN signals by themselves, and after which it tried to segment the DH signals within that segment. Since there are no heterozygous SNPs in the segment, there are no DH signals, and hence there is no DH mean estimate.
-
-
-\subsection{Displaying genomic PSCN profiles}
-To plot the PSCN segmentation results, do:
-\begin{verbatim}
-plotTracks(fit)
-\end{verbatim}
-which by default displays three panels containing TCN, decrease of heterozygosity (DH), and minor and major CNs as in Figure~\ref{figTracks}.
-To plot only one panel with TCN and minor and major CNs and zoom in on a particular region, do (not shown):
-\begin{verbatim}
-plotTracks(fit, tracks="tcn,c1,c2", xlim=c(120,244)*1e6)
-\end{verbatim}
-\begin{figure}[htp]
- \begin{center}
- \resizebox{0.96\textwidth}{!}{\includegraphics{<%=toPNG(fullname, tags=c(class(fit)[1L], "tracks"), aspectRatio=0.6, {
- plotTracks(fit)
- })%>}}
- \end{center}
- \caption{PSCN segments identified by Paired PSCBS.
- \textbf{Top}: The TCN signals with the TCN mean levels (purple).
- \textbf{Middle}: The DH signals with the DH mean levels (orange).
- \textbf{Bottom}: The TCN signals with the minor CN ($C_1$; blue), the major CN ($C_2$; red) and the TCN ($C=C_1+C_2$; purple) mean levels.
- }
- \label{figTracks}
-\end{figure}
-
-
-
-
-
-
-\section{Calling segments}
-The calling algorithms for allelic balance (AB) and loss of heterozygosity (LOH) are based on quantile estimates of the different mean levels. These estimates are obtained using non-parametric bootstrap techniques. For more details, see~\citet{OlshenA_etal_2011}.
-After the Paired PSCBS method was published, we have added methods for calling run of homozygosity (ROH) and neutral total copy number (NTCN).
-\emph{The ROH and NTCN calling methods should be considered under development until further notice, meaning they and their results may change without notice.}
-
-
-
-\subsection{Calling segments with run of homozygosity (ROH)*}
-\emph{Please note that this method is under development. This means that it may change without further notice.}
-
-A region has a run of homozygotes (ROH) if all of its SNPs are homozygous (in the normal). Since such a region has no heterozyous SNPs, its decrease in heterozygosity (DH) is undefined. Likewise, the minor and major copy numbers are unknown.
- However, if there are genotyping errors within an ROH region, we will obtain a non-missing DH mean level and hence also finite minor and major CNs. In order to adjust for these faulty estimates, we test if the identified segments are ROHs or not by:
-\begin{verbatim}
-<%=withCapture({
-fit <- callROH(fit, verbose=-10)
-})%>
-\end{verbatim}
-This will also set the corresponding DH and minor and major CN mean levels to NA. The total CN mean levels are not affected by the ROH call.
-
-\subsubsection{Tuning parameters}
-For each segment, the test for ROH calculates the fraction of SNPs
-that are called heterozygous. If the fraction of heterozygotes is smaller
-than a threshold, the segmented is called ROH, otherwise not.
-The default threshold is 1/12.
-To use a different threshold, set argument \code{delta} to a scalar in $[0,1]$.
-For example, using \code{callROH(fit, delta=1/30)} makes the ROH caller
-more conservative.\footnote{It is our plan to replace this basic test with a bionomial test.}
-
-
-\subsection{Calling segments in allelic balance (AB)}
-The AB caller tests whether the DH level of a segment is small enough to be considered zero, which means that the minor and the major CNs are equal, i.e. the segment is in allelic balance.
-To call the AB state of all segments, do:
-\begin{verbatim}
-<%=withCapture({
-fit <- callAB(fit, verbose=-10)
-})%>
-\end{verbatim}
-Because the caller utilizes bootstrapping techniques, calling AB may take some time if there is a large number of segments.
-Segments already called ROH will not be called for AB, and their AB statuses will have a missing value (\code{NA}).
-
-
-\subsubsection{Tuning parameters}
-The AB caller tests whether a segment's DH is zero or not, by comparing its DH level (or more precisely, the $5\%$ quantile of its bootstrapped DH mean level) to a threshold. This threshold will be a function of the noise level, because the noiser the BAF signals (and hence the DH signals), the greater the bias of the DH mean level for segments in AB will be. Because of this, the threshold is choosen from data by estimating the noise level of the DH signals near zero.
-Further rationales and details are given in~\citet{OlshenA_etal_2011}.
-The AB threshold can be estimated explicitly and used in the caller as
-\begin{verbatim}
-deltaAB <- estimateDeltaAB(fit, scale=1)
-fit <- callAB(fit, delta=deltaAB)
-\end{verbatim}
-By decreasing argument \code{scale} (a positive scalar), a smaller
-threshold will be obtained resulting in a more conservative AB caller.
-
-
-\subsection{Calling segments with loss of heterozygosity (LOH)}
-The LOH caller tests whether the minor CN level of a segment is large enough to be considered non-zero, which means that the segment is \emph{not} in LOH.
-To call the LOH state of all segments, do:
-\begin{verbatim}
-<%=withCapture({
-fit <- callLOH(fit, verbose=-10)
-})%>
-\end{verbatim}
-Note that in order to call LOH, one has to call allelic balance first. Since the bootstrapping was already done in the AB caller, it is not repeated here, which is why calling LOH is faster than calling AB.
-Analogously to the AB caller, segments already called ROH will not be called for LOH, and their LOH statuses will have a missing value (\code{NA}).
-Segments already called AB will be called non-LOH, because AB and LOH are exclusively mutual states.
-
-\subsubsection{Tuning parameters}
-The LOH caller tests whether a segment's minor CN is non-zero or not, by comparing its minor CN level (or more precisely, the $95\%$ quantile of its bootstrapped minor CN mean level) to a threshold. This threshold will, among other components, be a function of normal contamination, i.e. the greater the fraction of normal cells is the greater the threshold needs to be in order to call LOH in the tumor cells. Because of this, the threshold is choosen from data as the midpoint of the esti [...]
-The LOH threshold can be estimated explicitly and used as:
-\begin{verbatim}
-deltaLOH <- estimateDeltaLOH(fit, midpoint=1/2)
-fit <- callLOH(fit, delta=deltaLOH)
-\end{verbatim}
-By decreasing argument \code{midpoint} in $[0,1]$, a smaller
-threshold will be obtained resulting in a more conservative LOH caller.
-
-
-
-\subsection{Calling segments with neutral total copy number (NTCN)*}
-\emph{Please note that this method is under development. This means that it may change without further notice.}
-
-The neutral total copy number (NTCN) caller tests whether the total CN level of a segment is neutral (e.g. diploid) or not.
-To call the NTCN state of all segments, do:
-\begin{verbatim}
-<%=withCapture({
-fit <- callNTCN(fit, verbose=-10)
-})%>
-\end{verbatim}
-
-
-\subsubsection{Tuning parameters}
-The NTCN caller identifies segments which TCN mean levels (or more precisely, which $95\%$ confidence intervals) are within a given "acceptance" region. This acceptance region is determined by the $95\%$ confidence interval of an initial set of AB segments identified to be copy neutral and then expanded by half a TCN unit length.
-The true length of half a total copy number unit is specified by the argument \code{delta} to \code{callNTCN()}. Its length should be a function of the overall background signals (which includes normal contamination and more), such that the width of the acceptance region becomes smaller when the background increases.
-The background signal (\code{kappa}) and \code{delta} can be estimated explicitly as:
-\begin{verbatim}
-kappa <- estimateKappa(fit)
-deltaCN <- estimateDeltaCN(fit, scale=1, kappa=kappa)
-fit <- callNTCN(fit, delta=deltaCN, verbose=-10)
-\end{verbatim}
-By decreasing the tuning parameter \code{scale} (a positive scalar), a smaller acceptance region will be obtained, which results in a more conservative CN caller.
-
-
-
-\subsection{Results from calling ROH, AB, LOH and NTCN}
-All calls are appended to the segmentation results as logical columns:
-\begin{verbatim}
-<%=withCapture({
-getSegments(fit, simplify=TRUE)
-})%>
-\end{verbatim}
-<% segs <- getSegments(fit, simplify=TRUE) %>
-
-
-\section{Saving results}
-
-\subsection{Writing segments to a tab-delimited text file}
-To write the PSCN segmentation results to file, do:
-\begin{verbatim}
-pathname <- writeSegments(fit, name="MySample", simplify=TRUE)
-\end{verbatim}
-With \code{simplify=FALSE} (default) quantile estimates of the different mean levels will also be written, which roughly doubles the file size.
-
-
-
-\section{Experimental}
-In this section we illustrate some of the ongoing and future work that will be contained in the PSCBS package. Please be aware that these methods are very much under construction, possibly incomplete and in the worst case, even incorrect.
-
-
-\subsection{Less biased Decrease of Heterozygosity (DH) estimates}
-The DH mean levels of the segments are estimated as the sample mean of the DH signals within each segment. Since DH signals are by definition truncated at zero, the mean level estimates will always be greater than zero even if the true underlying DH is exactly zero. An additional bias is introduced because the distribution of the DH signals is skewed for small DHs, causing the sample mean estimate to be biased. A less biased estimate can be obtained by using the median estimator. To [...]
-
-
-\subsection{Pruning segmentation profile}
-By applying hierarchical clustering on the segment means, it is possible to prune the PSCN profile such that change points with very small absolute changes are dropped. If change points are dropped this way, this results in a smaller number of segments, which are hence longer on average. To prune Paired PSCBS segmentation results this way, do:
-\begin{verbatim}
-<%=withCapture({
-fitP <- pruneByHClust(fit, h=0.25, verbose=-10)
-})%>
-\end{verbatim}
-The result of this is shown in Figure~\ref{figTracksPruned}.
-\begin{figure}[htp]
- \begin{center}
- \resizebox{0.96\textwidth}{!}{\includegraphics{<%=toPNG(fullname, tags=c(class(fitP)[1L], "pruned", "tracks"), aspectRatio=0.6, {
- plotTracks(fitP)
- })%>}}
- \end{center}
- \caption{Pruned PSCN segments plotted as in Figure~\ref{figTracks}.}
- \label{figTracksPruned}
-\end{figure}
-In the current implementation, any segment calls and quantile mean levels estimates previously are dropped when pruning.
-
-
-\subsection{Report generation}
-A multipage PDF report that contains both whole-genome and per-chromosome summaries and figures can be generated by:
-\begin{verbatim}
-> report(fit, sampleName="PairedPSCBS", studyName="PSCBS-Ex", verbose=-10)
-\end{verbatim}
-By default, the reports are written to directory \code{reports/<studyName>/} under the current working directory. In addition to the PDF, that directory also contains subdirectory \code{figures/} holding all generated figure files (e.g. PNGs and PDFs) for easy inclusion elsewhere.
-
-
-
-
-
-<%-------------------------------------------------------------------
- REFERENCES
- -------------------------------------------------------------------%>
-\bibliographystyle{natbib}
-\bibliography{PSCBS}
-
-
-<%-------------------------------------------------------------------
- APPENDIX
- -------------------------------------------------------------------%>
-\clearpage
-\section*{Appendix}
-\subsection*{Session information}
-<%=toLatex(sessionInfo())%>
-This report was automatically generated using \code{rfile()} of the R.rsp package.
-Total processing time after RSP-to-R translation was <%=dt <- round(Sys.time()-t0, digits=2)%> <%=attr(dt, "units")%>.
-
-\end{document}
diff --git a/inst/templates/rsp/CBS,report.tex.rsp b/inst/templates/rsp/CBS,report.tex.rsp
index bfad67b..6f42f28 100644
--- a/inst/templates/rsp/CBS,report.tex.rsp
+++ b/inst/templates/rsp/CBS,report.tex.rsp
@@ -449,8 +449,8 @@ fitT <- extractChromosome(fit, chromosome=chr);
% \clearpage
\section*{Session information}
<%=toLatex(sessionInfo())%>
-This report was automatically generated using \code{rsp()} of the R.rsp package.
-The template for this report was created by Henrik Bengtsson on April 20, 2012.
+This report was automatically generated using the R.rsp package.
+The template for this report was created by Henrik Bengtsson.
\end{document}
<% } # cbsReport() %>
diff --git a/inst/templates/rsp/PairedPSCBS,report.tex.rsp b/inst/templates/rsp/PairedPSCBS,report.tex.rsp
index f66a490..e1014a9 100644
--- a/inst/templates/rsp/PairedPSCBS,report.tex.rsp
+++ b/inst/templates/rsp/PairedPSCBS,report.tex.rsp
@@ -317,12 +317,14 @@ chrsTags <- if (nbrOfChromosomes == 1) {
\begin{center}
<%
fields <- c("CT", "betaN", "betaT", "rho", "c1", "c2", "betaTN", "rhoN", "c1N", "c2N");
+ fields <- intersect(fields, colnames(data))
%>
<% for (ff in fields) { %>
<%
symbol <- symbolList[[ff]];
panelTitle <- switch(ff, CT="\\TCN", betaN="\\BAFN", betaT="\\BAFT", betaTN="\\BAFTN", "NNN");
lim <- switch(ff, CT=ClimX, c1=ClimX, c2=ClimX, c1N=ClimX, c2N=ClimX, BlimX);
+ nbrOfSNPs <- sum(data$isSNP, na.rm=TRUE)
%>
\raisebox{4ex}{<%=symbol%>}
<% for (by in c("all", "muN")) { %>
@@ -335,7 +337,7 @@ chrsTags <- if (nbrOfChromosomes == 1) {
gg <- ggplot(data, aes_string(x=ff, y="..count.."));
if (by == "all") {
- if (ff == "CT" && any(!data$isSNP, na.rm=TRUE)) {
+ if (ff == "CT" && nbrOfSNPs > 0 && any(!data$isSNP, na.rm=TRUE)) {
gg <- gg + aes(group=type, colour=type);
}
} else if (by == "muN") {
@@ -385,6 +387,11 @@ chrsTags <- if (nbrOfChromosomes == 1) {
% BEFORE AND AFTER TUMORBOOST
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<% beforeAndAfterTumorBoost <- function(fit, ...) { %>
+<%
+data <- getLocusData(fit, fields="full");
+## Nothing to do?
+if (!all(is.element(c("betaN", "betaT", "type"), colnames(data)))) return()
+%>
<% if (!REPORT_TUMORBOOST) return(); %>
\clearpage
\section{Before and after TumorBoost}
@@ -393,7 +400,6 @@ chrsTags <- if (nbrOfChromosomes == 1) {
\begin{center}
<%
require("ggplot2") || throw("Package not loaded: ggplot2");
-data <- getLocusData(fit, fields="full");
chromosomes <- getChromosomes(fit);
nbrOfChromosomes <- length(chromosomes);
chromosomesH <- seqToHumanReadable(chromosomes);
@@ -646,8 +652,11 @@ assign("renamePDF", function() {
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HISTORY:
+% 2016-05-11
+% o Updated to handle PairedPSCBS objects with only 'rho' but no
+% 'betaN' and 'betaT'.
% 2014-05-24
-# o Replaced a deprecated opts() of ggplot2 with theme().
+% o Replaced a deprecated opts() of ggplot2 with theme().
% 2013-10-18
% o BUG FIX: Report template assumed that R.utils was attached.
% 2012-11-03
diff --git a/man/AbstractCBS.Rd b/man/AbstractCBS.Rd
index 22fd729..e4e847e 100644
--- a/man/AbstractCBS.Rd
+++ b/man/AbstractCBS.Rd
@@ -60,6 +60,7 @@ AbstractCBS(fit=list(), sampleName=fit$sampleName, ...)
\tab \code{nbrOfChromosomes} \tab -\cr
\tab \code{nbrOfLoci} \tab -\cr
\tab \code{nbrOfSegments} \tab -\cr
+ \tab \code{normalizeTotalCNs} \tab -\cr
\tab \code{ploidy} \tab -\cr
\tab \code{ploidy<-} \tab -\cr
\tab \code{plotTracks} \tab -\cr
diff --git a/man/CBS.Rd b/man/CBS.Rd
index 89fdbdb..fd2c8e4 100644
--- a/man/CBS.Rd
+++ b/man/CBS.Rd
@@ -59,7 +59,7 @@ CBS(...)
\bold{Methods inherited from AbstractCBS}:\cr
-adjustPloidyScale, all.equal, append, as.data.frame, clearCalls, drawChangePoints, drawKnownSegments, dropChangePoint, dropChangePoints, dropRegion, dropRegions, extractCNs, extractChromosome, extractChromosomes, extractRegions, extractSegments, extractWIG, getChangePoints, getChromosomeOffsets, getChromosomeRanges, getChromosomes, getLocusData, getLocusSignalNames, getMeanEstimators, getSampleName, getSegmentSizes, getSegmentTrackPrefixes, getSegments, load, mergeThreeSegments, mergeTwo [...]
+adjustPloidyScale, all.equal, append, as.data.frame, clearCalls, drawChangePoints, drawKnownSegments, dropChangePoint, dropChangePoints, dropRegion, dropRegions, extractCNs, extractChromosome, extractChromosomes, extractRegions, extractSegments, extractWIG, getChangePoints, getChromosomeOffsets, getChromosomeRanges, getChromosomes, getLocusData, getLocusSignalNames, getMeanEstimators, getSampleName, getSegmentSizes, getSegmentTrackPrefixes, getSegments, load, mergeThreeSegments, mergeTwo [...]
\bold{Methods inherited from list}:\cr
all.equal, as.data.frame, attachLocally, callHooks, relist, within
diff --git a/man/Non-documented_objects.Rd b/man/Non-documented_objects.Rd
index da38ab9..5984a1b 100644
--- a/man/Non-documented_objects.Rd
+++ b/man/Non-documented_objects.Rd
@@ -250,8 +250,6 @@
\alias{renameChromosomes.AbstractCBS}
\alias{report}
\alias{writeSegments.DNAcopy}
-\alias{estimateDeltaCN}
-\alias{estimateDeltaCN.PairedPSCBS}
\alias{shiftTCN}
\alias{shiftTCN.AbstractCBS}
\alias{shiftTCN.CBS}
@@ -301,7 +299,6 @@
\alias{hasBootstrapSummaries.PairedPSCBS}
\alias{clearCalls}
\alias{clearCalls.AbstractCBS}
-\alias{estimateDeltaCN.CBS}
\alias{extractSegmentDataByLocus}
\alias{extractSegmentDataByLocus.PairedPSCBS}
\alias{updateMeansC1C2}
diff --git a/man/NonPairedPSCBS.Rd b/man/NonPairedPSCBS.Rd
index 72b6159..913ee41 100644
--- a/man/NonPairedPSCBS.Rd
+++ b/man/NonPairedPSCBS.Rd
@@ -50,10 +50,10 @@ extends \emph{\link[PSCBS]{PSCBS}}\cr
\bold{Methods inherited from PSCBS}:\cr
-append, as.data.frame, drawChangePoints, extractChromosomes, extractWIG, getLocusData, getLocusSignalNames, getSegmentTrackPrefixes, isSegmentSplitter, writeSegments
+append, as.data.frame, drawChangePoints, extractChromosomes, extractWIG, getLocusData, getLocusSignalNames, getSegmentTrackPrefixes, isSegmentSplitter, normalizeTotalCNs, writeSegments
\bold{Methods inherited from AbstractCBS}:\cr
-adjustPloidyScale, all.equal, append, as.data.frame, clearCalls, drawChangePoints, drawKnownSegments, dropChangePoint, dropChangePoints, dropRegion, dropRegions, extractCNs, extractChromosome, extractChromosomes, extractRegions, extractSegments, extractWIG, getChangePoints, getChromosomeOffsets, getChromosomeRanges, getChromosomes, getLocusData, getLocusSignalNames, getMeanEstimators, getSampleName, getSegmentSizes, getSegmentTrackPrefixes, getSegments, load, mergeThreeSegments, mergeTwo [...]
+adjustPloidyScale, all.equal, append, as.data.frame, clearCalls, drawChangePoints, drawKnownSegments, dropChangePoint, dropChangePoints, dropRegion, dropRegions, extractCNs, extractChromosome, extractChromosomes, extractRegions, extractSegments, extractWIG, getChangePoints, getChromosomeOffsets, getChromosomeRanges, getChromosomes, getLocusData, getLocusSignalNames, getMeanEstimators, getSampleName, getSegmentSizes, getSegmentTrackPrefixes, getSegments, load, mergeThreeSegments, mergeTwo [...]
\bold{Methods inherited from list}:\cr
all.equal, as.data.frame, attachLocally, callHooks, relist, within
diff --git a/man/PSCBS.Rd b/man/PSCBS.Rd
index 3879a17..814441a 100644
--- a/man/PSCBS.Rd
+++ b/man/PSCBS.Rd
@@ -46,12 +46,13 @@ extends \emph{\link[PSCBS]{AbstractCBS}}\cr
\bold{Methods:}\cr
\tabular{rll}{
\tab \code{append} \tab -\cr
+ \tab \code{normalizeTotalCNs} \tab -\cr
\tab \code{writeSegments} \tab -\cr
}
\bold{Methods inherited from AbstractCBS}:\cr
-adjustPloidyScale, all.equal, append, as.data.frame, clearCalls, drawChangePoints, drawKnownSegments, dropChangePoint, dropChangePoints, dropRegion, dropRegions, extractCNs, extractChromosome, extractChromosomes, extractRegions, extractSegments, extractWIG, getChangePoints, getChromosomeOffsets, getChromosomeRanges, getChromosomes, getLocusData, getLocusSignalNames, getMeanEstimators, getSampleName, getSegmentSizes, getSegmentTrackPrefixes, getSegments, load, mergeThreeSegments, mergeTwo [...]
+adjustPloidyScale, all.equal, append, as.data.frame, clearCalls, drawChangePoints, drawKnownSegments, dropChangePoint, dropChangePoints, dropRegion, dropRegions, extractCNs, extractChromosome, extractChromosomes, extractRegions, extractSegments, extractWIG, getChangePoints, getChromosomeOffsets, getChromosomeRanges, getChromosomes, getLocusData, getLocusSignalNames, getMeanEstimators, getSampleName, getSegmentSizes, getSegmentTrackPrefixes, getSegments, load, mergeThreeSegments, mergeTwo [...]
\bold{Methods inherited from list}:\cr
all.equal, as.data.frame, attachLocally, callHooks, relist, within
diff --git a/man/PairedPSCBS.Rd b/man/PairedPSCBS.Rd
index 9ecbd1f..41deba2 100644
--- a/man/PairedPSCBS.Rd
+++ b/man/PairedPSCBS.Rd
@@ -68,10 +68,10 @@ extends \emph{\link[PSCBS]{PSCBS}}\cr
\bold{Methods inherited from PSCBS}:\cr
-append, as.data.frame, drawChangePoints, extractChromosomes, extractWIG, getLocusData, getLocusSignalNames, getSegmentTrackPrefixes, isSegmentSplitter, writeSegments
+append, as.data.frame, drawChangePoints, extractChromosomes, extractWIG, getLocusData, getLocusSignalNames, getSegmentTrackPrefixes, isSegmentSplitter, normalizeTotalCNs, writeSegments
\bold{Methods inherited from AbstractCBS}:\cr
-adjustPloidyScale, all.equal, append, as.data.frame, clearCalls, drawChangePoints, drawKnownSegments, dropChangePoint, dropChangePoints, dropRegion, dropRegions, extractCNs, extractChromosome, extractChromosomes, extractRegions, extractSegments, extractWIG, getChangePoints, getChromosomeOffsets, getChromosomeRanges, getChromosomes, getLocusData, getLocusSignalNames, getMeanEstimators, getSampleName, getSegmentSizes, getSegmentTrackPrefixes, getSegments, load, mergeThreeSegments, mergeTwo [...]
+adjustPloidyScale, all.equal, append, as.data.frame, clearCalls, drawChangePoints, drawKnownSegments, dropChangePoint, dropChangePoints, dropRegion, dropRegions, extractCNs, extractChromosome, extractChromosomes, extractRegions, extractSegments, extractWIG, getChangePoints, getChromosomeOffsets, getChromosomeRanges, getChromosomes, getLocusData, getLocusSignalNames, getMeanEstimators, getSampleName, getSegmentSizes, getSegmentTrackPrefixes, getSegments, load, mergeThreeSegments, mergeTwo [...]
\bold{Methods inherited from list}:\cr
all.equal, as.data.frame, attachLocally, callHooks, relist, within
diff --git a/man/estimateDeltaCN.PairedPSCBS.Rd b/man/estimateDeltaCN.PairedPSCBS.Rd
new file mode 100644
index 0000000..92d6239
--- /dev/null
+++ b/man/estimateDeltaCN.PairedPSCBS.Rd
@@ -0,0 +1,52 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Do not modify this file since it was automatically generated from:
+%
+% PairedPSCBS.callCopyNeutral.R
+%
+% by the Rdoc compiler part of the R.oo package.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\name{estimateDeltaCN.PairedPSCBS}
+\alias{estimateDeltaCN.PairedPSCBS}
+\alias{PairedPSCBS.estimateDeltaCN}
+\alias{estimateDeltaCN,PairedPSCBS-method}
+\alias{estimateDeltaCN}
+\alias{estimateDeltaCN.CBS}
+
+\title{Estimates the length of one total copy-number (TCN) unit}
+
+\description{
+ Estimates the length of one total copy-number (TCN) unit
+}
+
+\usage{
+\method{estimateDeltaCN}{PairedPSCBS}(fit, scale=1, kappa=estimateKappa(fit), ...)
+}
+
+\arguments{
+ \item{scale}{A \code{\link[base]{numeric}} scale factor in (0,Inf) used for rescaling
+ (multiplying) the final estimate with.}
+ \item{...}{Not used.}
+}
+
+\value{
+ Returns a positive scalar \code{\link[base]{numeric}}.
+}
+
+\details{
+ For parent-specific copy-number (PSCN) data, the TCN unit length is
+ estimated as \eqn{(1-kappa)/2}, where \eqn{kappa} is estimated from
+ data (by \code{\link[PSCBS]{estimateKappa}}).
+
+ For total copy-number (TCN) data (only),
+}
+
+\author{Henrik Bengtsson}
+
+\seealso{
+ For more information see \code{\link{PairedPSCBS}}.
+}
+
+
+\keyword{internal}
+\keyword{methods}
diff --git a/man/normalizeTotalCNs.AbstractCBS.Rd b/man/normalizeTotalCNs.AbstractCBS.Rd
new file mode 100644
index 0000000..f03a1b7
--- /dev/null
+++ b/man/normalizeTotalCNs.AbstractCBS.Rd
@@ -0,0 +1,40 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Do not modify this file since it was automatically generated from:
+%
+% AbstractCBS.R
+%
+% by the Rdoc compiler part of the R.oo package.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\name{normalizeTotalCNs.AbstractCBS}
+\alias{normalizeTotalCNs.AbstractCBS}
+\alias{AbstractCBS.normalizeTotalCNs}
+\alias{normalizeTotalCNs,AbstractCBS-method}
+\alias{normalizeTotalCNs}
+\alias{normalizeTotalCNs.PSCBS}
+
+\title{Normalizes copy numbers such that the whole-genome average total copy number is two}
+
+\description{
+ Normalizes copy numbers such that the whole-genome average total copy number is two.
+}
+
+\usage{
+\method{normalizeTotalCNs}{AbstractCBS}(...)
+}
+
+\arguments{
+ \item{...}{Additional arguments passed to the normalization method.}
+}
+
+\value{
+ Returns a normalized AbstractCBS object of the same class as \code{fit}.
+}
+
+\author{Henrik Bengtsson}
+
+\seealso{
+ For more information see \code{\link{AbstractCBS}}..
+}
+\keyword{internal}
+\keyword{methods}
diff --git a/man/segmentByCBS.Rd b/man/segmentByCBS.Rd
index 3514b9b..4fc486b 100644
--- a/man/segmentByCBS.Rd
+++ b/man/segmentByCBS.Rd
@@ -25,7 +25,7 @@
}
\usage{
-\method{segmentByCBS}{default}(y, chromosome=0L, x=NULL, index=seq(along = y), w=NULL, undo=0,
+\method{segmentByCBS}{default}(y, chromosome=0L, x=NULL, index=seq_along(y), w=NULL, undo=0,
avg=c("mean", "median"), ..., joinSegments=TRUE, knownSegments=NULL, seed=NULL,
verbose=FALSE)
}
diff --git a/revdep/README.md b/revdep/README.md
new file mode 100644
index 0000000..bdc0632
--- /dev/null
+++ b/revdep/README.md
@@ -0,0 +1,334 @@
+# Setup
+
+## Platform
+
+|setting |value |
+|:--------|:----------------------------|
+|version |R version 3.3.2 (2016-10-31) |
+|system |x86_64, linux-gnu |
+|ui |X11 |
+|language |en |
+|collate |en_US.UTF-8 |
+|tz |US/Pacific |
+|date |2016-11-10 |
+
+## Packages
+
+|package |* |version |date |source |
+|:-----------|:--|:-------|:----------|:--------------|
+|aroma.light | |3.4.0 |2016-10-31 |cran (@3.4.0) |
+|DNAcopy | |1.48.0 |2016-10-31 |cran (@1.48.0) |
+|future | |1.1.1 |2016-10-11 |cran (@1.1.1) |
+|ggplot2 | |2.1.0 |2016-03-01 |CRAN (R 3.3.1) |
+|Hmisc | |4.0-0 |2016-11-01 |cran (@4.0-0) |
+|listenv | |0.6.0 |2015-12-28 |CRAN (R 3.3.1) |
+|matrixStats | |0.51.0 |2016-10-09 |cran (@0.51.0) |
+|PSCBS | |0.61.0 |2016-02-04 |CRAN (R 3.3.1) |
+|R.cache | |0.12.0 |2015-11-12 |CRAN (R 3.3.1) |
+|R.devices | |2.15.1 |2016-11-10 |cran (@2.15.1) |
+|R.methodsS3 | |1.7.1 |2016-02-16 |CRAN (R 3.3.1) |
+|R.oo | |1.21.0 |2016-11-01 |cran (@1.21.0) |
+|R.rsp | |0.30.0 |2016-05-15 |CRAN (R 3.3.1) |
+|R.utils | |2.5.0 |2016-11-07 |cran (@2.5.0) |
+
+# Check results
+
+11 packages
+
+|package |version | errors| warnings| notes|
+|:----------------|:-------|------:|--------:|-----:|
+|ACNE |0.8.1 | 0| 0| 0|
+|aroma.affymetrix |3.0.0 | 0| 0| 0|
+|aroma.cn |1.6.1 | 0| 0| 0|
+|aroma.core |3.0.0 | 0| 0| 1|
+|calmate |0.12.1 | 0| 0| 0|
+|MPAgenomics |1.1.2 | 0| 0| 2|
+|NSA |0.0.32 | 0| 0| 6|
+|PECA |1.10.0 | 0| 0| 1|
+|PureCN |1.2.3 | 0| 0| 1|
+|Repitools |1.20.0 | 0| 0| 2|
+|TIN |1.6.0 | 0| 0| 2|
+
+## ACNE (0.8.1)
+Maintainer: Henrik Bengtsson <henrikb at braju.com>
+Bug reports: https://github.com/HenrikBengtsson/ACNE/issues
+
+0 errors | 0 warnings | 0 notes
+
+## aroma.affymetrix (3.0.0)
+Maintainer: Henrik Bengtsson <henrikb at braju.com>
+Bug reports: https://github.com/HenrikBengtsson/aroma.affymetrix/issues
+
+0 errors | 0 warnings | 0 notes
+
+## aroma.cn (1.6.1)
+Maintainer: Henrik Bengtsson <henrikb at braju.com>
+Bug reports: https://github.com/HenrikBengtsson/aroma.cn/issues
+
+0 errors | 0 warnings | 0 notes
+
+## aroma.core (3.0.0)
+Maintainer: Henrik Bengtsson <henrikb at braju.com>
+Bug reports: https://github.com/HenrikBengtsson/aroma.core/issues
+
+0 errors | 0 warnings | 1 note
+
+```
+checking package dependencies ... NOTE
+Packages suggested but not available for checking:
+ ‘expectile’ ‘HaarSeg’ ‘mpcbs’
+```
+
+## calmate (0.12.1)
+Maintainer: Henrik Bengtsson <henrikb at braju.com>
+Bug reports: https://github.com/HenrikBengtsson/calmate/issues
+
+0 errors | 0 warnings | 0 notes
+
+## MPAgenomics (1.1.2)
+Maintainer: Samuel Blanck <samuel.blanck at inria.fr>
+
+0 errors | 0 warnings | 2 notes
+
+```
+checking dependencies in R code ... NOTE
+'library' or 'require' calls in package code:
+ ‘R.devices’ ‘R.filesets’ ‘R.methodsS3’ ‘R.oo’ ‘aroma.affymetrix’
+ ‘aroma.cn’ ‘aroma.core’ ‘aroma.light’ ‘matrixStats’ ‘snowfall’
+ Please use :: or requireNamespace() instead.
+ See section 'Suggested packages' in the 'Writing R Extensions' manual.
+Unexported object imported by a ':::' call: ‘cghseg:::segmeanCO’
+ See the note in ?`:::` about the use of this operator.
+
+checking R code for possible problems ... NOTE
+.varregtimescount: no visible global function definition for ‘var’
+CGHSEGaroma: no visible global function definition for ‘read.csv’
+CGHSEGaroma : <anonymous>: no visible global function definition for
+ ‘points’
+CGHSEGaroma : <anonymous>: no visible global function definition for
+ ‘lines’
+CGHSEGaroma : <anonymous>: no visible global function definition for
+ ‘write.table’
+CGHcall: no visible global function definition for ‘mad’
+... 43 lines ...
+tumorboostPlot: no visible global function definition for ‘par’
+tumorboostPlot: no visible global function definition for ‘axis’
+tumorboostPlot: no visible global function definition for ‘points’
+Undefined global functions or variables:
+ axis head lines lm mad median optim par points read.csv sd var
+ write.table
+Consider adding
+ importFrom("graphics", "axis", "lines", "par", "points")
+ importFrom("stats", "lm", "mad", "median", "optim", "sd", "var")
+ importFrom("utils", "head", "read.csv", "write.table")
+to your NAMESPACE file.
+```
+
+## NSA (0.0.32)
+Maintainer: Maria Ortiz-Estevez <mortizest at gmail.com>
+
+0 errors | 0 warnings | 6 notes
+
+```
+checking package dependencies ... NOTE
+Depends: includes the non-default packages:
+ ‘R.methodsS3’ ‘MASS’ ‘matrixStats’ ‘R.oo’ ‘R.utils’ ‘aroma.core’
+ ‘aroma.affymetrix’ ‘DNAcopy’
+Adding so many packages to the search path is excessive and importing
+selectively is preferable.
+
+checking top-level files ... NOTE
+Non-standard file/directory found at top level:
+ ‘incl’
+
+checking dependencies in R code ... NOTE
+Packages in Depends field not imported from:
+ ‘DNAcopy’ ‘MASS’ ‘R.methodsS3’ ‘R.oo’ ‘aroma.affymetrix’ ‘aroma.core’
+ ‘matrixStats’
+ These packages need to be imported from (in the NAMESPACE file)
+ for when this namespace is loaded but not attached.
+
+checking S3 generic/method consistency ... NOTE
+Found the following apparent S3 methods exported but not registered:
+ NSAByTotalAndFracB.matrix allocateOutputDataSets.NSANormalization
+ allocateOutputDataSets.SNPsNormalization
+ allocateOutputDataSets.SampleNormalization
+ as.character.NSANormalization as.character.SNPsNormalization
+ as.character.SampleNormalization findArraysTodo.NSANormalization
+ findArraysTodo.SampleNormalization findUnitsTodo.SNPsNormalization
+ fitNSA.matrix fitNSAcnPs.matrix getDataSets.NSANormalization
+ getDataSets.SNPsNormalization getDataSets.SampleNormalization
+ getName.NSANormalization getName.SNPsNormalization
+ getName.SampleNormalization getOutputDataSets.NSANormalization
+ getOutputDataSets.SNPsNormalization
+ getOutputDataSets.SampleNormalization getPath.NSANormalization
+ getPath.SNPsNormalization getPath.SampleNormalization
+ getRootPath.NSANormalization getRootPath.SNPsNormalization
+ getRootPath.SampleNormalization process.NSANormalization
+ process.SNPsNormalization process.SampleNormalization
+ sampleNByTotalAndFracB.numeric snpsNByTotalAndFracB.matrix
+See section ‘Registering S3 methods’ in the ‘Writing R Extensions’
+manual.
+
+checking R code for possible problems ... NOTE
+NB: .First.lib is obsolete and will not be used in R >= 3.0.0
+
+.First.lib: no visible global function definition for
+ ‘packageDescription’
+NSAByTotalAndFracB.matrix: no visible global function definition for
+ ‘throw’
+NSAByTotalAndFracB.matrix: no visible global function definition for
+ ‘str’
+NSANormalization: no visible global function definition for ‘throw’
+... 279 lines ...
+ extractMatrix findUnitsTodo getAsteriskTags getChipType getFile
+ getFullName getFullNames getGenomeInformation getName getNames
+ getPath getPathname getPathnames getPositions getRam getRootPath
+ getTags getUnitsOnChromosome hist median nbrOfFiles newInstance
+ packageDescription rowAlls rowMedians segment setTags str throw trim
+ verbose
+Consider adding
+ importFrom("graphics", "hist")
+ importFrom("stats", "approxfun", "median")
+ importFrom("utils", "packageDescription", "str")
+to your NAMESPACE file.
+
+checking Rd line widths ... NOTE
+Rd file 'NSANormalization.Rd':
+ \examples lines wider than 100 characters:
+ by <- 50e3; # 50kb bins; you may want to try with other amounts of smoothing xOut <- seq(from=xRange[1], to=xRange[2], by=by);
+ plot(getSignals(cnCNPS), getSignals(cnSNPS), xlim=Clim, ylim=Clim); abline(a=0, b=1, col="red", lwd=2);
+
+These lines will be truncated in the PDF manual.
+```
+
+## PECA (1.10.0)
+Maintainer: Tomi Suomi <tomi.suomi at utu.fi>
+
+0 errors | 0 warnings | 1 note
+
+```
+checking Rd line widths ... NOTE
+Rd file 'PECA.Rd':
+ \usage lines wider than 90 characters:
+ PECA_AffyBatch(affy=NULL, normalize=FALSE, test="t", type="median", paired=FALSE, progress=FALSE)
+
+These lines will be truncated in the PDF manual.
+```
+
+## PureCN (1.2.3)
+Maintainer: Markus Riester <markus.riester at novartis.com>
+
+0 errors | 0 warnings | 1 note
+
+```
+checking R code for possible problems ... NOTE
+Found the following calls to data() loading into the global environment:
+File ‘PureCN/R/bootstrapResults.R’:
+ data(purecn.example.output)
+File ‘PureCN/R/callAlterations.R’:
+ data(purecn.example.output)
+ data(purecn.example.output)
+File ‘PureCN/R/callLOH.R’:
+ data(purecn.example.output)
+File ‘PureCN/R/createCurationFile.R’:
+ data(purecn.example.output)
+File ‘PureCN/R/curateResults.R’:
+ data(purecn.example.output)
+ data(purecn.example.output)
+File ‘PureCN/R/plotAbs.R’:
+ data(purecn.example.output)
+File ‘PureCN/R/predictSomatic.R’:
+ data(purecn.example.output)
+File ‘PureCN/R/readCurationFile.R’:
+ data(purecn.example.output)
+See section ‘Good practice’ in ‘?data’.
+```
+
+## Repitools (1.20.0)
+Maintainer: Mark Robinson <mark.robinson at imls.uzh.ch>
+
+0 errors | 0 warnings | 2 notes
+
+```
+checking R code for possible problems ... NOTE
+Found an obsolete/platform-specific call in the following function:
+ ‘maskOut’
+Found the platform-specific device:
+ ‘windows’
+dev.new() is the preferred way to open a new device, in the unlikely
+event one is needed.
+.cpgBoxplots: no visible global function definition for ‘pdf’
+.cpgBoxplots: no visible global function definition for ‘par’
+.cpgBoxplots: no visible global function definition for ‘dev.off’
+... 291 lines ...
+ rainbow read.table rect str t.test text title verbose
+Consider adding
+ importFrom("grDevices", "dev.off", "pdf", "rainbow")
+ importFrom("graphics", "abline", "axis", "barplot", "bxp", "grid",
+ "layout", "legend", "lines", "matlines", "matplot", "mtext",
+ "par", "persp", "plot", "plot.new", "plot.window", "points",
+ "polygon", "rect", "text", "title")
+ importFrom("stats", "dbeta", "embed", "filter", "kmeans", "lm",
+ "lowess", "p.adjust", "predict", "pt", "qnorm", "t.test")
+ importFrom("utils", "read.table", "str")
+to your NAMESPACE file.
+
+checking Rd line widths ... NOTE
+Rd file 'ChromaBlocks.Rd':
+ \usage lines wider than 90 characters:
+ ChromaBlocks(rs.ip, rs.input, organism, chrs, ipWidth=100, inputWidth=500, preset=NULL, blockWidth=NULL, minBlocks=NULL, extend=NULL, c ... [TRUNCATED]
+
+Rd file 'GCbiasPlots.Rd':
+ \usage lines wider than 90 characters:
+ cex = 0.2, pch.col = "black", line.col = "red", lty = 1, lwd = 2, verbose = TRUE)
+
+Rd file 'absoluteCN.Rd':
+... 57 lines ...
+
+Rd file 'regionStats.Rd':
+ \usage lines wider than 90 characters:
+ regionStats(x, design = NULL, maxFDR=0.05, n.perm=5, window=600, mean.trim=.1, min.probes=10, max.gap=500, two.sides=TRUE, ndf, return. ... [TRUNCATED]
+ regionStats(x, design = NULL, maxFDR=0.05, n.perm=5, window=600, mean.trim=.1, min.probes=10, max.gap=500, two.sides=TRUE, ind=NULL, re ... [TRUNCATED]
+
+Rd file 'writeWig.Rd':
+ \usage lines wider than 90 characters:
+ writeWig(rs, seq.len = NULL, design=NULL, sample=20, drop.zero=TRUE, normalize=TRUE, verbose=TRUE)
+
+These lines will be truncated in the PDF manual.
+```
+
+## TIN (1.6.0)
+Maintainer: Bjarne Johannessen <bjajoh at rr-research.no>
+
+0 errors | 0 warnings | 2 notes
+
+```
+checking top-level files ... NOTE
+Non-standard file/directory found at top level:
+ ‘doc’
+
+checking R code for possible problems ... NOTE
+aberrantExonUsage: no visible global function definition for ‘quantile’
+aberrantExonUsage: no visible global function definition for ‘ave’
+clusterPlot: no visible global function definition for ‘dist’
+clusterPlot: no visible global function definition for ‘hclust’
+clusterPlot: no visible global function definition for
+ ‘colorRampPalette’
+clusterPlot: no visible global function definition for ‘par’
+clusterPlot: no visible global function definition for ‘png’
+clusterPlot: no visible global function definition for ‘jpeg’
+... 50 lines ...
+ importFrom("stats", "ave", "dist", "hclust", "median", "quantile")
+ importFrom("utils", "data", "read.table")
+to your NAMESPACE file.
+
+Found the following assignments to the global environment:
+File ‘TIN/R/aberrantExonUsage.R’:
+ assign("quantiles", quantiles, envir = .GlobalEnv)
+ assign("aberrantExons", aberrantExons, envir = .GlobalEnv)
+File ‘TIN/R/correlationPlot.R’:
+ assign("randomGeneSetsDist", B, envir = .GlobalEnv)
+ assign("traPermutationsDist", L, envir = .GlobalEnv)
+```
+
diff --git a/revdep/check.R b/revdep/check.R
new file mode 100644
index 0000000..1eefa00
--- /dev/null
+++ b/revdep/check.R
@@ -0,0 +1,20 @@
+library("devtools")
+
+availableCores <- function() {
+ getenv <- function(name) {
+ as.integer(Sys.getenv(name, NA_character_))
+ }
+ getopt <- function(name) {
+ as.integer(getOption(name, NA_integer_))
+ }
+ if (is.finite(n <- getopt("mc.cores") + 1L)) return(n)
+ if (is.finite(n <- getopt("Ncpus") + 1L)) return(n)
+ if (is.finite(n <- getenv("PBS_NUM_PPN"))) return(n)
+ if (is.finite(n <- getenv("SLURM_CPUS_PER_TASK"))) return(n)
+ if (is.finite(n <- getenv("NSLOTS"))) return(n)
+ 1L
+}
+
+revdep_check(bioconductor = TRUE, recursive = TRUE, threads = availableCores())
+revdep_check_save_summary()
+revdep_check_print_problems()
diff --git a/revdep/problems.md b/revdep/problems.md
new file mode 100644
index 0000000..0fa19e2
--- /dev/null
+++ b/revdep/problems.md
@@ -0,0 +1,40 @@
+# Setup
+
+## Platform
+
+|setting |value |
+|:--------|:----------------------------|
+|version |R version 3.3.2 (2016-10-31) |
+|system |x86_64, linux-gnu |
+|ui |X11 |
+|language |en |
+|collate |en_US.UTF-8 |
+|tz |US/Pacific |
+|date |2016-11-10 |
+
+## Packages
+
+|package |* |version |date |source |
+|:-----------|:--|:-------|:----------|:--------------|
+|aroma.light | |3.4.0 |2016-10-31 |cran (@3.4.0) |
+|DNAcopy | |1.48.0 |2016-10-31 |cran (@1.48.0) |
+|future | |1.1.1 |2016-10-11 |cran (@1.1.1) |
+|ggplot2 | |2.1.0 |2016-03-01 |CRAN (R 3.3.1) |
+|Hmisc | |4.0-0 |2016-11-01 |cran (@4.0-0) |
+|listenv | |0.6.0 |2015-12-28 |CRAN (R 3.3.1) |
+|matrixStats | |0.51.0 |2016-10-09 |cran (@0.51.0) |
+|PSCBS | |0.61.0 |2016-02-04 |CRAN (R 3.3.1) |
+|R.cache | |0.12.0 |2015-11-12 |CRAN (R 3.3.1) |
+|R.devices | |2.15.1 |2016-11-10 |cran (@2.15.1) |
+|R.methodsS3 | |1.7.1 |2016-02-16 |CRAN (R 3.3.1) |
+|R.oo | |1.21.0 |2016-11-01 |cran (@1.21.0) |
+|R.rsp | |0.30.0 |2016-05-15 |CRAN (R 3.3.1) |
+|R.utils | |2.5.0 |2016-11-07 |cran (@2.5.0) |
+
+# Check results
+
+0 packages with problems
+
+
+
+
diff --git a/revdep/timing.md b/revdep/timing.md
new file mode 100644
index 0000000..5f9b0ed
--- /dev/null
+++ b/revdep/timing.md
@@ -0,0 +1,17 @@
+# Check times
+
+| |package |version | check_time|
+|:--|:----------------|:-------|----------:|
+|9 |PureCN |1.2.3 | 693.1|
+|10 |Repitools |1.20.0 | 476|
+|11 |TIN |1.6.0 | 245.3|
+|2 |aroma.affymetrix |3.0.0 | 224.1|
+|8 |PECA |1.10.0 | 183.5|
+|4 |aroma.core |3.0.0 | 141.8|
+|6 |MPAgenomics |1.1.2 | 92.9|
+|3 |aroma.cn |1.6.1 | 55.3|
+|7 |NSA |0.0.32 | 53.1|
+|5 |calmate |0.12.1 | 51.4|
+|1 |ACNE |0.8.1 | 42|
+
+
diff --git a/tests/PairedPSCBS,plot.R.HIDE b/tests/PairedPSCBS,plot.R.HIDE
deleted file mode 100644
index 6fd8712..0000000
--- a/tests/PairedPSCBS,plot.R.HIDE
+++ /dev/null
@@ -1,31 +0,0 @@
-###########################################################
-# This tests:
-# - segmentByCBS(...)
-# - segmentByCBS(..., knownSegments)
-# - tileChromosomes()
-# - plotTracks()
-###########################################################
-library("PSCBS")
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# Load SNP microarray data
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-data <- PSCBS::exampleData("paired.chr01")
-
-## Setup basic data
-CT <- data$CT/data$CN
-muN <- callNaiveGenotypes(data$betaN, censorAt=c(0,1))
-isSnp <- (!is.na(data$betaT) & !is.na(data$muN))
-isHet <- isSnp & (data$muN == 1/2)
-rho <- rep(NA_real_, length=nrow(data))
-rho[isHet] <- 2*abs(data$betaTN[isHet]-1/2)
-
-data <- cbind(data[,c("chromosome", "x")], CT=CT, rho=rho)
-segs <- data.frame(chromosome=sort(unique(data$chromosome)))
-fit <- structure(list(data=data, output=segs), class=c("PairedPSCBS", "PSCBS", "AbstractCBS", class(data)))
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# Paired PSCBS segmentation
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# Drop single-locus outliers
-dataS <- dropSegmentationOutliers(data)
diff --git a/tests/segmentByCBS,futures.R b/tests/segmentByCBS,futures.R
index 0a457a8..332d36c 100644
--- a/tests/segmentByCBS,futures.R
+++ b/tests/segmentByCBS,futures.R
@@ -49,11 +49,10 @@ oplan <- plan()
strategies <- c("eager", "lazy")
if (supportsMulticore()) strategies <- c(strategies, "multicore")
-## Test 'async' futures?
-pkg <- "async"
+## Test 'future.BatchJobs' futures?
+pkg <- "future.BatchJobs"
if (require(pkg, character.only=TRUE)) {
- backend("local")
- strategies <- c(strategies, "batchjobs")
+ strategies <- c(strategies, "batchjobs_local")
}
message("Future strategies to test: ", paste(sQuote(strategies), collapse=", "))
diff --git a/tests/segmentByCBS,shiftTCN.R b/tests/segmentByCBS,shiftTCN.R
index 5bf0a71..bba03ba 100644
--- a/tests/segmentByCBS,shiftTCN.R
+++ b/tests/segmentByCBS,shiftTCN.R
@@ -52,7 +52,7 @@ plotTracks(fit, Clim=Clim)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fitList <- list()
chrs <- getChromosomes(fit)
-for (kk in seq(along=chrs)) {
+for (kk in seq_along(chrs)) {
chr <- chrs[kk]
fitKK <- extractChromosome(fit, chr)
if (kk %% 2 == 0) {
@@ -79,7 +79,7 @@ plotTracks(fit, Clim=Clim)
abline(v=c(knownSegments$start, knownSegments$end)/1e6, lty=3)
fitList <- list()
-for (kk in seq(length=nrow(knownSegments))) {
+for (kk in seq_len(nrow(knownSegments))) {
seg <- knownSegments[kk,]
start <- seg$start
end <- seg$end
diff --git a/tests/segmentByPairedPSCBS,futures.R b/tests/segmentByPairedPSCBS,futures.R
index a23bcd5..d4a7438 100644
--- a/tests/segmentByPairedPSCBS,futures.R
+++ b/tests/segmentByPairedPSCBS,futures.R
@@ -44,11 +44,10 @@ oplan <- plan()
strategies <- c("eager", "lazy")
if (supportsMulticore()) strategies <- c(strategies, "multicore")
-## Test 'async' futures?
-pkg <- "async"
+## Test 'future.BatchJobs' futures?
+pkg <- "future.BatchJobs"
if (require(pkg, character.only=TRUE)) {
- backend("local")
- strategies <- c(strategies, "batchjobs")
+ strategies <- c(strategies, "batchjobs_local")
}
message("Future strategies to test: ", paste(sQuote(strategies), collapse=", "))
diff --git a/vignettes/.install_extras b/vignettes/.install_extras
new file mode 100644
index 0000000..49160a6
--- /dev/null
+++ b/vignettes/.install_extras
@@ -0,0 +1,8 @@
+vignettes/[^/]+[.](Rnw)$
+vignettes/[^/]+[.](rsp)$
+vignettes/[^/]+[.](Rasciidoc|Rhtml|Rmd|Rrst|Rtex)$
+vignettes/[^/]+[.](brew)$
+vignettes/[^/]+[.](asciidoc|md|str|tex)$
+vignettes/[^/]+[.](r|R)$
+vignettes/[^/]+[.](pdf|PDF|html|HTML)$
+vignettes/dummy[.](Rnw|pdf)$
diff --git a/vignettes/CBS.tex.rsp b/vignettes/CBS.tex.rsp
index 979b1df..5a5cff4 100644
--- a/vignettes/CBS.tex.rsp
+++ b/vignettes/CBS.tex.rsp
@@ -105,7 +105,7 @@ This document shows how to use the \pkg{PSCBS} package to run CBS on a tumor sam
\keywords{<%@meta name="keywords"%>}
\begin{center}
-\emph{This vignette is distributed as part of the \pkg{PSCBS} package, which is available on CRAN (\url{http://cran.r-project.org/}).
+\emph{This vignette is distributed as part of the \pkg{PSCBS} package, which is available on CRAN (\url{https://cran.r-project.org/}).
The authors very much appreciate feedback on this document.}
\end{center}
diff --git a/vignettes/Makefile b/vignettes/Makefile
new file mode 100644
index 0000000..70c8c54
--- /dev/null
+++ b/vignettes/Makefile
@@ -0,0 +1,30 @@
+# MACRO DEFINITIONS
+RM=rm -f
+R=$(R_HOME)/bin/Rscript
+
+# TARGET DEFINITIONS
+all: vignettes tex index.html
+
+# Build all vignettes that has a %\VignetteBuild{} markup
+vignettes:
+ "$(R)" -e "if (getRversion() < 3) R.rsp::buildNonSweaveVignettes()"
+ "$(R)" -e "if (getRversion() >= 3) unlink('dummy.Rnw')"
+
+# Compile any TeX files for which a PDF is missing
+tex:
+ "$(R)" -e "if (packageVersion('R.rsp') >= '0.9.1') R.rsp::buildNonSweaveTexToPdf()"
+
+# Create an HTML vignette index page
+index.html:
+ "$(R)" -e "if (getRversion() < 3) R.rsp::buildPkgIndexHtml()"
+
+# Certain LaTeX files (e.g. bib, bst, sty) must be part of the build
+# such that they are available for R CMD check. These are excluded
+# from the install using .Rinstignore in the top-level directory.
+clean:
+ $(RM) enginesMap.R
+ $(RM) index.html.rsp
+ $(RM) *.rsp.R
+ $(RM) *.tex *.aux *.bbl *.blg *.log *.out *.sty *.toc
+ $(RM) -r figures/
+ $(RM) Makefile
diff --git a/vignettes/PSCBS.bib b/vignettes/PSCBS.bib
index 8bddbee..4773136 100644
--- a/vignettes/PSCBS.bib
+++ b/vignettes/PSCBS.bib
@@ -17,7 +17,7 @@
CBS},
pii = {5/4/557},
pmid = {15475419},
- url = {http://dx.doi.org/10.1093/biostatistics/kxh008}
+ url = {https://dx.doi.org/10.1093/biostatistics/kxh008}
}
@@ -38,7 +38,7 @@
Factors},
pii = {btl646},
pmid = {17234643},
- url = {http://dx.doi.org/10.1093/bioinformatics/btl646}
+ url = {https://dx.doi.org/10.1093/bioinformatics/btl646}
}
@@ -54,7 +54,7 @@
number = {15},
doi = {10.1093/bioinformatics/btr329},
pmid = {21666266},
- url = {http://bioinformatics.oxfordjournals.org/content/27/15/2038}
+ url = {https://bioinformatics.oxfordjournals.org/content/27/15/2038}
}
@@ -73,5 +73,5 @@
medline-pst = {aheadofprint},
pii = {1471-2105-11-245},
pmid = {20462408},
- url = {http://dx.doi.org/10.1186/1471-2105-11-245}
+ url = {https://dx.doi.org/10.1186/1471-2105-11-245}
}
diff --git a/vignettes/PairedPSCBS.tex.rsp b/vignettes/PairedPSCBS.tex.rsp
index 7dbe86d..0a6f216 100644
--- a/vignettes/PairedPSCBS.tex.rsp
+++ b/vignettes/PairedPSCBS.tex.rsp
@@ -110,7 +110,7 @@ This document shows how to use the \pkg{PSCBS} package to run Paired PSCBS on a
\keywords{<%@meta name="keywords"%>}
\begin{center}
-\emph{This vignette is distributed as part of the \pkg{PSCBS} package, which is available on CRAN (\url{http://cran.r-project.org/}).
+\emph{This vignette is distributed as part of the \pkg{PSCBS} package, which is available on CRAN (\url{https://cran.r-project.org/}).
The authors very much appreciate feedback on this document.}
\end{center}
diff --git a/vignettes/dummy.Rnw b/vignettes/dummy.Rnw
new file mode 100644
index 0000000..49a3cd4
--- /dev/null
+++ b/vignettes/dummy.Rnw
@@ -0,0 +1,11 @@
+% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+% To build non-Sweave vignettes, place this dummy.Rnw in vignettes/
+% together with the custom Makefile (also from R.rsp). That will
+% trigger R to build all non-Sweave vignettes. The two files
+% dummy.Rnw and the Makefile will not be the package installation.
+% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+%\VignetteIndexEntry{Dummy vignette to trigger the use of the Makefile}
+%\VignetteEngine{R.rsp::dummy_Rnw}
+\documentclass{article}
+\begin{document}
+\end{document}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/r-cran-pscbs.git
More information about the debian-med-commit
mailing list