[med-svn] r22909 - in trunk/packages/R/r-bioc-annotationdbi/trunk/debian: . patches tests

Andreas Tille tille at moszumanska.debian.org
Wed Oct 26 14:39:02 UTC 2016


Author: tille
Date: 2016-10-26 14:39:01 +0000 (Wed, 26 Oct 2016)
New Revision: 22909

Added:
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/exclude_tests_requiring_large_databases.patch
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/series
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/control
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/run-unit-test
Modified:
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/changelog
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/control
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/copyright
   trunk/packages/R/r-bioc-annotationdbi/trunk/debian/rules
Log:
  * New upstream version
  * Convert to dh-r
  * Generic BioConductor homepage
  * Add minimal autopkgtest based on r-bioc-go.db while ignoring all
    other tested databases which are not packaged yet



Modified: trunk/packages/R/r-bioc-annotationdbi/trunk/debian/changelog
===================================================================
--- trunk/packages/R/r-bioc-annotationdbi/trunk/debian/changelog	2016-10-26 13:58:24 UTC (rev 22908)
+++ trunk/packages/R/r-bioc-annotationdbi/trunk/debian/changelog	2016-10-26 14:39:01 UTC (rev 22909)
@@ -1,3 +1,13 @@
+r-bioc-annotationdbi (1.36.0-1) unstable; urgency=medium
+
+  * New upstream version
+  * Convert to dh-r
+  * Generic BioConductor homepage
+  * Add minimal autopkgtest based on r-bioc-go.db while ignoring all
+    other tested databases which are not packaged yet
+
+ -- Andreas Tille <tille at debian.org>  Wed, 26 Oct 2016 14:19:04 +0200
+
 r-bioc-annotationdbi (1.34.0-1) unstable; urgency=medium
 
   * New upstream version

Modified: trunk/packages/R/r-bioc-annotationdbi/trunk/debian/control
===================================================================
--- trunk/packages/R/r-bioc-annotationdbi/trunk/debian/control	2016-10-26 13:58:24 UTC (rev 22908)
+++ trunk/packages/R/r-bioc-annotationdbi/trunk/debian/control	2016-10-26 14:39:01 UTC (rev 22909)
@@ -4,7 +4,7 @@
 Section: gnu-r
 Priority: optional
 Build-Depends: debhelper (>= 9),
-               cdbs,
+               dh-r,
                r-base-dev,
                r-cran-dbi,
                r-cran-rsqlite,
@@ -13,16 +13,14 @@
 Standards-Version: 3.9.8
 Vcs-Browser: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/R/r-bioc-annotationdbi/trunk/
 Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/R/r-bioc-annotationdbi/trunk/
-Homepage: http://www.bioconductor.org/packages/release/bioc/html/AnnotationDbi.html
+Homepage: https://bioconductor.org/packages/AnnotationDbi/
 
 Package: r-bioc-annotationdbi
 Architecture: all
 Depends: ${R:Depends},
          ${misc:Depends},
-         r-cran-dbi,
-         r-cran-rsqlite,
-         r-bioc-biobase (>= 2.26.0),
-         r-bioc-genomeinfodb (>= 1.2.0)
+Recommends: ${R:Recommends}
+Suggests: ${R:Suggests}
 Description: GNU R Annotation Database Interface for BioConductor
  This BioConductor module provides user interface and database
  connection code for annotation data packages using SQLite data

Modified: trunk/packages/R/r-bioc-annotationdbi/trunk/debian/copyright
===================================================================
--- trunk/packages/R/r-bioc-annotationdbi/trunk/debian/copyright	2016-10-26 13:58:24 UTC (rev 22908)
+++ trunk/packages/R/r-bioc-annotationdbi/trunk/debian/copyright	2016-10-26 14:39:01 UTC (rev 22909)
@@ -1,14 +1,14 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: AnnotationDbi
-Upstream-Contact: Bioconductor Package Maintainer <maintainer at bioconductor.org> 
-Source: http://www.bioconductor.org/packages/release/bioc/html/AnnotationDbi.html
+Upstream-Contact: Bioconductor Package Maintainer <maintainer at bioconductor.org> 
+Source: https://bioconductor.org/packages/AnnotationDbi/
 
 Files: *
