Running 'PairedPSCNData,SEG.R' [0s]
  Running 'PairedPSCNData.R' [154s]
  Running 'RawCopyNumbers,states.R' [169s]
  Running 'RawCopyNumbers.R' [2s]
  Running 'RawGenomicSignals.R' [156s]
  Running 'RawGenomicSignals.SEG,MP.R' [1s]
  Running 'RawGenomicSignals.SEG.R' [2s]
  Running 'RichDataFrame.R' [1s]
  Running 'SegmentedCopyNumbers.R' [2s]
  Running 'aromaSettings.R' [1s]
  Running 'binScatter.R' [2s]
  Running 'colBinnedSmoothing.R' [1s]
  Running 'colKernelSmoothing.R' [1s]
  Running 'fitGenotypeCone.R' [1s]
  Running 'fitMultiDimensionalCone.R' [1s]
  Running 'matrixBlockPolish.R' [1s]
  Running 'mergeBoxplotStats.R' [155s]
Running the tests in 'tests/PairedPSCNData.R' failed.
Complete output:
  > # Only run this test in full testing mode
  > if (Sys.getenv("_R_CHECK_FULL_") != "") {
  + 
  + library("aroma.core");
  + library("PSCBS");
  + verbose <- Arguments$getVerbose(-10);
  + setOption("digits", 2);
  + 
  + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  + # Loading data
  + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  + verbose && enter(verbose, "Loading SNP data");
  + data <- PSCBS::exampleData("paired.chr01");
  + verbose && str(verbose, data);
  + verbose && exit(verbose);
  + 
  + 
  + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  + # Paired PSCN data
  + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  + verbose && enter(verbose, "Setting up PairedPSCNData");
  + data <- PairedPSCNData(data);
  + verbose && print(verbose, data);
  + verbose && print(verbose, head(as.data.frame(data)));
  + verbose && exit(verbose);
  + 
  + verbose && enter(verbose, "Extracting germline data");
  + dataN <- extractNonPairedPSCNData(data, which="N");
  + verbose && print(verbose, dataN);
  + verbose && print(verbose, head(as.data.frame(dataN)));
  + verbose && exit(verbose);
  + 
  + verbose && enter(verbose, "Calling genotypes");
  + data <- callNaiveGenotypes(data);
  + verbose && print(verbose, head(as.data.frame(data)));
  + verbose && exit(verbose);
  + 
  + verbose && enter(verbose, "Normalizing tumor BAFs");
  + data <- normalizeTumorBoost(data);
  + verbose && print(verbose, head(as.data.frame(data)));
  + verbose && exit(verbose);
  + 
  + verbose && enter(verbose, "Calling SNPs from germline BAFs");
  + data <- callSNPs(data);
  + verbose && print(verbose, head(as.data.frame(data)));
  + verbose && exit(verbose);
  + 
  + idxs <- hasKnownPositions(data);
  + verbose && str(verbose, idxs);
  + 
  + verbose && enter(verbose, "Dropping TCN outliers");
  + data <- dropSegmentationOutliers(data);
  + verbose && print(verbose, head(as.data.frame(data)));
  + verbose && exit(verbose);
  + 
  + 
  + 
  + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  + # Split up in tumor and normal non-paired PSCN data
  + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  + verbose && enter(verbose, "Extracting tumor data");
  + dataT <- extractNonPairedPSCNData(data, "T");
  + print(head(dataT));
  + verbose && exit(verbose);
  + 
  + verbose && enter(verbose, "Extracting germline data");
  + dataN <- extractNonPairedPSCNData(data, "N");
  + print(head(dataN));
  + verbose && exit(verbose);
  + 
  + 
  + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  + # Merge tumor and normal into paired PSCN data
  + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  + data2 <- as.PairedPSCNData(T=dataT, N=dataN);
  + print(head(data2))
  + 
  + # Validate
  + stopifnot(all.equal(data2, data[,colnames(data2)]));
  + 
  + 
  + } # if (Sys.getenv("_R_CHECK_FULL_"))
  > 
  > proc.time()
     user  system elapsed 
     0.21    0.01    0.21 
