Author: Andreas Tille <tille@debian.org>
Last-Update: Wed, 26 Oct 2016 14:19:04 +0200
Description: One of the needed databases is just packaged
 so try at least testing this one while excluding all other
 databases.

--- a/inst/unitTests/test_select.R
+++ b/inst/unitTests/test_select.R
@@ -11,19 +11,8 @@
 
 ##  library(AnnotationDbi);AnnotationDbi:::.test()
 require(RSQLite)
-require(org.Hs.eg.db)
-require(org.At.tair.db)
-require(org.Sc.sgd.db)
 require(GO.db)
-require(hgu95av2.db)
 require("RUnit")
-x <- org.Hs.eg.db
-t <- org.At.tair.db
-s <- org.Sc.sgd.db
-cols <- c("CHR","PFAM","GO")
-keys <- c(1,10)
-jointype <- "genes.gene_id" ## changed from 'gene_id'
-quiet <- suppressWarnings # quieten warnings from 1:many mappings in select()
 
 ## resort and friends are really important as they are generic enough to
 ## be reused elsewhere.
@@ -68,138 +57,9 @@ test_dropUnwantedRows <- function() {
     checkIdentical(tab, fun(tab, keys1, "x"))
 }
 
-test_resort <- function() {
-    fun <- resort_base ## from AnnotationDbi
-
-    ## repeat keys returned
-    keys <- letters[1:5]
-    tab <- data.frame(x=keys, y=LETTERS[1:5], z=LETTERS[5:1],
-                      row.names=NULL, stringsAsFactors=FALSE)
-    keys1 <- keys[c(1:5, 1)]
-    tab1 <- tab[c(1:5, 1),]
-    rownames(tab1) <- NULL
-    checkIdentical(tab1, fun(tab, keys1, "x", names(tab)))
-
-    ## keys with missing values returned
-    tab1 <- tab
-    tab1[3, 2:3] <- NA
-    keys1 <- tab1[["x"]]
-    checkIdentical(tab1, fun(tab1, keys, "x", names(tab)))
-
-    ## multiple keys with missing values returned
-    tab1 <- tab[c(3,4,3,4),]
-    tab1[c(1,3), 2:3] <- NA
-    keys1 <- keys[c(3,4,3,4)] 
-    rownames(tab1) <- NULL
-    checkIdentical(tab1, fun(tab1[1:2,], keys1, "x", names(tab)))
-
-    cols <- c("CHR","SYMBOL", "PFAM")
-    keys <- c(1,10)
-    res <- AnnotationDbi:::.extractData(x, cols, keytype="ENTREZID", keys)
-    ## jumble res to simulate trouble
-    resRO = res[order(sort(res$genes.gene_id,decreasing=TRUE)),]
-    reqCols <- c("genes.gene_id","chromosomes.chromosome","gene_info.symbol",
-                 "pfam.pfam_id")
-    Rres <- fun(resRO, keys, jointype, reqCols)
-    checkIdentical(Rres$gene_id,Rres$gene_id)
-    checkTrue(class(Rres) =="data.frame")
-
-    ## now what if we have MORE keys?
-    keys <- c(1, keys, keys)
-    cols <- c("CHR","SYMBOL")
-    res <- AnnotationDbi:::.extractData(x, cols, keytype="ENTREZID", keys)
-    reqCols <- c("genes.gene_id","chromosomes.chromosome","gene_info.symbol")
-    res2 <- fun(res, keys, jointype, reqCols)
-    checkIdentical(as.numeric(as.character(res2$genes.gene_id)),keys)
-    checkTrue(class(res) =="data.frame")
-}
-
-test_keytypes <- function(){
-  checkTrue("ENTREZID" %in% keytypes(x))
-  checkTrue("TAIR" %in% keytypes(t))
-  checkTrue("ENTREZID" %in% keytypes(t))
-  checkTrue("ORF" %in% keytypes(s))  
-  checkTrue("ENTREZID" %in% keytypes(s))  
-}
-
-test_keys <- function(){
-  checkException(keys(org.Hs.eg.db, keytype="PROBEID"))
-  
-  egHskeys <- as.numeric(head(keys(x)))
-  checkTrue(length(egHskeys[!is.na(egHskeys)])==6)
-  rsHskeys <- head(keys(x, "REFSEQ"))
-  checkTrue(any(grepl("N", rsHskeys)))
-  
-  egAtkeys <- as.numeric(head(keys(t,"ENTREZID")))
-  checkTrue(length(egAtkeys[!is.na(egAtkeys)])==6)
-  rsAtkeys <- head(keys(t, "REFSEQ"))
-  checkTrue(any(grepl("N", rsAtkeys)))
-  tairAtkeys <- head(keys(t, "TAIR"))
-  checkTrue(any(grepl("AT", tairAtkeys)))
-
-  egSckeys <- as.numeric(head(keys(s, "ENTREZID")))
-  checkTrue(length(egSckeys[!is.na(egSckeys)])==6)
-  rsSckeys <- head(keys(s, "REFSEQ"))
-  checkTrue(any(grepl("N", rsSckeys)))
-  orfSckeys <- head(keys(s, "ORF"))
-  checkTrue(any(grepl("A", orfSckeys)))
-}
-
-test_keys_advancedArgs <- function(){
-    k1 <- keys(x, keytype="SYMBOL")
-    checkTrue("A1BG" %in% k1)
-    
-    k2 <- keys(x, keytype="SYMBOL", pattern="BRCA")
-    checkTrue("BRCA1" %in% k2)
-    checkTrue(!("A1BG" %in% k2))
-    checkTrue(length(k2) < length(k1))
-
-    l1 <- length(keys(x, keytype="ENTREZID", column="PATH"))
-    l2 <- length(keys(x, keytype="ENTREZID"))
-    checkTrue(l1 < l2)
-    
-    k3 <- keys(x,keytype="ENTREZID",pattern="^MSX",column="SYMBOL")
-    res <- select(x, k3, c("ENTREZID","SYMBOL"), "ENTREZID")
-    checkTrue(any(grep("^MSX",res$SYMBOL)))
-}
 
 #########################################################################
 ## These ones are to test out some real use cases...