-Copyright: © 2006-2014 Herve Pages, Marc Carlson, Seth Falcon, Nianhua Li
+Copyright: © 2006-2016 Herve Pages, Marc Carlson, Seth Falcon, Nianhua Li
 License: Artistic-2.0
 
 Files: debian/*
-Copyright: 2013-2014 Andreas Tille <tille at debian.org>
+Copyright: 2013-2016 Andreas Tille <tille at debian.org>
 License: Artistic-2.0
 
 License: Artistic-2.0

Added: trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/exclude_tests_requiring_large_databases.patch
===================================================================
--- trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/exclude_tests_requiring_large_databases.patch	                        (rev 0)
+++ trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/exclude_tests_requiring_large_databases.patch	2016-10-26 14:39:01 UTC (rev 22909)
@@ -0,0 +1,1198 @@
+Author: Andreas Tille <tille at 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,263 +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)
+-  keys <- c(1, keys, keys)
+-  res <- select(org.Hs.eg.db, keys, cols)
+-  checkTrue(class(res) =="data.frame")
+-  checkIdentical(keys, as.character(t(res$ENTREZID)))
+-}
+-
+-test_select8 <- function(){
+-  cols <- c("ENTREZID")
+-  keys <- head(keys(org.Hs.eg.db),n=3)
+-  res <- select(org.Hs.eg.db, keys, cols)
+-  checkTrue(class(res) =="data.frame")
+-  checkTrue(dim(res)[2] ==1)  
+-  checkIdentical(as.character(keys), as.character(t(res$ENTREZID)))
+-}
+-
+-test_select9 <- function(){  
+-  ## What about when we need to throw away extra cols?
+-  uniKeys <- head(keys(org.Hs.eg.db, keytype="UNIPROT"))
+-  cols <- c("SYMBOL", "PATH")
+-  res <- quiet(select(org.Hs.eg.db, keys=uniKeys, columns=cols, keytype="UNIPROT"))
+-  checkTrue(class(res) =="data.frame")
+-  checkTrue(dim(res)[2] ==3)  
+-  checkIdentical(c("UNIPROT","SYMBOL","PATH"), colnames(res))
+-}
+-
+-test_select10 <- function(){
+-  ## What about when we have to get data from Arabidopsis using various
+-  ## keytypes?
+-  cols <- c("SYMBOL","CHR")
+-  keys <- head(keys(t,"TAIR"))
+-  res <- quiet(select(t, keys, cols, keytype="TAIR"))
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("TAIR","SYMBOL","CHR"), colnames(res))
+-
+-  keys <- head(keys(t,"ENTREZID"))
+-  res <- quiet(select(t, keys, cols, keytype="ENTREZID"))
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("ENTREZID","SYMBOL","CHR"), colnames(res))
+-
+-  keys=head(keys(t,"REFSEQ"))
+-  res <- quiet(select(t, keys, cols , keytype="REFSEQ"))
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("REFSEQ","SYMBOL","CHR"), colnames(res))
+-}
+-
+-test_select11 <- function(){
+-  ## how about different keytypes for yeast?
+-  keys <- head(keys(s, "REFSEQ"))
+-  cols <- c("CHR","PFAM")
+-  res <- quiet(select(s, keys, cols, keytype="REFSEQ"))
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("REFSEQ","CHR","PFAM"), colnames(res))
+-  
+-  keys <- head(keys(s, "ENTREZID"))
+-  cols <- c("CHR","PATH")
+-  res <- quiet(select(s, keys, cols, keytype="ENTREZID"))
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("ENTREZID","CHR","PATH"), colnames(res))
+-  
+-  keys <- head(keys(s, "ORF"))
+-  cols <- c("CHR","SGD")
+-  res <- select(s, keys, cols, keytype="ORF")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("ORF","CHR","SGD"), colnames(res))
+-
+-  ## And if you flip things the other way
+-  cols <- c("SGD","CHR")
+-  res <- select(s, keys, cols, keytype="ORF")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("ORF","SGD","CHR"), colnames(res))
+-
+-  ## Martins bug discoveries
+-  keys <- keys(s, keytype="GENENAME")
+-  checkTrue(length(keys) > 0)
+-  checkTrue(is.character(keys))
+-  keys <- keys(s, keytype="CHRLOC")
+-  checkTrue(length(keys) > 0)
+-  checkTrue(is.character(keys))
+-
+-  res <- select(s, "YAL003W", "GENENAME")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("ORF","SGD","GENENAME"), colnames(res))
+-
+-  ## This works but is slow (therefore it's tested elsewhere)
+-  ## res <- select(s, keys="YAL003W", columns(s))
+-
+-  ## Another test to make sure we can join up to ORF properly
+-  keys <- keys(s,"ENTREZID")
+-  res <- select(s, columns="ORF", keys=keys, keytype="ENTREZID")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("ENTREZID","ORF","SGD"), colnames(res))
+-}
+-
+-test_select12 <- function(){
+-  ## what happens when we use GO as an ID?
+-  keys <- "1"
+-  cols <- c("GO","ENTREZID")
+-  res <- quiet(select(x, keys, cols, keytype="ENTREZID"))
+-  checkTrue(dim(res)[1]>0)   
+-  checkTrue(dim(res)[2]==4)
+-  checkIdentical(c("ENTREZID","GO","EVIDENCE","ONTOLOGY"), colnames(res))
+-
+-  keys <- "GO:0000018"
+-  cols <- c("GO","ENTREZID")
+-  res <- quiet(select(x, keys, cols, keytype="GO"))
+-  checkTrue(dim(res)[1]>0)   
+-  checkTrue(dim(res)[2]==4)
+-  checkIdentical(c("GO","EVIDENCE","ONTOLOGY","ENTREZID"), colnames(res))
+-
+-  keys <- "GO:0000023"
+-  cols <- c("GO","ENTREZID")
+-  res <- quiet(select(t, keys, cols, keytype="GO"))
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==4)
+-  checkIdentical(c("GO","EVIDENCE","ONTOLOGY","ENTREZID"), colnames(res)) 
+-
+-  keys <- "GO:0000023"
+-  cols <- c("ENTREZID","TAIR","GO")
+-  res <- quiet(select(t, keys, cols, keytype="GO"))
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==5)
+-  checkIdentical(c("GO","EVIDENCE","ONTOLOGY","ENTREZID","TAIR"), 
+-  		colnames(res))
+-}
+-
+-test_select13 <- function(){
+-  ## what happens with dropping unwanted rows?
+-  sym <- "ITGA7"
+-  res <- quiet(select(x, sym, "PFAM", keytype="ALIAS"))
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==2)
+-  ## make sure no NAs are in res$PFAM
+-  checkTrue(length(res$PFAM)== length(res$PFAM[!is.na(res$PFAM)]))
+-}
+-
+-test_select14 <- function(){
+-  ## what happens when there are no results AT ALL? (should be all NAs)
+-  keys <- c("1001_at","1006_at","1007_s_at")
+-  res <- select(hgu95av2.db, keys, "PATH", keytype="PROBEID")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==2)
+-  ## make sure all of res$PATH ARE NAs
+-  ## If this part fails it is a warning that the test is no longer valid,
+-  ## which would happen if some of these IDs were to be further annotated for
+-  ## PATH (unlikely since PATH is basically dead for this repos)
+-  checkTrue(length(res$PATH)== length(res$PATH[is.na(res$PATH)]))
+-}
+-
+-test_select15 <- function(){
+-    ## Another bug that seems to happen in post-processing...
+-    ## the code that resolves duplicated values is going a bit insane...
+-    ## (IOW .replaceValues())
+-    if(!all(.Platform$OS.type == "windows", .Platform$r_arch == "i386")){
+-        res <- select(x, keys="100008586", columns(x)) 
+-        checkTrue(dim(res)[1]>0)
+-        checkTrue(dim(res)[2]==26)
+-        exp <- c("ENTREZID", "ACCNUM", "ALIAS", "ENSEMBL", "ENSEMBLPROT",
+-                 "ENSEMBLTRANS", "ENZYME", "EVIDENCE", "EVIDENCEALL",
+-                 "GENENAME", "GO", "GOALL", "IPI", "MAP", "OMIM", 
+-                 "ONTOLOGY", "ONTOLOGYALL", "PATH", "PFAM", "PMID", "PROSITE",
+-                 "REFSEQ", "SYMBOL", "UCSCKG", "UNIGENE", "UNIPROT")
+-        checkIdentical(exp, colnames(res))
+-    }
+-}
+-
+-
+-test_select16 <- function(){
+-    ## What happens if we ask for probes back...
+-    ## (and pass in something else as a key)
+-    sk = c( 'MAPK3','TIE1' )
+-    res <- select(hgu95av2.db, keys=sk, columns = c("PROBEID"), keytype="SYMBOL")
+-    checkTrue(dim(res)[1]>0)
+-    checkTrue(dim(res)[2]==2)
+-    checkIdentical(c('SYMBOL','PROBEID'), colnames(res))
+-}
+-
+-
+-## NA values are now OK for legacySelect (in order to be consistent
+-## with other select methods which have greater respect for incoming NA values
+-test_select_NAsInNAsOut <- function(){
+-    ## NAs in should result in NAs out.
+-    ## Not that we like NAs but just because if possible: we want to
+-    ## preserve the geometry of the keys coming in.
+-    k=c('1', NA, NA, '10');
+-    res <- select(x, k, 'SYMBOL', 'ENTREZID')
+-    checkTrue(dim(res)[1]==4) 
+-    checkTrue(dim(res)[2]==2)
+-    checkIdentical(c('ENTREZID','SYMBOL'), colnames(res))
+-    checkIdentical(k, res$ENTREZID)
+-    checkTrue(any(is.na(res$SYMBOL)))
+-}
+-
+-
+-## Some new messages from AnnotationDbi:::.generateExtraRows()
+-## where I am calling it internally...
+-## these tests just make sure the right kinds of messages are being sent...
+-test_select_XtoX <- function(){
+-    k=c('1','1', NA, '10');
+-    res <- tryCatch(select(org.Hs.eg.db, k, 'SYMBOL', 'ENTREZID'),
+-                    message = function(x){return(x)})
+-    checkTrue(grepl('many:1', res$message))
+-    
+-    res <- tryCatch(select(org.Hs.eg.db, '1', 'ALIAS', 'ENTREZID'),
+-                    message = function(x){return(x)})
+-    checkTrue(grepl('1:many', res$message))
+-
+-    res <- tryCatch(select(org.Hs.eg.db, k, 'ALIAS', 'ENTREZID'),
+-                    message = function(x){return(x)})
+-    checkTrue(grepl('many:many', res$message))
+-
+-    res <- tryCatch(select(org.Hs.eg.db, c('1','10'), 'SYMBOL', 'ENTREZID'),
+-                    message = function(x){return(x)})
+-    checkTrue(grepl('1:1', res$message))
+-}
+-
+-
+-## TODO: deal with any fallout from having new messages in select()
+-## This will also cause me to have to silence select() in many places
+-## to avoid annoying repeats of the
+-
+-
+-
+-test_dbconn_and_dbfile <- function(){
+-    resc <- dbconn(org.Hs.eg.db)
+-    m <- dbGetQuery(resc, "SELECT * FROM metadata")
+-    checkTrue(dim(m)[2] ==2)
+-    checkTrue(dim(m)[1] > 10)
+-              
+-    resf <- dbfile(org.Hs.eg.db)
+-    mf <- dbGetQuery(dbConnect(SQLite(), resf), "SELECT * FROM metadata")
+-    checkTrue(all(mf == m))
+-}
+-
+-
+-
+ 
+ ## Fast checking:
+ ## BiocGenerics:::testPackage(pattern="^test_select.*\\.R$")
+--- a/inst/unitTests/test_bimap.R
++++ /dev/null
+@@ -1,246 +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 at direction == -1)
+-  rmap2 <- revmap(map2)
+-  checkTrue(rmap2 at 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"]]
+-
+-  
+-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 )
+-}
+-
+-
+-
+-  checkEquals(res2, c("BP","CC","MF"))
+-}
+-
+-## 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_contents <- function(){
+-  res <- contents(map)
+-  checkEquals(names(res)[1], "1")
+-  checkEquals(res[[1]][1], "A1BG")
+-  checkTrue(length(res)>1000)
+-  
+-  res2 <- contents(map2)
+-  checkEquals(names(res2)[[1]], "1")
+-  checkEquals(res2[[1]], c("BP","CC","MF"))
+-  checkTrue(length(res2)>1000)
+-}
+-
+-
+-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,69 +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')
+-}
+-
+-## "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')
+-}
+-
+-
+-## 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,118 +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)
+-
+-.setUp <- function()
+-{
+-    if (!require(org.testing.db))
+-    {
+-        install.packages(system.file("extdata", "org.testing.db",
+-          package="AnnotationDbi"), repos=NULL,
+-          type="source", INSTALL_opts="--no-test-load")
+-        library(org.testing.db)
+-    }
+-    x <<- org.testing.db
+-    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")
+-}
+-
+-
+-## lower level tests (more useful)
+-test_keysLow <- function(){
+-    res <- unique(AnnotationDbi:::.noSchemaKeys(x, "CHROMOSOME"))
+-    checkTrue(all(sort(res) == sort(finchCsomes)))
+-}
+-
+-
+-test_selectLow <- function(){
+-    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(){
+-    res <- columns(x)
+-    checkTrue(all(sort(res) == sort(finchCols)))
+-}
+-
+-test_keytypes <- function(){
+-    res <- keytypes(x)
+-    checkTrue(all(sort(res) == sort(finchCols)))
+-}
+-
+-test_keys<- function(){                                          ## BOOM
+-    ## 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(){
+-    ## 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_inparanoid.R
++++ /dev/null
+@@ -1,175 +0,0 @@
+-## unit tests for methods associated with reactome.db
+-require(hom.Hs.inp.db)
+-i <- hom.Hs.inp.db
+-
+-## this tests on ones that I think will always be here (will not have their
+-## own pkg)
+-test_cols <- function(){
+-  res <- columns(i)
+-  checkTrue(length(res)==100)
+-  checkTrue("APIS_MELLIFERA" %in% res)
+-  checkTrue("ANOPHELES_GAMBIAE" %in% res)
+-  checkTrue("GIARDIA_LAMBLIA" %in% res)
+-  checkTrue("STRONGYLOCENTROTUS_PURPURATUS" %in% res)
+-}
+-
+-test_keytypes <- function(){
+-  res <- keytypes(i)
+-  checkTrue(length(res)==100)
+-  checkTrue("APIS_MELLIFERA" %in% res)
+-  checkTrue("ANOPHELES_GAMBIAE" %in% res)
+-  checkTrue("GIARDIA_LAMBLIA" %in% res)
+-  checkTrue("STRONGYLOCENTROTUS_PURPURATUS" %in% res)
+-  checkTrue("HOMO_SAPIENS" %in% res)
+-}
+-
+-test_keys <- function(){
+-  res <- head(keys(i, keytype="MUS_MUSCULUS"))
+-  checkTrue(length(res) > 0)
+-  checkTrue(is.character(res))
+-  checkTrue(length(res) == length(unique(res)))
+-  res2 <- head(keys(i, keytype="HOMO_SAPIENS"))
+-  checkTrue(length(res2) > 0)
+-  checkTrue(is.character(res2))
+-  checkTrue(length(res2) == length(unique(res2)))
+-}
+-
+-
+-
+-
+-## Tests ability to get one table/query out.
+-test_extractWithSimpleInpQuery <- function(){
+-  table <- "Bos_taurus" ## a table (in this case). (Could also be subquery)  
+-  k <-  head(keys(i, keytype="BOS_TAURUS"))
+-  keytype <- "BOS_TAURUS"
+-  baseSpecies <- AnnotationDbi:::.getBaseSpecies(i)
+-  baseFiveCode <- AnnotationDbi:::.getBaseFiveCode(baseSpecies)
+-  checkTrue(baseFiveCode=="HOMSA")
+-  fiveMap <- AnnotationDbi:::.makeFiveLetterMapping()
+-  res <- AnnotationDbi:::.extractWithSimpleInpQuery(i, table, k, keytype,
+-                                                    baseFiveCode, fiveMap)
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==2)
+-  checkIdentical(c("base.inp_id","BOSTA"), colnames(res))
+-
+-  ## Then check for next pass usages...
+-  mergeID <- "base.inp_id"
+-  mkeytype <- baseSpecies
+-  mergeKeys <- res[[mergeID]]
+-  table2 <- "Xenopus_tropicalis"
+-  res2 <- merge(res,
+-                AnnotationDbi:::.extractWithSimpleInpQuery(i, table2,
+-                                                           mergeKeys,
+-                                                           mkeytype,
+-                                                           baseFiveCode,
+-                                                           fiveMap),
+-                by.x=mergeID, by.y=mergeID,
+-                all.x=TRUE, all.y=TRUE)
+-
+-  checkTrue(dim(res2)[1]>0)
+-  checkTrue(dim(res2)[2]==3)
+-  checkIdentical(c("base.inp_id","BOSTA","XENTR"), colnames(res2))
+-}
+-
+-
+-
+-
+-## Test ability to pull data out in vectorized fashion
+-test_collateInpQueryResults <- function(){
+-  ## where keytype and cols are baseSpecies
+-  tables <- AnnotationDbi:::.UCToStandard(c("HOMO_SAPIENS",
+-                                            "MUS_MUSCULUS",
+-                                            "APIS_MELLIFERA"))
+-  checkIdentical(tables, c("Homo_sapiens","Mus_musculus","Apis_mellifera"))
+-  k <-  head(keys(i, keytype="HOMO_SAPIENS"), n=6)
+-  keytype <- "HOMO_SAPIENS"
+-  fiveMap <- AnnotationDbi:::.makeFiveLetterMapping()
+-  baseSpecies <- AnnotationDbi:::.getBaseSpecies(i)
+-  baseFiveCode <- AnnotationDbi:::.getBaseFiveCode(baseSpecies)
+-  res <- AnnotationDbi:::.collateInpQueryResults(i, tables, keys=k,
+-                                                 keytype,fiveMap,
+-                                                 baseFiveCode, baseSpecies)
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("HOMSA","MUSMU","APIME"), colnames(res))
+-
+-  ## where only the keytype is baseSpecies
+-  tables <- c("Homo_sapiens","Rattus_norvegicus","Apis_mellifera")
+-  res2 <- AnnotationDbi:::.collateInpQueryResults(i, tables, keys=k,
+-                                                 keytype,fiveMap,
+-                                                 baseFiveCode, baseSpecies)
+-  checkTrue(dim(res2)[1]>0)
+-  checkTrue(dim(res2)[2]==3)
+-  checkIdentical(c("HOMSA","RATNO","APIME"), colnames(res2))
+-
+-  ## where only a col is baseSpecies
+-  tables <- c("Mus_musculus","Rattus_norvegicus","Homo_sapiens")
+-  keytype <- "MUS_MUSCULUS"
+-  k <-  head(keys(i, keytype="MUS_MUSCULUS"), n=6)
+-  res3 <- AnnotationDbi:::.collateInpQueryResults(i, tables, keys=k,
+-                                                 keytype,fiveMap,
+-                                                 baseFiveCode, baseSpecies)
+-  checkTrue(dim(res3)[1]>0)
+-  checkTrue(dim(res3)[2]==4)
+-  checkIdentical(c("HOMSA","MUSMU","RATNO","HOMSA"), colnames(res3))
+-  
+-  ## neither keytype or col is the baseSpecies
+-  tables <- c("Mus_musculus","Rattus_norvegicus","Apis_mellifera")
+-  res4 <- AnnotationDbi:::.collateInpQueryResults(i, tables, keys=k,
+-                                                 keytype,fiveMap,
+-                                                 baseFiveCode, baseSpecies)
+-  checkTrue(dim(res4)[1]>0)
+-  checkTrue(dim(res4)[2]==4)
+-  checkIdentical(c("HOMSA","MUSMU","RATNO","APIME"), colnames(res4))
+-
+-}
+-
+-
+-
+-
+-
+-## and tests for select:
+-test_select_otherKeytype <- function(){
+-  k <- head(keys(i, "MUS_MUSCULUS"))
+-  c <- c("APIS_MELLIFERA","AEDES_AEGYPTI")
+-  res <-  select(i, keys=k, columns=c, keytype="MUS_MUSCULUS")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("MUS_MUSCULUS","AEDES_AEGYPTI", "APIS_MELLIFERA"),
+-                 colnames(res))
+-}
+-
+-test_select_baseSpeciesKeytype <- function(){
+-  k <- head(head(keys(i, keytype="HOMO_SAPIENS")))
+-  c <- c("APIS_MELLIFERA","MUS_MUSCULUS")
+-  res <-  select(i, keys=k, columns=c, keytype="HOMO_SAPIENS")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("HOMO_SAPIENS","APIS_MELLIFERA","MUS_MUSCULUS"),
+-                 colnames(res))
+-}
+-
+-test_select_baseSpeciesKeytype <- function(){
+-  k <- head(head(keys(i, keytype="HOMO_SAPIENS")))
+-  c <- c("APIS_MELLIFERA","HOMO_SAPIENS")
+-  res <-  select(i, keys=k, columns=c, keytype="HOMO_SAPIENS")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==2)
+-  checkIdentical(c("HOMO_SAPIENS","APIS_MELLIFERA"),
+-                 colnames(res))
+-}
+-
+-
+-test_select_baseSpeciesCols <- function(){
+-  k <- head(keys(i, "MUS_MUSCULUS"))
+-  c <- c("APIS_MELLIFERA","HOMO_SAPIENS")
+-  res <-  select(i, keys=k, columns=c, keytype="MUS_MUSCULUS")
+-  checkTrue(dim(res)[1]>0)
+-  checkTrue(dim(res)[2]==3)
+-  checkIdentical(c("MUS_MUSCULUS","APIS_MELLIFERA","HOMO_SAPIENS"),
+-                 colnames(res))
+-}
+-
+-
+-
+-
+--- 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)

Added: trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/series
===================================================================
--- trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/series	                        (rev 0)
+++ trunk/packages/R/r-bioc-annotationdbi/trunk/debian/patches/series	2016-10-26 14:39:01 UTC (rev 22909)
@@ -0,0 +1 @@
+exclude_tests_requiring_large_databases.patch

Modified: trunk/packages/R/r-bioc-annotationdbi/trunk/debian/rules
===================================================================
--- trunk/packages/R/r-bioc-annotationdbi/trunk/debian/rules	2016-10-26 13:58:24 UTC (rev 22908)
+++ trunk/packages/R/r-bioc-annotationdbi/trunk/debian/rules	2016-10-26 14:39:01 UTC (rev 22909)
@@ -1,4 +1,4 @@
 #!/usr/bin/make -f
 
-debRreposname=bioc
-include /usr/share/R/debian/r-cran.mk
+%:
+	dh $@ --buildsystem R

Added: trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/control
===================================================================
--- trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/control	                        (rev 0)
+++ trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/control	2016-10-26 14:39:01 UTC (rev 22909)
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, r-bioc-go.db
+Restrictions: allow-stderr

Added: trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/run-unit-test
===================================================================
--- trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/run-unit-test	                        (rev 0)
+++ trunk/packages/R/r-bioc-annotationdbi/trunk/debian/tests/run-unit-test	2016-10-26 14:39:01 UTC (rev 22909)
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+LC_ALL=C R --no-save <<EOT
+require("AnnotationDbi") || stop("unable to load AnnotationDbi package")
+AnnotationDbi:::.test()
+## fast checking:
+## BiocGenerics:::testPackage(pattern="^test_select.*\\.R$")
+EOT




More information about the debian-med-commit mailing list