Running the tests in 'tests/RawCopyNumbers,states.R' failed.
Complete output:
  > library("aroma.core")
  Loading required package: R.utils
  Loading required package: R.oo
  Loading required package: R.methodsS3
  R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
  R.oo v1.26.0 (2024-01-24 05:12:50 UTC) successfully loaded. See ?R.oo for help.
  
  Attaching package: 'R.oo'
  
  The following object is masked from 'package:R.methodsS3':
  
      throw
  
  The following objects are masked from 'package:methods':
  
      getClasses, getMethods
  
  The following objects are masked from 'package:base':
  
      attach, detach, load, save
  
  R.utils v2.12.3 (2023-11-18 01:00:02 UTC) successfully loaded. See ?R.utils for help.
  
  Attaching package: 'R.utils'
  
  The following object is masked from 'package:utils':
  
      timestamp
  
  The following objects are masked from 'package:base':
  
      cat, commandArgs, getOption, isOpen, nullfile, parse, use, warnings
  
  Loading required package: R.filesets
  R.filesets v2.15.1 (2024-01-24 17:22:49 UTC) successfully loaded. See ?R.filesets for help.
  
  Attaching package: 'R.filesets'
  
  The following object is masked from 'package:R.utils':
  
      validate
  
  The following objects are masked from 'package:base':
  
      append, readLines
  
  Loading required package: R.devices
  R.devices v2.17.2 (2024-01-29 13:30:11 UTC) successfully loaded. See ?R.devices for help.
  aroma.core v3.3.1 (2024-02-19 08:40:02 UTC) successfully loaded. See ?aroma.core for help.
  
  Attaching package: 'aroma.core'
  
  The following objects are masked from 'package:base':
  
      .Machine, colMeans, colSums, library, require, write
  
  > 
  > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Simulating copy-number data
  > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # True CN states
  > stateFcn <- function(data, ...) {
  +   x <- data$x
  +   states <- integer(length(x))
  +   states[100 <=x & x <= 150] <- -1L
  +   states[320 <=x & x <= 400] <- +1L
  +   states
  + }
  > 
  > stateFcn <- function(data, ...) {
  +   x <- data$x
  +   states <- rep("neutral", time=length(x))
  +   states[100 <=x & x <= 150] <- "loss"
  +   states[320 <=x & x <= 400] <- "gain"
  +   states
  + }
  > 
  > # Number of loci
  > J <- 500
  > 
  > eps <- rnorm(J, sd=1/2)
  > mu <- double(J)
  > x <- 1:J
  > 
  > levels <- c("neutral"=0, "loss"=-1, "gain"=+1);
  > 
  > cn <- RawCopyNumbers(eps, x=x)
  > cn$state <- stateFcn
  > cn$cn <- cn$cn + 0.8*levels[cn$state]
  > print(cn)
  RawCopyNumbers:
  Name: <none>
  Number of rows: 500
  Number of columns: 4
  Columns: chromosome [numeric], x [numeric], cn [numeric], state* [character]
  Chromosomes: 0 [1]
  Number of loci: 500
  Position range: [1,500]
  Mean distance between loci: 1
  > 
  > 
  > cn2 <- extractSubset(cn, subset=xSeq(cn, by=5))
  > print(cn2)
  RawCopyNumbers:
  Name: <none>
  Number of rows: 100
  Number of columns: 4
  Columns: chromosome [numeric], x [numeric], cn [numeric], state* [character]
  Chromosomes: 0 [1]
  Number of loci: 100
  Position range: [1,496]
  Mean distance between loci: 5
  > 
  > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Plot along genome
  > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  > plot(cn, ylim=c(-3,3))
  > title(main="Complete and subsetted loci")
  > points(cn2, col="red", pch=176, cex=2)
  There were 50 or more warnings (use warnings() to see the first 50)
  > 
  > legend("topright", pch=c(19,176), col=c("#999999", "red"), sprintf(c("raw [n=%d]", "every 5th [n=%d]"), c(nbrOfLoci(cn), nbrOfLoci(cn2))), bty="n")
  Warning message:
  In plot.xy(xy.coords(x, y), type = type, ...) :
    pch value '176' is invalid in this locale
  > 
  > 
  > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Binned smoothing
  > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  > plot(cn, col="#999999", ylim=c(-3,3))
  > title(main="Binned smoothing by State")
  > 
  > cnSa <- binnedSmoothingByField(cn, by=3, field="state")
  > lines(cnSa, col="blue")
  > points(cnSa, col="blue")
  > 
  > cnSb <- binnedSmoothingByField(cn, by=9, field="state")
  > lines(cnSb, col="red")
  > points(cnSb, col="red")
  > 
  > legend("topright", pch=19, col=c("#999999", "blue", "red"), sprintf(c("raw [n=%d]", "Bin(w=3) [n=%d]", "Bin(w=9) [n=%d]"), c(nbrOfLoci(cn), nbrOfLoci(cnSa), nbrOfLoci(cnSb))), bty="n")
  > 
  > proc.time()
     user  system elapsed 
     1.06    0.28    1.34 
