Back to Multiple platform build/check report for BioC 3.9
[A]BCDEFGHIJKLMNOPQRSTUVWXYZ

CHECK report for ASAFE on tokay2

This page was generated on 2019-10-16 12:36:19 -0400 (Wed, 16 Oct 2019).

Package 83/1741HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
ASAFE 1.10.0
Qian Zhang
Snapshot Date: 2019-10-15 17:01:26 -0400 (Tue, 15 Oct 2019)
URL: https://git.bioconductor.org/packages/ASAFE
Branch: RELEASE_3_9
Last Commit: 2b5c041
Last Changed Date: 2019-05-02 11:54:03 -0400 (Thu, 02 May 2019)
malbec2 Linux (Ubuntu 18.04.2 LTS) / x86_64  OK  OK  OK UNNEEDED, same version exists in internal repository
tokay2 Windows Server 2012 R2 Standard / x64  OK  OK [ OK ] OK UNNEEDED, same version exists in internal repository
celaya2 OS X 10.11.6 El Capitan / x86_64  OK  OK  OK  OK UNNEEDED, same version exists in internal repository

Summary

Package: ASAFE
Version: 1.10.0
Command: C:\Users\biocbuild\bbs-3.9-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:ASAFE.install-out.txt --library=C:\Users\biocbuild\bbs-3.9-bioc\R\library --no-vignettes --timings ASAFE_1.10.0.tar.gz
StartedAt: 2019-10-16 01:58:55 -0400 (Wed, 16 Oct 2019)
EndedAt: 2019-10-16 01:59:24 -0400 (Wed, 16 Oct 2019)
EllapsedTime: 28.5 seconds
RetCode: 0
Status:  OK  
CheckDir: ASAFE.Rcheck
Warnings: 0

Command output

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


* using log directory 'C:/Users/biocbuild/bbs-3.9-bioc/meat/ASAFE.Rcheck'
* using R version 3.6.1 (2019-07-05)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using option '--no-vignettes'
* checking for file 'ASAFE/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'ASAFE' version '1.10.0'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'ASAFE' can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* loading checks for arch 'i386'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
* loading checks for arch 'x64'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking files in 'vignettes' ... OK
* checking examples ...
** running examples for arch 'i386' ... OK
** running examples for arch 'x64' ... OK
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
** running tests for arch 'i386' ...
  Running 'testthat.R'
 OK
** running tests for arch 'x64' ...
  Running 'testthat.R'
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in 'inst/doc' ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: OK


Installation output

ASAFE.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\cygwin\bin\curl.exe -O https://malbec2.bioconductor.org/BBS/3.9/bioc/src/contrib/ASAFE_1.10.0.tar.gz && rm -rf ASAFE.buildbin-libdir && mkdir ASAFE.buildbin-libdir && C:\Users\biocbuild\bbs-3.9-bioc\R\bin\R.exe CMD INSTALL --merge-multiarch --build --library=ASAFE.buildbin-libdir ASAFE_1.10.0.tar.gz && C:\Users\biocbuild\bbs-3.9-bioc\R\bin\R.exe CMD INSTALL ASAFE_1.10.0.zip && rm ASAFE_1.10.0.tar.gz ASAFE_1.10.0.zip
###
##############################################################################
##############################################################################


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  190k  100  190k    0     0  1010k      0 --:--:-- --:--:-- --:--:-- 1048k

install for i386

* installing *source* package 'ASAFE' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'ASAFE'
    finding HTML links ... done
    adm_ancestries_test                     html  
    adm_genotypes_test                      html  
    algorithm_1snp                          html  
    algorithm_1snp_wrapper                  html  
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path

install for x64

* installing *source* package 'ASAFE' ...
** testing if installed package can be loaded
* MD5 sums
packaged installation of 'ASAFE' as ASAFE_1.10.0.zip
* DONE (ASAFE)
* installing to library 'C:/Users/biocbuild/bbs-3.9-bioc/R/library'
package 'ASAFE' successfully unpacked and MD5 sums checked

Tests output

ASAFE.Rcheck/tests_i386/testthat.Rout


R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

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

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

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