-test_select1 <- function(){
-  keys <- head(keys(hgu95av2.db, "ALIAS"),n=2)
-  cols <- c("SYMBOL","ENTREZID","PROBEID")
-  res <- quiet(select(hgu95av2.db, keys, cols, keytype="ALIAS"))
-  checkIdentical(c(3L, 4L), dim(res))
-  checkIdentical(c("ALIAS","SYMBOL","ENTREZID","PROBEID"), colnames(res))
-}
-
-test_select2 <- function(){
-  keys <- head(keys(org.Hs.eg.db),n=2)
-  cols <- c("PFAM","ENTREZID", "GO")
-  res <- quiet(select(org.Hs.eg.db, keys, cols, keytype="ENTREZID"))
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==5)
-  checkIdentical(c("ENTREZID","PFAM","GO","EVIDENCE","ONTOLOGY"),
-                 colnames(res))
-}
-
-test_select3 <- function(){
-  keys <- head(keys(org.Hs.eg.db,keytype="OMIM"),n=4)
-  cols <- c("SYMBOL", "UNIPROT", "PATH")
-  res <- quiet(select(hgu95av2.db, keys, cols, keytype="OMIM"))
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==4)
-  checkIdentical(c("OMIM","SYMBOL","UNIPROT","PATH"), colnames(res))
-}
-
-test_select4 <- function(){
-  keys <- head(keys(org.Hs.eg.db),n=2)
-  cols <- c("ACCNUM","REFSEQ")
-  res <- quiet(select(org.Hs.eg.db, keys, cols))
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==3)
-  checkIdentical(c("ENTREZID","ACCNUM","REFSEQ"), colnames(res))
-}
 
 test_select5 <- function(){
   keys <- head(keys(GO.db), n=4)
@@ -210,16 +70,6 @@ test_select5 <- function(){
   checkIdentical(c("GOID","TERM","ONTOLOGY","DEFINITION"), colnames(res))
 }
 
-test_select6 <- function(){
-  keys <- head(keys(hgu95av2.db))
-  cols <- c("SYMBOL","ENTREZID", "GO")
-  ## tests for bad keys:
-  checkException(select(hgu95av2.db, keys, cols, keytype="ENTREZID"))
-  ## also catch bogus keytype arguments
-  checkException(select(hgu95av2.db, keys, cols, keytype="FOO"))
-  checkException(keys(hgu95av2.db, keytype="FOO"))
-}
-
 test_select7 <- function(){  
   cols <- c("SYMBOL","ENTREZID") ## 1st of all cols should be 1:1 cols
   keys <- head(keys(org.Hs.eg.db),n=3)
--- a/inst/unitTests/test_bimap.R
+++ /dev/null
@@ -1,214 +0,0 @@
-require(org.Hs.eg.db)
-require(RUnit)
-## map is just to represent a classic Bimap
-map  <- org.Hs.egSYMBOL
-## map2 represents an AnnotationDbMap mapping made by some other process for BC
-## map2 <- new("AnnotationDbMap", AnnotDb=org.Hs.eg.db, columns="SYMBOL")
-map3 <- AnnotationDbi:::makeFlatBimapUsingSelect(org.Hs.eg.db, col="SYMBOL")
-## And another map object expected by most other tests.
-map2 <- AnnotationDbi:::makeFlatBimapUsingSelect(org.Hs.eg.db, col="ONTOLOGY")
-
-##map3 <- AnnotationDbi:::flatten(map)
-
-
-## test ls 
-test_ls <- function(){
-  res <- ls(map)
-  checkTrue(is.character(res))
-  checkTrue(length(res) > 0)
-  checkEquals(c("1","10","100"), head(res,n=3))
-  res2 <- ls(map3)
-  checkTrue(is.character(res2))
-  checkTrue(length(res2) > 0)
-  checkEquals(c("1","10","100"), head(res2,n=3))
-}
-
-## test Lkeys and Rkeys
-test_Lkeys <- function(){
-lres <- Lkeys(map)
-checkTrue(length(lres) >0)
-checkTrue(!any(is.na(lres)))
-checkTrue(length(lres) == length(unique(lres)))
-
-lres2 <- Lkeys(map2)  
-checkTrue(length(lres2) >0)
-checkTrue(!any(is.na(lres2)))
-checkTrue(length(lres2) == length(unique(lres2)))
-}
-
-test_Rkeys <- function(){
-rres <- Rkeys(map)
-checkTrue(length(rres) >0)
-checkTrue(!any(is.na(rres)))
-checkTrue(length(rres) == length(unique(rres)))
-
-rres2 <- Rkeys(map2)
-checkTrue(length(rres2) >0)
-checkTrue(!any(is.na(rres2)))
-checkTrue(length(rres2) == length(unique(rres2)))
-}
-
-## test revmap (add a test now that it seems to work...
-test_revmap <- function(){
-  rmap <- revmap(map)
-  checkTrue(rmap@direction == -1)
-  rmap2 <- revmap(map2)
-  checkTrue(rmap2@direction == -1)
-}
-
-## test mget
-test_mget <- function(){
-  k <- c("1","2")
-  res <- mget(k, map)
-  checkEquals(names(res), k)
-  checkEquals(res[[1]], "A1BG")
-  checkTrue(length(res)==length(k))
-  
-  res2 <- mget(k, map2) 
-  checkEquals(names(res2), k)
-  checkEquals(res2[[1]], c("BP","CC","MF"))
-  checkTrue(length(res2)==length(k))
-
-  ## reverse test 
-  kr <- c("CC","MF")
-  res3 <- mget(kr, revmap(map2))
-  checkEquals(names(res3), kr)
-  checkEquals(res3[[1]][1], "1")
-  checkTrue(length(res3)==length(kr))
-}
-
-## test as.list
-test_as.list <- function(){
-  res <- as.list(map)
-  checkEquals(names(res)[1], "1")
-  checkEquals(res[[1]][1], "A1BG")
-  checkTrue(length(res)>1000)
-  
-  res2 <- as.list(map2)
-  checkEquals(names(res2)[[1]], "1")
-  checkEquals(res2[[1]], c("BP","CC","MF"))
-  checkTrue(length(res2)>1000)
-
-  ## reverse test  
-  res3 <- as.list(revmap(map2))
-  checkEquals(names(res3)[1], "BP")
-  checkEquals(res3[[1]][1], "1")
-  checkTrue(length(res3)==3)
-}
-
-## test as.character
-test_as.character <- function(){
-  res <- as.character(map)
-  checkEquals(names(res)[1], "1")
-  checkEquals(res[[1]][1], "A1BG")
-
-  res2 <- as.character(map2)       
-  checkEquals(names(res2)[1], "1")
-  checkEquals(res2[[1]][1], "BP")
-  
-  ## reverse test
-  res3 <- as.character(revmap(map2)) 
-  checkEquals(names(res3)[1], "BP")
-  checkEquals(res3[[1]][1], "1")
-}
-
-## test eapply
-test_eapply <- function(){
-  res <- eapply(map, length)
-  checkEquals(names(res)[1], "1")
-  checkTrue(res[[1]][1] == 1)
-
-  res2 <- eapply(map2, length)
-  checkEquals(names(res2)[1], "1")
-  checkTrue(res2[[1]][1] == 3)
-}
-
-## test get
-test_get <- function(){
-  k <- "1"
-  res <- get(k, map)
-  checkTrue(res == "A1BG")
-  
-  res2 <- get(k, map2)
-  checkEquals(res2, c("BP","CC","MF"))
-
-  ## reverse test 
-  kr <- "CC"
-  res3 <- get(kr, revmap(map2))
-  checkTrue(res3[[1]][1] == "1")
-}
-
-## test exists
-test_exists <- function(){
-  checkTrue(exists("2", map) == TRUE)     
-  checkTrue(exists("titi", map) == FALSE)
-  
-  checkTrue(exists("9", map2) == TRUE)  
-  checkTrue(exists("titi", map2) == FALSE)  
-}
-
-## test "[["
-test_dblBrackets <- function(){
-  res <- map[["1"]]
-  checkTrue(res == "A1BG")
-  res2 <- map2[["1"]]
-  checkEquals(res2, c("BP","CC","MF"))
-}
-
-test_head <- function(){
-  res <- head(map, n=3)
-  checkTrue( class(res) == "AnnDbBimap" )
-
-  res2 <- head(map2, n=3)  ## implement Lkeys and Rkeys
-  checkTrue( class(res2) == "data.frame" )
-  checkTrue( dim(res2)[1] == 3 )
-  checkTrue( dim(res2)[2] == 2 )
-}
-
-test_tail <- function(){
-  res <- tail(map, n=3)
-  checkTrue( class(res) == "AnnDbBimap" )
-
-  res2 <- tail(map2, n=3)
-  checkTrue( class(res2) == "data.frame" )
-  checkTrue( dim(res2)[1] == 3 )
-  checkTrue( dim(res2)[2] == 2 )
-}
-
-## test "$"
-test_Dollar <- function(){
-  res <- map$"1"
-  checkTrue(res == "A1BG")
-  res2 <- map2$"1"
-  checkEquals(res2, c("BP","CC","MF"))
-}
-
-## test toTable as.data.frame
-test_toTable <- function(){
-  res <- toTable(map)
-  resdf <- as.data.frame(map)
-  checkEquals(res, resdf)
-  checkEquals(colnames(res), c("gene_id","symbol"))
-  checkTrue(res[1,1]==1)
-  checkTrue(res[1,2]=="A1BG")
-  
-  ## So one potential issue I have is that I get the "wrong" sort of headings?
-  ## this is largely a cosmetic issue though...
-  res2 <- toTable(map2)
-  resdf2 <- as.data.frame(map2)
-  checkEquals(res2, resdf2)
-  checkEquals(colnames(res2), c("ENTREZID","ONTOLOGY"))
-  checkTrue(res2[1,1]==1)
-  checkTrue(res2[1,2]=="BP")
-}
-
-test_sample <- function(){
-  res <- sample(map,size=2)
-  checkTrue(length(res)==2)
-  checkTrue(class(res)=="list")
-  
-  res2 <- sample(map2,size=2)
-  checkTrue(length(res2)==2)
-  checkTrue(class(res2)=="list")
-}
-
--- a/inst/unitTests/test_mapIds.R
+++ /dev/null
@@ -1,77 +0,0 @@
-## unit test to just check that mapIds is behaving itself
-require(org.Hs.eg.db)
-
-## constants
-k <- head(keys(org.Hs.eg.db, 'ENTREZID'))
-
-# trace("mapIds", tracer=browser, signature ="AnnotationDb")
-
-### The actual tests.
-
-## Default is currently 'first'
-test_mapIds_default <- function(){
-    res <- mapIds(org.Hs.eg.db, keys=k, column='ALIAS', keytype='ENTREZID')
-    checkTrue(length(res) == length(k))
-    checkTrue(res[[1]] == "A1B")
-    checkTrue(class(res)=='character')
-}
-
-## test other return types.
-
-## "list"
-test_mapIds_CharacterList <- function(){
-    res <- mapIds(org.Hs.eg.db, keys=k, column='ALIAS', keytype='ENTREZID', 
-                  multiVals="list")
-    checkTrue(length(res) == length(k))
-    checkTrue(res[[1]][1] == "A1B")
-    checkTrue(class(res)=='list')
-}
-
-## "CharacterList"
-test_mapIds_CharacterList <- function(){
-    res <- mapIds(org.Hs.eg.db, keys=k, column='ALIAS', keytype='ENTREZID', 
-       multiVals="CharacterList")
-    checkTrue(length(res) == length(k))
-    checkTrue(res[[1]][1] == "A1B")
-    checkTrue(class(res)=='SimpleCharacterList')
-}
-
-## "NAMultiples"
-test_mapIds_NAMultiples <- function(){
-    res <- mapIds(org.Hs.eg.db, keys=k, column='PFAM', keytype='ENTREZID', 
-       multiVals="asNA")
-    checkTrue(length(res) == length(k))
-    checkTrue(res[['10']] == "PF00797")
-    checkTrue(class(res)=='character')
-
-    res <- mapIds(org.Hs.eg.db, "2", "PFAM", "ENTREZID", multiVals = "asNA")
-    checkTrue(is.character(res))
-    checkIdentical(length(res), 1L)
-}
-
-## "filterMultiples"
-test_mapIds_filterMultiples <- function(){
-    res <- mapIds(org.Hs.eg.db, keys=k, column='PFAM', keytype='ENTREZID', 
-       multiVals="filter")
-    checkTrue(length(res) < length(k)) ## multi matchers means should be shorter
-    checkTrue(res[['10']] == "PF00797")
-    checkTrue(res[['1']] == "PF13895")
-    checkTrue(class(res)=='character')
-
-    res <- mapIds(org.Hs.eg.db, "2", "PFAM", "ENTREZID", multiVals = "filter")
-    checkTrue(is.character(res))
-    checkIdentical(length(res), 0L)
-}
-
-
-## CUSTOM function
-test_mapIds_FUN <- function(){
-    last <- function(x){
-    x[[length(x)]]
-    }
-    res <- mapIds(org.Hs.eg.db, keys=k, column='ALIAS', keytype='ENTREZID', 
-       multiVals=last)
-    checkTrue(length(res) == length(k))
-    checkTrue(res[[1]] == "A1BG")
-    checkTrue(class(res)=='character')
-}
--- a/inst/unitTests/test_geneCentricDbs.R
+++ /dev/null
@@ -1,14 +0,0 @@
-test_getOrgPkg_load_only <- function() {
-    ## check that map between chip and org package works with loaded
-    ## but not attached org package
-    if ("package:org.Hs.eg.db" %in% search()) {
-        detach("package:org.Hs.eg.db")
-        on.exit(attachNamespace("org.Hs.eg.db"))
-    }
-    pkg <- "hgu95av2.db"
-    env <- loadNamespace(pkg)
-    db <- get(pkg, env)
-    keys <- head(AnnotationDbi::keys(db))
-    df <- AnnotationDbi::select(db, keys, "SYMBOL")
-    checkIdentical(c(6L, 2L), dim(df))
-}
--- a/inst/unitTests/test_select_NOSCHEMA.R
+++ /dev/null
@@ -1,132 +0,0 @@
-## this will install a testDb stashed in the
-
-## ## this is the package name
-## pkgName <- "org.testing.db"
-
-## ## Get the package path
-## pkgPath <- system.file("extdata", pkgName, package="AnnotationDbi")
-
-## ## Then install it
-## install.packages(pkgPath, repos=NULL)
-## and load it
-#####install.packages(system.file('extdata','org.testing.db', package='AnnotationDbi'), repos=NULL)
-
-
-dir.create(testlib <- tempfile())
-old_libPaths <- NULL
-
-.setUp <- function()
-{
-    installed <- rownames(installed.packages(testlib))
-    if ("org.testing.db" %in% installed)
-        return()
-    pkg <- system.file("extdata", "org.testing.db", package="AnnotationDbi")
-    suppressPackageStartupMessages(install.packages(
-        pkg, lib = testlib, repos=NULL, type="source",
-        INSTALL_opts="--no-test-load", verbose = FALSE, quiet = TRUE
-    ))
-    old_libPaths <<- .libPaths()
-    .libPaths(c(testlib, old_libPaths))
-    finchCsomes <<- c(as.character(1:15),as.character(17:28),
-                     "MT","Un","W","Z","4A","1A","1B")
-    finchCols <<- c("CHROMOSOME","SYMBOL","GENENAME","GID","GO","EVIDENCE",
-                   "ONTOLOGY","GOALL","EVIDENCEALL","ONTOLOGYALL")
-}
-
-.tearDown <- function()
-    .libPaths(old_libPaths)
-
-## lower level tests (more useful)
-test_keysLow <- function(){
-    x <- org.testing.db::org.testing.db
-    res <- unique(AnnotationDbi:::.noSchemaKeys(x, "CHROMOSOME"))
-    checkTrue(all(sort(res) == sort(finchCsomes)))
-}
-
-
-test_selectLow <- function(){
-    x <- org.testing.db::org.testing.db
-    keys <- "100008579"
-    cols <- "SYMBOL"
-    keytype <- "GID"
-    res <- AnnotationDbi:::.noSchemaSelect(x, keys, cols, keytype)
-    checkTrue(all(res==c("100008579","EGR1")))
-    checkTrue(all(colnames(res)==c("GID","SYMBOL")))
-
-    keys <- "brain-derived neurotrophic factor"
-    cols <- c("SYMBOL","GID")
-    keytype <- "GENENAME"
-    res <- AnnotationDbi:::.noSchemaSelect(x, keys, cols, keytype)
-    checkTrue(all(res==c("brain-derived neurotrophic factor","BDNF","751584")))
-    checkTrue(all(colnames(res)==c("GENENAME","SYMBOL","GID")))
-
-    keys <- "brain-derived neurotrophic factor"
-    cols <- c("GO","GID")
-    keytype <- "GENENAME"
-    res <- head(AnnotationDbi:::.noSchemaSelect(x, keys, cols, keytype),n=1)
-    checkTrue(all(res==c("brain-derived neurotrophic factor","GO:0001657",
-                    "751584")))
-    checkTrue(all(colnames(res)==c("GENENAME","GO","GID")))    
-}
-
-
-## high level tests (does this dispatch right etc.?)
-test_columns <- function(){
-    x <- org.testing.db::org.testing.db
-    res <- columns(x)
-    checkTrue(all(sort(res) == sort(finchCols)))
-}
-
-test_keytypes <- function(){
-    x <- org.testing.db::org.testing.db
-    res <- keytypes(x)
-    checkTrue(all(sort(res) == sort(finchCols)))
-}
-
-test_keys<- function(){                                          ## BOOM
-    x <- org.testing.db::org.testing.db
-    ## most basic case
-    res <- keys(x, "CHROMOSOME")
-    checkTrue(all(sort(res) == sort(finchCsomes)))
-    
-    res <- head(keys(x, "GID"), n=2)
-    checkTrue(all(res==c("751582", "751583")))
-    
-    res <- head(keys(x, "SYMBOL", pattern="BDNF"))
-    checkTrue(res=="BDNF")
-    
-    res <- head(keys(x, "GID", pattern="BDNF", column="SYMBOL"))
-    checkTrue(res=="751584")
-    
-    res <- head(keys(x, "SYMBOL", column="GID"),n=2)
-    checkTrue(all(res==c("ACT5C","AHSA2")))
-}
-
-
-test_select <- function(){
-    x <- org.testing.db::org.testing.db
-    ## most basic case
-    res <- select(x, keys="100008579",
-                  columns="SYMBOL", keytype="GID")
-    checkTrue(all(res==c("100008579","EGR1")))
-    checkTrue(all(colnames(res)==c("GID","SYMBOL")))
-
-    ## return more than one column
-    res <- select(x, keys="100008579",
-                  columns=c("SYMBOL","CHROMOSOME"), keytype="GID")
-    checkTrue(all(res==c("100008579","EGR1","13")))
-    checkTrue(all(colnames(res)==c("GID","SYMBOL","CHROMOSOME")))
-
-    ## return GO and evidence codes
-    suppressWarnings(res <- head(select(x, keys="100008579",
-                       columns=c("GO","EVIDENCE"), keytype="GID"),n=1))
-    checkTrue(all(res==c("100008579","GO:0000122","IEA")))
-    checkTrue(all(colnames(res)==c("GID","GO","EVIDENCE")))
-
-    ## test lookup from alt-key
-    res <- select(x, keys="BDNF",
-                  columns="GENENAME", keytype="SYMBOL")
-    checkTrue(all(res==c("BDNF","brain-derived neurotrophic factor")))
-    checkTrue(all(colnames(res)==c("SYMBOL","GENENAME")))
-    
-}
--- a/inst/unitTests/test_select_reactome.R
+++ /dev/null
@@ -1,127 +0,0 @@
-## unit tests for methods associated with reactome.db
-require(reactome.db)
-r <- reactome.db
-
-
-test_cols <- function(){
-  res <- columns(r)
-  checkTrue(length(res) >4)
-  checkTrue("ENTREZID" %in% res)
-  checkTrue("GO" %in% res)
-  checkTrue("PATHNAME" %in% res)
-  checkTrue("REACTOMEID" %in% res)
-}
-
-test_keytypes <- function(){
-  res <- keytypes(r)
-  checkTrue(length(res) >4)
-  checkTrue("ENTREZID" %in% res)
-  checkTrue("GO" %in% res)
-  checkTrue("PATHNAME" %in% res)
-  checkTrue("REACTOMEID" %in% res)
-}
-
-test_keys <- function(){
-  res <- head(keys(r, keytype="ENTREZID"))
-  checkTrue(length(res) > 0)
-  checkTrue(length(res) == length(unique(res)))
-  res2 <- head(keys(r, keytype="PATHNAME"))
-  checkTrue(is.character(res2))
-  checkTrue(length(res2) == length(unique(res2)))
-}
-
-## test function that gets table names
-test_getTables <- function(){
-  c <- c("ENTREZID", "PATHNAME")
-  res <- AnnotationDbi:::.getTables(c, retVal="table") ##default for retVal
-  checkTrue(length(res) ==2)
-  checkIdentical(res, c("pathway2gene","pathway2name"))
-  
-  res2 <- AnnotationDbi:::.getTables(c, retVal="colname")
-  checkTrue(length(res2) ==2)
-  checkIdentical(res2, c("gene_id","path_name"))
-}
-
-## Tests ability to get one table/query out.
-test_extractWithSimpleQuery <- function(){
-  table <- "pathway2gene" ## a table (in this case). (Could also be subquery)
-  colType <- "gene_id" ## column we are interested in.
-  k <-  head(keys(r, keytype="ENTREZID"), n=2)
-  res <- AnnotationDbi:::.extractWithSimpleQuery(r, table, colType, k)
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==2)
-  checkIdentical(c("DB_ID","gene_id"), colnames(res))
-}
-
-## Test ability to pull data out in vectorized fashion
-test_collateQueryResults <- function(){
-  tables <- c("pathway2gene", "reactome2go", "pathway2name")
-  colType <- "gene_id"
-  k <-  head(keys(r, keytype="ENTREZID"), n=2)
-  mergeID = "DB_ID"
-  res <- AnnotationDbi:::.collateQueryResults(r, tables, colType, k, mergeID)
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==4)
-  checkIdentical(c("DB_ID","gene_id","go_id","path_name"), colnames(res))
-}
-
-
-
-
-
-## and tests for select:
-test_select_TYPICAL <- function(){
-  k <- head(keys(r, keytype="ENTREZID"))
-  c <- c("ENTREZID","PATHNAME","GO","REACTOMEID")
-  res <-  select(r, keys=k, columns=c, keytype="ENTREZID")
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==4)
-  checkIdentical(c("ENTREZID","PATHNAME","GO","REACTOMEID"), colnames(res))
-}
-
-test_select_MISSING_EG <- function(){
-  k <- head(keys(r, keytype="ENTREZID"))
-  c <- c("PATHNAME","GO")
-  res <-  select(r, keys=k, columns=c, keytype="ENTREZID")
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==3)
-  checkIdentical(c("ENTREZID","PATHNAME","GO"), colnames(res))
-}
-
-
-test_select_ONE_COL <- function(){
-  k <- head(keys(r, keytype="ENTREZID"))
-  c <- c("ENTREZID")
-  res <-  select(r, keys=k, columns=c, keytype="ENTREZID")  ## Boom no warning
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==1)
-  checkIdentical(c("ENTREZID"), colnames(res))
-}
-
-
-test_select_OTHERKEYTYPE <- function(){
-  ## This also checks if that we handle "BS keys" OK
-  k <- head(keys(r, keytype="REACTOMEID"))
-  k <- c(k[1:4], "109688")
-  c <- c("ENTREZID","PATHNAME","GO")
-  res <-  select(r, keys=k, columns=c, keytype="REACTOMEID")
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==4)
-  checkIdentical(c("REACTOMEID","ENTREZID","PATHNAME","GO"), colnames(res))  
-}
-
-test_select_PATHNAME <- function(){
-  k <- head(keys(r, "PATHNAME"))
-  suppressWarnings(res <- select(r, k, "ENTREZID", "PATHNAME"))
-  checkTrue(dim(res)[1]>0)
-  checkTrue(dim(res)[2]==2)
-  checkIdentical(c("PATHNAME","ENTREZID"), colnames(res)) 
-}
-
-
-
-
-## for convenience...
-## debug(AnnotationDbi:::.selectReact)
-## debug(AnnotationDbi:::.collateQueryResults)
-## debug(AnnotationDbi:::.extractWithSimpleQuery)