Running the tests in 'tests/RawGenomicSignals.R' failed.
Complete output:
  > library("aroma.core")
  Loading required package: R.utils
  Loading required package: R.oo
  Loading required package: R.methodsS3
  R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
  R.oo v1.26.0 (2024-01-24 05:12:50 UTC) successfully loaded. See ?R.oo for help.
  
  Attaching package: 'R.oo'
  
  The following object is masked from 'package:R.methodsS3':
  
      throw
  
  The following objects are masked from 'package:methods':
  
      getClasses, getMethods
  
  The following objects are masked from 'package:base':
  
      attach, detach, load, save
  
  R.utils v2.12.3 (2023-11-18 01:00:02 UTC) successfully loaded. See ?R.utils for help.
  
  Attaching package: 'R.utils'
  
  The following object is masked from 'package:utils':
  
      timestamp
  
  The following objects are masked from 'package:base':
  
      cat, commandArgs, getOption, isOpen, nullfile, parse, use, warnings
  
  Loading required package: R.filesets
  R.filesets v2.15.1 (2024-01-24 17:22:49 UTC) successfully loaded. See ?R.filesets for help.
  
  Attaching package: 'R.filesets'
  
  The following object is masked from 'package:R.utils':
  
      validate
  
  The following objects are masked from 'package:base':
  
      append, readLines
  
  Loading required package: R.devices
  R.devices v2.17.2 (2024-01-29 13:30:11 UTC) successfully loaded. See ?R.devices for help.
  aroma.core v3.3.1 (2024-02-19 08:40:02 UTC) successfully loaded. See ?aroma.core for help.
  
  Attaching package: 'aroma.core'
  
  The following objects are masked from 'package:base':
  
      .Machine, colMeans, colSums, library, require, write
  
  > 
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Simulating copy-number data
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Number of loci
  > J <- 500
  > 
  > mu <- double(J)
  > mu[100:150] <- mu[100:150] + 1
  > mu[320:400] <- mu[320:400] - 1
  > eps <- rnorm(J, sd=1/2)
  > y <- mu + eps
  > x <- sort(runif(length(y), max=length(y)))
  > w <- runif(J)
  > w[320:400] <- 0.001
  > 
  > 
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # True and estimated signals
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > cnT <- RawCopyNumbers(mu, x, w=w)
  > print(cnT)
  RawCopyNumbers:
  Name: <none>
  Number of rows: 500
  Number of columns: 4
  Columns: chromosome [numeric], x [numeric], cn [numeric], w [numeric]
  Chromosomes: 0 [1]
  Number of loci: 500
  Position range: [0.597434,499.91]
  Mean distance between loci: 1.00063
  > 
  > cn <- RawCopyNumbers(y, x, w=w)
  > print(cn)
  RawCopyNumbers:
  Name: <none>
  Number of rows: 500
  Number of columns: 4
  Columns: chromosome [numeric], x [numeric], cn [numeric], w [numeric]
  Chromosomes: 0 [1]
  Number of loci: 500
  Position range: [0.597434,499.91]
  Mean distance between loci: 1.00063
  > 
  > 
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Extracting regions
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > cnR <- extractRegion(cn, region=c(50,350))
  > print(cnR)
  RawCopyNumbers:
  Name: <none>
  Number of rows: 291
  Number of columns: 4
  Columns: chromosome [numeric], x [numeric], cn [numeric], w [numeric]
  Chromosomes: 0 [1]
  Number of loci: 291
  Position range: [51.1914,349.308]
  Mean distance between loci: 1.02799
  > 
  > regions <- data.frame(
  +   chromosome = c(  0,  0),
  +   start      = c( 50,200),
  +   stop       = c(100,300)
  + )
  > cnR <- extractRegions(cn, regions=regions)
  > print(cnR)
  RawCopyNumbers:
  Name: <none>
  Number of rows: 153
  Number of columns: 4
  Columns: chromosome [numeric], x [numeric], cn [numeric], w [numeric]
  Chromosomes: 0 [1]
  Number of loci: 153
  Position range: [51.1914,299.348]
  Mean distance between loci: 1.63261
  > 
  > 
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Operators
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Genomic positions are never included, i.e. they are kept.
  > cnD <- subtractBy(cn, cnT)
  > print(cnD)
  RawCopyNumbers:
  Name: <none>
  Number of rows: 500
  Number of columns: 4
  Columns: chromosome [numeric], x [numeric], cn [numeric], w [numeric]
  Chromosomes: 0 [1]
  Number of loci: 500
  Position range: [0.597434,499.91]
  Mean distance between loci: 1.00063
  > 
  > # Subtract only fields, i.e. keep field 'w'.
  > cnD <- subtractBy(cn, cnT, fields="cn")
  > 
  > 
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > # Plotting
  > # - - - - - - - - - - - - - - - - - - - - - - - - - -
  > subplots(2, ncol=1)
  > plot(cn, ylim=c(-3,3), col="#aaaaaa")
  > points(cnT, col="red")
  > 
  > plot(cnD, ylim=c(-3,3), col="blue")
  > 
  > 
  > proc.time()
     user  system elapsed 
     1.00    0.17    1.15 
