Running 'test01-chrom.R' [164s]
  Running 'test02-gb.R' [157s]
  Running 'test03-objects.R' [33s]
  Comparing 'test03-objects.Rout' to 'test03-objects.Rout.save' ... OK
  Running 'test100-read.R' [169s]
  Running 'test101-preclean.R' [0s]
  Comparing 'test101-preclean.Rout' to 'test101-preclean.Rout.save' ... OK
  Running 'testclip.R' [1s]
Running the tests in 'tests/test01-chrom.R' failed.
Complete output:
  > library(RCytoGPS)
  > 
  > try( x <- Chromosome(0) )   # fail
  Error in Chromosome(0) : Invalid chromosome name!
  > try( x <- Chromosome("Z") ) # fail
  Error in Chromosome("Z") : Invalid chromosome name!
  > try( x <- Chromosome(1:2) ) # fail
  Error in Chromosome(1:2) : Can only handle one chromosome at a time.
  > try (x <- Chromosome(c(1, "Z"))) # fail
  Error in Chromosome(c(1, "Z")) : 
    Can only handle one chromosome at a time.
  > try (x <- Chromosome(list(1, "Z"))) # fail
  Error in Chromosome(list(1, "Z")) : 
    Can only handle one chromosome at a time.
  > 
  > x <- Chromosome(11)
  > image(x)
  > image(x, showBandNames = TRUE)
  > image(x, horiz = TRUE)
  > image(x, horiz = TRUE, showBandNames = TRUE)
  > 
  > image(x, col="red") # silently ignores bad input?
  > 
  > proc.time()
     user  system elapsed 
     0.35    0.07    0.42 
Running the tests in 'tests/test02-gb.R' failed.
Complete output:
  > library(RCytoGPS)
  > 
  > set.seed(53106)
  > CL <- RCytoGPS:::cytobandLocations
  > fake <- as.data.frame(matrix(runif(nrow(CL) * 10), ncol = 10))
  > CL <- cbind(CL, fake) # extra colnames V1, ..., V10
  > all(diff(as.numeric(CL$Chromosome)) >= 0) # check chromosome order
  [1] TRUE
  > 
  > CD <- CytobandData(CL)
  > barplot(CD, what = "V10")
  > barplot(CD, what = list("V1")) # automagically converts list to vector
  > 
  > try( barplot(CD, what = c("V1", "V10")) )    # fail
  Error in .local(height, ...) : 
    'what' must identify exactly one data column.
  > try( barplot(CD, what = list("V1", "V10")) ) # fail
  Error in .local(height, ...) : 
    'what' must identify exactly one data column.
  > 
  > # confirm usability within preset par grid
  > opar <- par(mfrow = c(3,1))
  > barplot(CD, "V2", "green")
  > barplot(CD, "V3", "orange")
  > barplot(CD, "V5", "purple")
  > par(opar)
  > 
  > proc.time()
     user  system elapsed 
     0.35    0.09    0.43 