> # The line you need to have R CMD check work,
> # and avoid some weird error I got from R CMD check.
> 
> Sys.setenv("R_TESTS" = "")
> 
> # The following commands model off of 
> # https://github.com/hadley/testthat
> 
> library(testthat)
> library(ASAFE)
> 
> test_check("ASAFE")
[1] "alleles_1 and ancestries_1 have been defined so that\n          n is an 18-long vector of 1's,\n          algorithm_1snp(alleles_1, ancestries_1) =\n          em(n = replicate(n = 18, expr = 1), epsilon = 10^-8, iteration_cap = 1000).\n          algorithm_1snp(alleles_1, ancestries_1) = "
[1] 0.5 0.5 0.5
[1] "alleles are: "
      rs1 rs2
 [1,]   0   0
 [2,]   0   0
 [3,]   0   0
 [4,]   0   0
 [5,]   0   0
 [6,]   0   0
 [7,]   0   0
 [8,]   0   0
 [9,]   0   0
[10,]   0   0
[11,]   0   0
[12,]   0   0
[13,]   0   0
[14,]   1   1
[15,]   0   0
[16,]   1   1
[17,]   0   0
[18,]   1   1
[19,]   0   0
[20,]   1   1
[21,]   0   0
[22,]   1   1
[23,]   0   0
[24,]   1   1
[25,]   1   1
[26,]   1   1
[27,]   1   1
[28,]   1   1
[29,]   1   1
[30,]   1   1
[31,]   1   1
[32,]   1   1
[33,]   1   1
[34,]   1   1
[35,]   1   1
[36,]   1   1
[1] "ancestries are: "
             [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
ancestries_1    0    0    0    1    0    2    1    1    1     2     2     2
ancestries_1    0    0    0    1    0    2    1    1    1     2     2     2
             [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23]
ancestries_1     0     0     0     1     0     2     1     1     1     2     2
ancestries_1     0     0     0     1     0     2     1     1     1     2     2
             [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34]
ancestries_1     2     0     0     0     1     0     2     1     1     1     2
ancestries_1     2     0     0     0     1     0     2     1     1     1     2
             [,35] [,36]
ancestries_1     2     2
ancestries_1     2     2
[1] "algorithm_1snp_wrapper(i = 1,\n                                  alleles = alleles,\n                                  ancestries = ancestries)"
[1] "rs1" "0.5" "0.5" "0.5"
[1] "algorithm_1snp_wrapper(i = 2,\n                                  alleles = alleles,\n                                  ancestries = ancestries)"
[1] "rs2" "0.5" "0.5" "0.5"
[1] "change_ancestry(anc = 0, error_rate = 1) should be 1 or 2"
[1] 1
[1] "change_ancestry(anc = 1, error_rate = 1) should be 0 or 2"
[1] 0
[1] "change_ancestry(anc = 2, error_rate = 1) should be 0 or 1"
[1] 0
[1] "draw_allele_given_anc(anc = 0, freqs = c(1, 0, 0)) should return 1"
[1] "draw_allele_given_anc(anc = 0, freqs = c(0, 0, 0)) should return 0"
[1] "draw_allele_given_anc(anc = 1, freqs = c(0, 1, 0)) should return 1"
[1] "draw_allele_given_anc(anc = 1, freqs = c(0, 0, 0)) should return 0"
[1] "draw_allele_given_anc(anc = 2, freqs = c(0, 0, 1)) should return 1"
[1] "draw_allele_given_anc(anc = 2, freqs = c(0, 0, 0)) should return 0"
[1] "draw_allele_given_anc(anc = 3, freqs = c(0, 0, 0)) should return error"
[1] "em(n = replicate(n = 18, expr = 1),\n       epsilon = 10^-8, iteration_cap = 1000) = "
[1] 0.5 0.5 0.5
[1] "The following should run: "
[1] "n_ind =  3"
[1] "n_markers =  2"
[1] "ancestries_matrix = "
     [,1] [,2]
[1,]    0    0
[2,]    0    0
[3,]    1    1
[4,]    1    1
[5,]    2    2
[6,]    2    2
[1] "get_errors_1_scenario(p0 = 1, p1 = 1, p2 = 1,\n                                                ancestries_matrix_true = ancestries_matrix,\n                                                ancestries_matrix_estimated = ancestries_matrix)"
       [,1]   [,2]
[1,] -3e-08 -3e-08
[2,] -3e-08 -3e-08
[3,] -3e-08 -3e-08
[1] "The following should run: "
[1] "n_ind =  3"
[1] "n_markers =  2"
[1] "ancestries_matrix = "
     [,1] [,2]
[1,]    0    0
[2,]    0    0
[3,]    1    1
[4,]    1    1
[5,]    2    2
[6,]    2    2
[1] "get_errors_1_scenario(p0 = 1, p1 = 1, p2 = 1,\n                                                ancestries_matrix_true = ancestries_matrix,\n                                                ancestries_matrix_estimated = ancestries_matrix)"
       [,1]   [,2]
[1,] -3e-08 -3e-08
[2,] -3e-08 -3e-08
[3,] -3e-08 -3e-08
[1] "get_errors_summary_stats_1_scenario(p0 = 1, p1 = 1, p2 = 1,\n                                        ancestries_matrix_true = ancestries_matrix,\n                                        ancestries_matrix_estimated = ancestries_matrix)\n          takes mean error over snp columns, and errors across snps should be identical,\n          so mean errors should be the same as a column from the output of\n          the get_errors_1_scenario() call"
     mean_errors sd_errors
[1,]      -3e-08         0
[2,]      -3e-08         0
[3,]      -3e-08         0
[1] "Constructing an example where I know what to expect\n          from this function."
[1] "Say estimates are: "
     rsid Freq1_Anc0 Freq1_Anc1 Freq1_Anc2
[1,]    1       0.15       0.15       0.15
[2,]    2       0.36       0.36       0.36
[3,]    3       0.57       0.57       0.57
[4,]    4       0.78       0.78       0.78
[5,]    5       0.99       0.99       0.99
[1] "Say truth is: "
     rsid Freq1_Anc0 Freq1_Anc1 Freq1_Anc2
[1,]    1        0.1        0.1        0.1
[2,]    2        0.3        0.3        0.3
[3,]    3        0.5        0.5        0.5
[4,]    4        0.7        0.7        0.7
[5,]    5        0.9        0.9        0.9
[1] "Constructing an example where I know what to expect\n          from this function."
[1] "Say estimates are: "
     rsid Freq1_Anc0 Freq1_Anc1 Freq1_Anc2
[1,]    1        0.1        0.1        0.1
[2,]    2        0.1        0.1        0.1
[3,]    3        0.1        0.1        0.1
[4,]    4        0.9        0.9        0.9
[5,]    5        0.9        0.9        0.9
[6,]    6        0.9        0.9        0.9
[1] "Say truth is: "
     rsid Freq1_Anc0 Freq1_Anc1 Freq1_Anc2
[1,]    1        0.2        0.2        0.2
[2,]    2        0.2        0.2        0.2
[3,]    3        0.5        0.5        0.5
[4,]    4        0.5        0.5        0.5
[5,]    5        0.8        0.8        0.8
[6,]    6        0.8        0.8        0.8
[1] "n_ind =  3"
[1] "n_markers =  2"
[1] "anc_spec_freqs = "
     [,1] [,2] [,3]
[1,]  1.0  1.0  1.0
[2,]  0.0  0.0  0.0
[3,]  0.5  0.5  0.5
[1] "ancestries_matrix = "
     [,1] [,2]
[1,]    0    0
[2,]    0    0
[3,]    1    1
[4,]    1    1
[5,]    2    2
[6,]    2    2
[1] "get_results_error(error_rate = 0,\n           anc_spec_freqs, ancestries_matrix_true) = "
                    p0  p1  p2     Mean          SD
Abs_Error_Afr_Freq 1.0 1.0 1.0 -3.0e-08 0.00000e+00
Abs_Error_Eur_Freq 1.0 1.0 1.0 -3.0e-08 0.00000e+00
Abs_Error_NA_Freq  1.0 1.0 1.0 -3.0e-08 0.00000e+00
Abs_Error_Afr_Freq 0.0 0.0 0.0  3.0e-08 0.00000e+00
Abs_Error_Eur_Freq 0.0 0.0 0.0  3.0e-08 0.00000e+00
Abs_Error_NA_Freq  0.0 0.0 0.0  3.0e-08 0.00000e+00
Abs_Error_Afr_Freq 0.5 0.5 0.5  0.0e+00 0.00000e+00
Abs_Error_Eur_Freq 0.5 0.5 0.5 -1.5e-08 2.12132e-08
Abs_Error_NA_Freq  0.5 0.5 0.5  1.5e-08 2.12132e-08
[1] "get_results_error(error_rate = 1,\n           anc_spec_freqs, ancestries_matrix_true) = "
                    p0  p1  p2         Mean           SD
Abs_Error_Afr_Freq 1.0 1.0 1.0 -0.000000025 7.071067e-09
Abs_Error_Eur_Freq 1.0 1.0 1.0 -0.250000015 3.535534e-01
Abs_Error_NA_Freq  1.0 1.0 1.0 -0.000000025 7.071067e-09
Abs_Error_Afr_Freq 0.0 0.0 0.0  0.000000025 7.071067e-09
Abs_Error_Eur_Freq 0.0 0.0 0.0  0.250000015 3.535534e-01
Abs_Error_NA_Freq  0.0 0.0 0.0  0.000000025 7.071067e-09
Abs_Error_Afr_Freq 0.5 0.5 0.5  0.416666652 1.178511e-01
Abs_Error_Eur_Freq 0.5 0.5 0.5 -0.250000015 3.535534e-01
Abs_Error_NA_Freq  0.5 0.5 0.5 -0.083333333 5.892557e-01
[1] "anc_spec_freqs = "
     [,1] [,2] [,3]
[1,]  1.0  1.0  1.0
[2,]  0.0  0.0  0.0
[3,]  0.5  0.5  0.5
[1] "ancestries_matrix = "
     [,1] [,2]
[1,]    0    0
[2,]    0    0
[3,]    1    1
[4,]    1    1
[5,]    2    2
[6,]    2    2
[1] "get_scenario_errors(row = 1, anc_spec_freqs = anc_spec_freqs,\n                        ancestries_matrix_true = ancestries_matrix,\n                        ancestries_matrix_estimated = ancestries_matrix)"
     p0 p1 p2 mean_errors sd_errors
[1,]  1  1  1      -3e-08         0
[2,]  1  1  1      -3e-08         0
[3,]  1  1  1      -3e-08         0
[1] "get_scenario_errors(row = 2, anc_spec_freqs = anc_spec_freqs,\n                        ancestries_matrix_true = ancestries_matrix,\n                        ancestries_matrix_estimated = ancestries_matrix)"
     p0 p1 p2 mean_errors sd_errors
[1,]  0  0  0       3e-08         0
[2,]  0  0  0       3e-08         0
[3,]  0  0  0       3e-08         0
[1] "get_scenario_errors(row = 3, anc_spec_freqs = anc_spec_freqs,\n                        ancestries_matrix_true = ancestries_matrix,\n                        ancestries_matrix_estimated = ancestries_matrix)"
      p0  p1  p2 mean_errors   sd_errors
[1,] 0.5 0.5 0.5     1.5e-08 2.12132e-08
[2,] 0.5 0.5 0.5    -1.5e-08 2.12132e-08
[3,] 0.5 0.5 0.5     0.0e+00 0.00000e+00
[1] "get_true_freqs_1snp(alleles_1 = c(0, 0, 1, 0, 1, 1),\n           ancestries_1 = c(0, 1, 0, 2, 1, 2))\n           should return [0.5, 0.5, 0.5]"
[1] "sample_ancestry(0) = Should be something other than 0"
[1] 2
[1] "sample_ancestry(1) = Should be something other than 1"
[1] 0
[1] "sample_ancestry(2) = Should be something other than 2"
[1] 1
== testthat results  ===========================================================
[ OK: 63 | SKIPPED: 5 | WARNINGS: 0 | FAILED: 0 ]
> 
> # Note that in the directory tests/testthat,
> # there's 1 test file per function. I like that format,
> # because I don't have to scroll through a long file.
> # Hadley does the same thing here: 
> # https://github.com/hadley/testthat/tree/master/tests/testthat.
> 
> proc.time()
   user  system elapsed 
   0.81    0.03    0.95 

ASAFE.Rcheck/tests_x64/testthat.Rout


R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

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

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

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

> # The line you need to have R CMD check work,
> # and avoid some weird error I got from R CMD check.
> 
> Sys.setenv("R_TESTS" = "")
> 
> # The following commands model off of 
> # https://github.com/hadley/testthat
> 
> library(testthat)
> library(ASAFE)
> 
> test_check("ASAFE")
[1] "alleles_1 and ancestries_1 have been defined so that\n          n is an 18-long vector of 1's,\n          algorithm_1snp(alleles_1, ancestries_1) =\n          em(n = replicate(n = 18, expr = 1), epsilon = 10^-8, iteration_cap = 1000).\n          algorithm_1snp(alleles_1, ancestries_1) = "
[1] 0.5 0.5 0.5
[1] "alleles are: "
      rs1 rs2
 [1,]   0   0
 [2,]   0   0
 [3,]   0   0
 [4,]   0   0
 [5,]   0   0
 [6,]   0   0
 [7,]   0   0
 [8,]   0   0
 [9,]   0   0
[10,]   0   0
[11,]   0   0
[12,]   0   0
[13,]   0   0
[14,]   1   1
[15,]   0   0
[16,]   1   1
[17,]   0   0
[18,]   1   1
[19,]   0   0
[20,]   1   1
[21,]   0   0
[22,]   1   1
[23,]   0   0
[24,]   1   1
[25,]   1   1
[26,]   1   1
[27,]   1   1
[28,]   1   1
[29,]   1   1
[30,]   1   1
[31,]   1   1
[32,]   1   1
[33,]   1   1
[34,]   1   1
[35,]   1   1
[36,]   1   1
[1] "ancestries are: "
             [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
ancestries_1    0    0    0    1    0    2    1    1    1     2     2     2
ancestries_1    0    0    0    1    0    2    1    1    1     2     2     2
             [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23]
ancestries_1     0     0     0     1     0     2     1     1     1     2     2
ancestries_1     0     0     0     1     0     2     1     1     1     2     2
             [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34]
ancestries_1     2     0     0     0     1     0     2     1     1     1     2
ancestries_1     2     0     0     0     1     0     2     1     1     1     2
             [,35] [,36]
ancestries_1     2     2
ancestries_1     2     2
[1] "algorithm_1snp_wrapper(i = 1,\n                                  alleles = alleles,\n                                  ancestries = ancestries)"
[1] "rs1" "0.5" "0.5" "0.5"
[1] "algorithm_1snp_wrapper(i = 2,\n                                  alleles = alleles,\n                                  ancestries = ancestries)"
[1] "rs2" "0.5" "0.5" "0.5"
[1] "change_ancestry(anc = 0, error_rate = 1) should be 1 or 2"
[1] 2
[1] "change_ancestry(anc = 1, error_rate = 1) should be 0 or 2"
[1] 0
[1] "change_ancestry(anc = 2, error_rate = 1) should be 0 or 1"
[1] 0
[1] "draw_allele_given_anc(anc = 0, freqs = c(1, 0, 0)) should return 1"
[1] "draw_allele_given_anc(anc = 0, freqs = c(0, 0, 0)) should return 0"
[1] "draw_allele_given_anc(anc = 1, freqs = c(0, 1, 0)) should return 1"
[1] "draw_allele_given_anc(anc = 1, freqs = c(0, 0, 0)) should return 0"
[1] "draw_allele_given_anc(anc = 2, freqs = c(0, 0, 1)) should return 1"
[1] "draw_allele_given_anc(anc = 2, freqs = c(0, 0, 0)) should return 0"
[1] "draw_allele_given_anc(anc = 3, freqs = c(0, 0, 0)) should return error"
[1] "em(n = replicate(n = 18, expr = 1),\n       epsilon = 10^-8, iteration_cap = 1000) = "
[1] 0.5 0.5 0.5
[1] "The following should run: "
[1] "n_ind =  3"
[1] "n_markers =  2"
[1] "ancestries_matrix = "
     [,1] [,2]
[1,]    0    0
[2,]    0    0
[3,]    1    1
[4,]    1    1
[5,]    2    2
[6,]    2    2
[1] "get_errors_1_scenario(p0 = 1, p1 = 1, p2 = 1,\n                                                ancestries_matrix_true = ancestries_matrix,\n                                                ancestries_matrix_estimated = ancestries_matrix)"
       [,1]   [,2]
[1,] -3e-08 -3e-08
[2,] -3e-08 -3e-08
[3,] -3e-08 -3e-08
[1] "The following should run: "
[1] "n_ind =  3"
[1] "n_markers =  2"
[1] "ancestries_matrix = "
     [,1] [,2]
[1,]    0    0
[2,]    0    0
[3,]    1    1
[4,]    1    1
[5,]    2    2
[6,]    2    2
[1] "get_errors_1_scenario(p0 = 1, p1 = 1, p2 = 1,\n                                                ancestries_matrix_true = ancestries_matrix,\n                                                ancestries_matrix_estimated = ancestries_matrix)"
       [,1]   [,2]
[1,] -3e-08 -3e-08
[2,] -3e-08 -3e-08
[3,] -3e-08 -3e-08
[1] "get_errors_summary_stats_1_scenario(p0 = 1, p1 = 1, p2 = 1,\n                                        ancestries_matrix_true = ancestries_matrix,\n                                        ancestries_matrix_estimated = ancestries_matrix)\n          takes mean error over snp columns, and errors across snps should be identical,\n          so mean errors should be the same as a column from the output of\n          the get_errors_1_scenario() call"
     mean_errors sd_errors
[1,]      -3e-08         0
[2,]      -3e-08         0
[3,]      -3e-08         0
[1] "Constructing an example where I know what to expect\n          from this function."
[1] "Say estimates are: "
     rsid Freq1_Anc0 Freq1_Anc1 Freq1_Anc2
[1,]    1       0.15       0.15       0.15
[2,]    2       0.36       0.36       0.36
[3,]    3       0.57       0.57       0.57
[4,]    4       0.78       0.78       0.78
[5,]    5       0.99       0.99       0.99
[1] "Say truth is: "
     rsid Freq1_Anc0 Freq1_Anc1 Freq1_Anc2
[1,]    1        0.1        0.1        0.1
[2,]    2        0.3        0.3        0.3
[3,]    3        0.5        0.5        0.5
[4,]    4        0.7        0.7        0.7
[5,]    5        0.9        0.9        0.9
[1] "Constructing an example where I know what to expect\n          from this function."
[1] "Say estimates are: "
     rsid Freq1_Anc0 Freq1_Anc1 Freq1_Anc2
[1,]    1        0.1        0.1        0.1
[2,]    2        0.1        0.1        0.1
[3,]    3        0.1        0.1        0.1
[4,]    4        0.9        0.9        0.9
[5,]    5        0.9        0.9        0.9
[6,]    6        0.9        0.9        0.9
[1] "Say truth is: "
     rsid Freq1_Anc0 Freq1_Anc1 Freq1_Anc2
[1,]    1        0.2        0.2        0.2
[2,]    2        0.2        0.2        0.2
[3,]    3        0.5        0.5        0.5
[4,]    4        0.5        0.5        0.5
[5,]    5        0.8        0.8        0.8
[6,]    6        0.8        0.8        0.8
[1] "n_ind =  3"
[1] "n_markers =  2"
[1] "anc_spec_freqs = "
     [,1] [,2] [,3]
[1,]  1.0  1.0  1.0
[2,]  0.0  0.0  0.0
[3,]  0.5  0.5  0.5
[1] "ancestries_matrix = "
     [,1] [,2]
[1,]    0    0
[2,]    0    0
[3,]    1    1
[4,]    1    1
[5,]    2    2
[6,]    2    2
[1] "get_results_error(error_rate = 0,\n           anc_spec_freqs, ancestries_matrix_true) = "
                    p0  p1  p2     Mean          SD
Abs_Error_Afr_Freq 1.0 1.0 1.0 -3.0e-08 0.00000e+00
Abs_Error_Eur_Freq 1.0 1.0 1.0 -3.0e-08 0.00000e+00
Abs_Error_NA_Freq  1.0 1.0 1.0 -3.0e-08 0.00000e+00
Abs_Error_Afr_Freq 0.0 0.0 0.0  3.0e-08 0.00000e+00
Abs_Error_Eur_Freq 0.0 0.0 0.0  3.0e-08 0.00000e+00
Abs_Error_NA_Freq  0.0 0.0 0.0  3.0e-08 0.00000e+00
Abs_Error_Afr_Freq 0.5 0.5 0.5 -1.5e-08 2.12132e-08
Abs_Error_Eur_Freq 0.5 0.5 0.5 -3.0e-08 0.00000e+00
Abs_Error_NA_Freq  0.5 0.5 0.5  0.0e+00 0.00000e+00
[1] "get_results_error(error_rate = 1,\n           anc_spec_freqs, ancestries_matrix_true) = "
                    p0  p1  p2          Mean           SD
Abs_Error_Afr_Freq 1.0 1.0 1.0 -0.0000000225 1.060660e-08
Abs_Error_Eur_Freq 1.0 1.0 1.0 -0.0000000450 2.121320e-08
Abs_Error_NA_Freq  1.0 1.0 1.0 -0.2500000100 3.535534e-01
Abs_Error_Afr_Freq 0.0 0.0 0.0  0.0000000225 1.060660e-08
Abs_Error_Eur_Freq 0.0 0.0 0.0  0.0000000450 2.121320e-08
Abs_Error_NA_Freq  0.0 0.0 0.0  0.2500000100 3.535534e-01
Abs_Error_Afr_Freq 0.5 0.5 0.5 -0.3750000150 5.303301e-01
Abs_Error_Eur_Freq 0.5 0.5 0.5  0.7499999550 3.535534e-01
Abs_Error_NA_Freq  0.5 0.5 0.5 -0.1666666667 2.357023e-01
[1] "anc_spec_freqs = "
     [,1] [,2] [,3]
[1,]  1.0  1.0  1.0
[2,]  0.0  0.0  0.0
[3,]  0.5  0.5  0.5
[1] "ancestries_matrix = "
     [,1] [,2]
[1,]    0    0
[2,]    0    0
[3,]    1    1
[4,]    1    1
[5,]    2    2
[6,]    2    2
[1] "get_scenario_errors(row = 1, anc_spec_freqs = anc_spec_freqs,\n                        ancestries_matrix_true = ancestries_matrix,\n                        ancestries_matrix_estimated = ancestries_matrix)"
     p0 p1 p2 mean_errors sd_errors
[1,]  1  1  1      -3e-08         0
[2,]  1  1  1      -3e-08         0
[3,]  1  1  1      -3e-08         0
[1] "get_scenario_errors(row = 2, anc_spec_freqs = anc_spec_freqs,\n                        ancestries_matrix_true = ancestries_matrix,\n                        ancestries_matrix_estimated = ancestries_matrix)"
     p0 p1 p2 mean_errors sd_errors
[1,]  0  0  0       3e-08         0
[2,]  0  0  0       3e-08         0
[3,]  0  0  0       3e-08         0
[1] "get_scenario_errors(row = 3, anc_spec_freqs = anc_spec_freqs,\n                        ancestries_matrix_true = ancestries_matrix,\n                        ancestries_matrix_estimated = ancestries_matrix)"
      p0  p1  p2 mean_errors   sd_errors
[1,] 0.5 0.5 0.5    -1.5e-08 2.12132e-08
[2,] 0.5 0.5 0.5     0.0e+00 0.00000e+00
[3,] 0.5 0.5 0.5     0.0e+00 0.00000e+00
[1] "get_true_freqs_1snp(alleles_1 = c(0, 0, 1, 0, 1, 1),\n           ancestries_1 = c(0, 1, 0, 2, 1, 2))\n           should return [0.5, 0.5, 0.5]"
[1] "sample_ancestry(0) = Should be something other than 0"
[1] 1
[1] "sample_ancestry(1) = Should be something other than 1"
[1] 2
[1] "sample_ancestry(2) = Should be something other than 2"
[1] 1
== testthat results  ===========================================================
[ OK: 63 | SKIPPED: 5 | WARNINGS: 0 | FAILED: 0 ]
> 
> # Note that in the directory tests/testthat,
> # there's 1 test file per function. I like that format,
> # because I don't have to scroll through a long file.
> # Hadley does the same thing here: 
> # https://github.com/hadley/testthat/tree/master/tests/testthat.
> 
> proc.time()
   user  system elapsed 
   0.45    0.09    0.53 

Example timings

ASAFE.Rcheck/examples_i386/ASAFE-Ex.timings

nameusersystemelapsed
algorithm_1snp0.070.010.08
algorithm_1snp_wrapper0.170.000.17

ASAFE.Rcheck/examples_x64/ASAFE-Ex.timings

nameusersystemelapsed
algorithm_1snp0.090.000.09
algorithm_1snp_wrapper0.220.000.22