Running 'testthat.R' [4s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(Lahman)
  > library(DBI)
  > library(poplite)
  Loading required package: dplyr
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  
  Attaching package: 'poplite'
  
  The following object is masked from 'package:dplyr':
  
      select
  
  The following object is masked from 'package:stats':
  
      filter
  
  > 
  > test.db.1 <- function()
  + {
  +     samples <- data.frame(sample_id=as.integer(sapply(1:100, function(x) rep(x,2))), wave=as.integer(sapply(1:100, function(x) 1:2)), did_collect=sample(c("Y", "N"), size=100, replace=T))
  +     
  +     dna <- samples[samples$did_collect == "Y",c("sample_id", "wave")]
  +     dna$lab_id <- paste("dna", paste(dna$sample_id, dna$wave, sep="_"), sep="_")
  +     dna$lab_id[sample.int(nrow(dna), size=10)] <- NA
  +     dna$ng.ul <- abs(rnorm(n=nrow(dna), mean=146, sd=98))
  +     dna$ng.ul[is.na(dna$lab_id)] <- NA
  +         
  +     clinical <- data.frame(sample_id=1:100, sex=sample(c("M", "F"), size=100, replace=T), age=sample(1:20, 100, replace=T), status=sample(c(0L,1L), size=100, replace=T), var_wave_1=rnorm(n=100), var_wave_2=rnorm(n=100))
  +     clinical <- clinical[-sample.int(nrow(clinical), 12),]
  +     
  +     return(list(samples=samples, dna=dna, clinical=clinical))
  + }
  > 
  > test.db.2 <- eval(structure(list(allele = structure(list(allele_id = 1:10, alleles = c(".", 
  + "G", "A", ".", "A", "T", ".", "C", "A", "."), allele_num = c(-1L, 
  + 0L, 1L, -1L, 0L, 1L, -1L, 0L, 1L, -1L), ref_id = c(1L, 1L, 1L, 
  + 2L, 2L, 2L, 3L, 3L, 3L, 4L)), .Names = c("allele_id", "alleles", 
  + "allele_num", "ref_id"), row.names = c(NA, -10L), class = "data.frame"), 
  +     genotype = structure(list(geno_id = c(1L, 2L, 3L, 4L, 5L, 
  +     6L, 7L, 8L, 9L, 11L), geno_chr = c(1L, 1L, 1L, 1L, 1L, 1L, 
  +     1L, 1L, 1L, 1L), allele_num = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
  +     1L, 1L, 1L), strain = c("NODShiLtJ", "NODShiLtJ", "NODShiLtJ", 
  +     "NODShiLtJ", "NODShiLtJ", "NODShiLtJ", "NODShiLtJ", "NODShiLtJ", 
  +     "NODShiLtJ", "NODShiLtJ"), ref_id = c(1L, 2L, 3L, 4L, 5L, 
  +     6L, 7L, 8L, 9L, 11L)), .Names = c("geno_id", "geno_chr", 
  +     "allele_num", "strain", "ref_id"), row.names = c(NA, -10L
  +     ), class = "data.frame"), probe_align = structure(list(probe_align_id = 1:10, 
  +         probe_chr = c("1", "1", "1", "1", "1", "1", "1", "1", 
  +         "1", "1"), probe_start = c(3214633L, 3214895L, 3215576L, 
  +         3216284L, 3216483L, 3216537L, 3216591L, 3421710L, 3421740L, 
  +         3421808L), probe_end = c(3214657L, 3214919L, 3215600L, 
  +         3216308L, 3216507L, 3216561L, 3216615L, 3421734L, 3421764L, 
  +         3421832L), probe_ind = 23944:23953), .Names = c("probe_align_id", 
  +     "probe_chr", "probe_start", "probe_end", "probe_ind"), row.names = c(NA, 
  +     -10L), class = "data.frame"), probe_info = structure(list(
  +         probe_ind = 1:10, fasta_name = c("chr1:3044331-3044355;+;GGGCTCAAATTCACCTGTGTTAACT", 
  +         "chr1:3044334-3044358;+;AGGGGGCTCAAATTCACCTGTGTTA", "chr1:3044335-3044359;+;GAGGGGGCTCAAATTCACCTGTGTT", 
  +         "chr1:3044336-3044360;+;GGAGGGGGCTCAAATTCACCTGTGT", "chr1:3044337-3044361;+;GGGAGGGGGCTCAAATTCACCTGTG", 
  +         "chr1:3044504-3044528;+;AAGGCTTGGGCTATGCGCTCTCCAG", "chr1:3044557-3044581;+;AAGGTCCTCGCTCCTCTTTCATATA", 
  +         "chr1:3044558-3044582;+;GAAGGTCCTCGCTCCTCTTTCATAT", "chr1:3044559-3044583;+;GGAAGGTCCTCGCTCCTCTTTCATA", 
  +         "chr1:3044560-3044584;+;AGGAAGGTCCTCGCTCCTCTTTCAT"), 
  +         probe_id = c(271822L, 866088L, 240008L, 34772L, 396933L, 
  +         613322L, 984143L, 826914L, 1075207L, 160847L), align_status = c("MultiMapped", 
  +         "MultiMapped", "MultiMapped", "MultiMapped", "MultiMapped", 
  +         "MultiMapped", "MultiMapped", "MultiMapped", "MultiMapped", 
  +         "MultiMapped")), .Names = c("probe_ind", "fasta_name", 
  +     "probe_id", "align_status"), row.names = c(NA, -10L), class = "data.frame"), 
  +     probe_to_snp = structure(list(probe_snp_id = 1:10, ref_id = c(1L, 
  +     2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 9L), probe_align_id = c(137L, 
  +     137L, 252L, 263L, 561L, 601L, 606L, 622L, 635L, 636L)), .Names = c("probe_snp_id", 
  +     "ref_id", "probe_align_id"), row.names = c(NA, -10L), class = "data.frame"), 
  +     reference = structure(list(ref_id = c(1L, 2L, 3L, 4L, 5L, 
  +     6L, 7L, 8L, 9L, 11L), seqnames = c("1", "1", "1", "1", "1", 
  +     "1", "1", "1", "1", "1"), start = c(4785683L, 4785703L, 8595537L, 
  +     8682000L, 10719780L, 12990759L, 13114284L, 13122474L, 13125617L, 
  +     13150850L), end = c(4785683L, 4785703L, 8595537L, 8682000L, 
  +     10719780L, 12990759L, 13114284L, 13122474L, 13125617L, 13150850L
  +     ), filter = c("TRUE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", 
  +     "TRUE", "TRUE", "TRUE", "TRUE"), vcf_annot_id = c(1L, 1L, 
  +     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L)), .Names = c("ref_id", "seqnames", 
  +     "start", "end", "filter", "vcf_annot_id"), row.names = c(NA, 
  +     -10L), class = "data.frame"), vcf_annot = structure(list(
  +         vcf_annot_id = 1L, vcf_name = "/Users/bottomly/Desktop/resources/vcfs/mgp.v3.snps.rsIDdbSNPv137.vcf.gz", 
  +         type = "SNV"), .Names = c("vcf_annot_id", "vcf_name", 
  +     "type"), row.names = c(NA, -1L), class = "data.frame")), .Names = c("allele", 
  + "genotype", "probe_align", "probe_info", "probe_to_snp", "reference", 
  + "vcf_annot")))
  > 
  > test.schema.2 <- list(probe_info=list(db.cols=c("probe_ind", "fasta_name", "probe_id", "align_status"),
  +                                 db.schema=c("INTEGER PRIMARY KEY AUTOINCREMENT", "TEXT", "INTEGER", "TEXT"),
  +                                 db.constr="CONSTRAINT probe_idx UNIQUE (fasta_name)",
  +                                 dta.func=function(x) x, should.ignore=FALSE, foreign.keys=NULL),
  +                 probe_align=list(db.cols=c("probe_align_id", "probe_chr", "probe_start", "probe_end", "probe_ind"),
  +                                 db.schema=c("INTEGER PRIMARY KEY AUTOINCREMENT", "TEXT", "INTEGER", "INTEGER", "INTEGER"),
  +                                 db.constr="CONSTRAINT geno_idx UNIQUE (probe_chr, probe_start, probe_end, probe_ind)",
  +                                 dta.func=function(x) x, should.ignore=FALSE, foreign.keys=list(probe_info=list(local.keys="probe_ind", ext.keys="fasta_name"))),
  +                 vcf_annot=list(db.cols=c("vcf_annot_id", "vcf_name", "type"),
  +                                db.schema=c("INTEGER PRIMARY KEY AUTOINCREMENT", "TEXT", "TEXT"),
  +                                db.constr="CONSTRAINT probe_idx UNIQUE (vcf_name, type)",
  +                                dta.func=function(x) x,
  +                                should.ignore=TRUE, foreign.keys=NULL),
  +                 reference=list(db.cols=c("ref_id", "seqnames", "start", "end", "filter", "vcf_annot_id"),
  +                                db.schema=c("INTEGER PRIMARY KEY AUTOINCREMENT", "TEXT", "INTEGER", "INTEGER", "TEXT", "INTEGER"),
  +                                db.constr="CONSTRAINT ref_idx UNIQUE (seqnames, start, end, vcf_annot_id)",
  +                                dta.func=function(x) x, should.ignore=TRUE, foreign.keys=list(vcf_annot=list(local.keys="vcf_annot_id", ext.keys=c("vcf_name", "type")))),
  +                 allele=list(db.cols=c("allele_id", "alleles", "allele_num", "ref_id"),
  +                             db.schema=c("INTEGER PRIMARY KEY AUTOINCREMENT", "TEXT", "INTEGER", "INTEGER"),
  +                             db.constr="CONSTRAINT alelle_idx UNIQUE (alleles, allele_num, ref_id)",
  +                             dta.func=function(x) x, should.ignore=TRUE, foreign.keys=list(vcf_annot=list(local.keys="vcf_annot_id", ext.keys=c("vcf_name", "type")),
  +                                                                                             reference=list(local.keys="ref_id", ext.keys=c("seqnames", "start", "end", "vcf_annot_id")))),
  +                 genotype=list(db.cols=c("geno_id", "geno_chr", "allele_num","strain", "ref_id"),
  +                               db.schema=c("INTEGER PRIMARY KEY AUTOINCREMENT", "INTEGER", "INTEGER", "TEXT", "INTEGER"),
  +                               db.constr="CONSTRAINT geno_idx UNIQUE (ref_id, strain, geno_chr, allele_num)",
  +                               dta.func=function(x) x, should.ignore=TRUE, foreign.keys=list(vcf_annot=list(local.keys="vcf_annot_id", ext.keys=c("vcf_name", "type")),
  +                                                                                                 reference=list(local.keys="ref_id", ext.keys=c("seqnames", "start", "end", "vcf_annot_id")))),
  +                 probe_to_snp=list(db.cols=c("probe_snp_id", "ref_id", "probe_align_id"),
  +                                   db.schema=c("INTEGER PRIMARY KEY AUTOINCREMENT", "INTEGER", "INTEGER"),
  +                                   db.constr="CONSTRAINT p_s_idx UNIQUE (ref_id, probe_align_id)",
  +                                   dta.func=function(x) x, should.ignore=TRUE, foreign.keys=list(vcf_annot=list(local.keys="vcf_annot_id", ext.keys=c("vcf_name", "type")),
  +                                                                                                     reference=list(local.keys="ref_id", ext.keys=c("seqnames", "start", "end", "vcf_annot_id")),
  +                                                                                                     probe_align=list(local.keys="probe_align_id", ext.keys=c("probe_chr", "probe_start", "probe_end")))))
  > 
  > 
  > 
  > 
  > 
  > test_dir("testthat")
  v | OK F W S | Context
  
  - |  1       | 0
  \ |  2       | 0
  | |  3       | 0
  / |  4       | 0
  - |  5       | 0
  \ |  6       | 0
  | |  7       | 0
  / |  8       | 0
  - |  9       | 0
  \ | 10       | 0
  | | 11       | 0
  / | 12       | 0
  - | 13       | 0
  \ | 14       | 0
  | | 15       | 0
  / | 16       | 0
  - | 17       | 0
  \ | 18       | 0
  | | 19       | 0
  / | 20       | 0
  - | 21       | 0
  \ | 22       | 0
  | | 23       | 0
  / | 24       | 0
  - | 25       | 0
  \ | 26       | 0
  | | 27       | 0
  / | 28       | 0
  - | 29       | 0
  \ | 30       | 0
  | | 31       | 0
  / | 32       | 0
  - | 33       | 0
  \ | 34       | 0
  | | 35       | 0
  / | 36       | 0
  - | 37       | 0
  \ | 38       | 0
  | | 39       | 0
  / | 40       | 0
  - | 41       | 0
  \ | 42       | 0
  | | 43       | 0
  / | 44       | 0
  - | 45       | 0
  \ | 46       | 0
  | | 47       | 0
  / | 48       | 0
  - | 49       | 0
  \ | 50       | 0
  | | 51       | 0
  / | 52       | 0
  - | 53       | 0
  \ | 54       | 0
  | | 55       | 0
  / | 56       | 0
  - | 57       | 0
  \ | 58       | 0
  | | 59       | 0
  / | 60       | 0
  - | 61       | 0
  \ | 62       | 0
  | | 63       | 0
  / | 64       | 0
  - | 65       | 0
  \ | 66       | 0
  | | 67       | 0
  / | 68       | 0
  - | 69       | 0
  \ | 70       | 0
  | | 71       | 0
  / | 72       | 0
  - | 73       | 0
  \ | 74       | 0
  | | 75       | 0
  / | 76       | 0
  - | 77       | 0
  \ | 78       | 0
  | | 79       | 0
  / | 80       | 0[1] "clinical"
  [1] "normal"
  
  - | 81       | 0
  \ | 82       | 0[1] "merge"
  
  | | 83       | 0[1] "dna"
  [1] "normal"
  
  / | 84       | 0
  - | 85       | 0[1] "merge"
  
  \ | 86       | 0[1] "samples"
  [1] "normal"
  
  | | 87       | 0
  / | 88       | 0[1] "merge"
  
  - | 89       | 0
  \ | 90       | 0[1] "clinical"
  [1] "normal"
  
  | | 91       | 0
  / | 92       | 0[1] "merge"
  
  - | 93       | 0[1] "dna"
  [1] "normal"
  
  \ | 94       | 0
  | | 95       | 0[1] "merge"
  
  / | 96       | 0[1] "samples"
  [1] "normal"
  
  - | 97       | 0
  \ | 98       | 0[1] "merge"
  
  | | 99       | 0
  / | 100       | 0[1] "clinical"
  
  - | 101       | 0[1] "dna"
  
  \ | 102       | 0
  | | 103       | 0
  / | 104       | 0
  - | 105       | 0[1] "samples"
  
  \ | 106       | 0
  | | 107       | 0
  / | 108       | 0
  - | 109       | 0
  \ | 110       | 0
  | | 111       | 0
  / | 112       | 0
  - | 113       | 0
  \ | 114       | 0
  | | 115       | 0
  / | 116       | 0
  - | 117       | 0
  \ | 118       | 0
  | | 119       | 0
  / | 120       | 0
  - | 121       | 0
  \ | 122       | 0Error in x[[method]](...) : attempt to apply non-function
  Calls: test_dir ... <Anonymous> -> o_apply -> lapply -> FUN -> <Anonymous>
  In addition: Warning message:
  call dbDisconnect() when finished working with a connection 
  
  == Results =====================================================================
  Duration: 2.2 s
  
  OK:       122
  Failed:   4
  Warnings: 1
  Skipped:  0
  Execution halted