Running the tests in 'tests/test100-read.R' failed.
Complete output:
  > library(RCytoGPS)
  > 
  > sf <- system.file("Examples/JSONfiles", package = "RCytoGPS")
  > dir(sf)
  [1] "CytoGPS_Result1.json" "CytoGPS_Result2.json" "input1.txt"          
  [4] "input2.txt"          
  > 
  > ## Read one explicitly named JSON file
  > temp <- readLGF("CytoGPS_Result1.json", folder = sf)
  Reading 1 file(s) from 'D:/RCompile/CRANpkg/lib/4.4/RCytoGPS/Examples/JSONfiles'.
  
  > class(temp)
  [1] "list"
  > names(temp)
  [1] "source"    "raw"       "frequency" "size"      "CL"       
  > temp$source
  [1] "CytoGPS_Result1.json"
  > class(temp$raw)
  [1] "list"
  > length(temp$raw)
  [1] 1
  > names(temp$raw)
  [1] "CytoGPS_Result1"
  > temp$raw[[1]]$Status
        Status                                                    Karyotype
  RN01 Success 44-45,XX,+2,der(2;13)(q10;q10),-6,-8,+12,der(17;18)(q10;q10)
  RN02 Success                46,XY,t(14;18)(q32;q21)/46,XY,r(15)/47,XY,+12
  RN03 Success                                    47,XY,+12/49,idem,+18,+19
  > summary(temp$frequency)
   CytoGPS_Result1.Loss CytoGPS_Result1.Gain CytoGPS_Result1.Fusion
   Min.   :0.00000      Min.   :0.00000      Min.   :0.000000      
   1st Qu.:0.00000      1st Qu.:0.00000      1st Qu.:0.000000      
   Median :0.00000      Median :0.00000      Median :0.000000      
   Mean   :0.02573      Mean   :0.05127      Mean   :0.002688      
   3rd Qu.:0.00000      3rd Qu.:0.00000      3rd Qu.:0.000000      
   Max.   :0.16667      Max.   :0.66667      Max.   :0.166667      
  > temp$size
  CytoGPS_Result1 
                6 
  > 
  > ## Read all (well, two) JSON files fom a folder
  > temp <- readLGF(folder = sf)
  Reading 2 file(s) from 'D:/RCompile/CRANpkg/lib/4.4/RCytoGPS/Examples/JSONfiles'.
  
  > class(temp)
  [1] "list"
  > names(temp)
  [1] "source"    "raw"       "frequency" "size"      "CL"       
  > temp$source
  [1] "CytoGPS_Result1.json" "CytoGPS_Result2.json"
  > class(temp$raw)
  [1] "list"
  > length(temp$raw)
  [1] 2
  > names(temp$raw)
  [1] "CytoGPS_Result1" "CytoGPS_Result2"
  > temp$raw[[1]]$Status
        Status                                                    Karyotype
  RN01 Success 44-45,XX,+2,der(2;13)(q10;q10),-6,-8,+12,der(17;18)(q10;q10)
  RN02 Success                46,XY,t(14;18)(q32;q21)/46,XY,r(15)/47,XY,+12
  RN03 Success                                    47,XY,+12/49,idem,+18,+19
  > temp$raw[[2]]$Status
                 Status
  RN01 Validation error
  RN02          Success
  RN03          Success
                                                                          Karyotype
  RN01                                                         46,XY,-8,+12,der(14)
  RN02 48,XY,t(10;13)(q26;q14),+12,+19/47,XY,t(9;13)(p24;q13),-10,+12,+19/45,XY,-13
  RN03                                                    47,XY,+12,dup(14)(q32q32)
  > summary(temp$frequency)
   CytoGPS_Result1.Loss CytoGPS_Result1.Gain CytoGPS_Result1.Fusion
   Min.   :0.00000      Min.   :0.00000      Min.   :0.000000      
   1st Qu.:0.00000      1st Qu.:0.00000      1st Qu.:0.000000      
   Median :0.00000      Median :0.00000      Median :0.000000      
   Mean   :0.02573      Mean   :0.05127      Mean   :0.002688      
   3rd Qu.:0.00000      3rd Qu.:0.00000      3rd Qu.:0.000000      
   Max.   :0.16667      Max.   :0.66667      Max.   :0.166667      
   CytoGPS_Result2.Loss CytoGPS_Result2.Gain CytoGPS_Result2.Fusion
   Min.   :0.00000      Min.   :0.00000      Min.   :0.000000      
   1st Qu.:0.00000      1st Qu.:0.00000      1st Qu.:0.000000      
   Median :0.00000      Median :0.00000      Median :0.000000      
   Mean   :0.02247      Mean   :0.04839      Mean   :0.006624      
   3rd Qu.:0.00000      3rd Qu.:0.00000      3rd Qu.:0.000000      
   Max.   :0.25000      Max.   :0.75000      Max.   :0.250000      
  > temp$size
  CytoGPS_Result1 CytoGPS_Result2 
                6               4 
  > 
  > ## move about
  > home  <- getwd()
  > setwd(sf)
  > temp <- readLGF( "CytoGPS_Result1.json")
  Reading 1 file(s) from '.'.
  
  > temp <- readLGF( "CytoGPS_Result1.json", folder = ".")
  Reading 1 file(s) from '.'.
  
  > setwd("..")
  > temp <- readLGF(folder = "JSONfiles")
  Reading 2 file(s) from 'JSONfiles'.
  
  > setwd(home)
  > 
  > proc.time()
     user  system elapsed 
     0.68    0.04    0.71