Running the tests in 'tests/mergeBoxplotStats.R' failed.
Complete output:
  > library("aroma.core")
  Loading required package: R.utils
  Loading required package: R.oo
  Loading required package: R.methodsS3
  R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
  R.oo v1.26.0 (2024-01-24 05:12:50 UTC) successfully loaded. See ?R.oo for help.
  
  Attaching package: 'R.oo'
  
  The following object is masked from 'package:R.methodsS3':
  
      throw
  
  The following objects are masked from 'package:methods':
  
      getClasses, getMethods
  
  The following objects are masked from 'package:base':
  
      attach, detach, load, save
  
  R.utils v2.12.3 (2023-11-18 01:00:02 UTC) successfully loaded. See ?R.utils for help.
  
  Attaching package: 'R.utils'
  
  The following object is masked from 'package:utils':
  
      timestamp
  
  The following objects are masked from 'package:base':
  
      cat, commandArgs, getOption, isOpen, nullfile, parse, use, warnings
  
  Loading required package: R.filesets
  R.filesets v2.15.1 (2024-01-24 17:22:49 UTC) successfully loaded. See ?R.filesets for help.
  
  Attaching package: 'R.filesets'
  
  The following object is masked from 'package:R.utils':
  
      validate
  
  The following objects are masked from 'package:base':
  
      append, readLines
  
  Loading required package: R.devices
  R.devices v2.17.2 (2024-01-29 13:30:11 UTC) successfully loaded. See ?R.devices for help.
  aroma.core v3.3.1 (2024-02-19 08:40:02 UTC) successfully loaded. See ?aroma.core for help.
  
  Attaching package: 'aroma.core'
  
  The following objects are masked from 'package:base':
  
      .Machine, colMeans, colSums, library, require, write
  
  > library("stats")
  > 
  > x <- matrix(rnorm(1000), ncol=5)
  > x <- as.data.frame(x)
  > 
  > stats0 <- boxplot(x, plot=FALSE)
  > stats1 <- lapply(x, FUN=boxplot.stats)
  > stats1b <- mergeBoxplotStats(stats1)
  > stopifnot(all.equal(stats0, stats1b))
  > 
  > bxp(stats1b)
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.79    0.26    1.03