[med-svn] r20124 - trunk/packages/R/r-bioc-genomicfeatures/trunk/debian/patches
Andreas Tille
tille at moszumanska.debian.org
Thu Sep 24 18:23:25 UTC 2015
Author: tille
Date: 2015-09-24 18:23:24 +0000 (Thu, 24 Sep 2015)
New Revision: 20124
Modified:
trunk/packages/R/r-bioc-genomicfeatures/trunk/debian/patches/drop_tests_requiring_large_data_sets.patch
Log:
Commit as uploaded
Modified: trunk/packages/R/r-bioc-genomicfeatures/trunk/debian/patches/drop_tests_requiring_large_data_sets.patch
===================================================================
--- trunk/packages/R/r-bioc-genomicfeatures/trunk/debian/patches/drop_tests_requiring_large_data_sets.patch 2015-09-24 18:23:01 UTC (rev 20123)
+++ trunk/packages/R/r-bioc-genomicfeatures/trunk/debian/patches/drop_tests_requiring_large_data_sets.patch 2015-09-24 18:23:24 UTC (rev 20124)
@@ -123,420 +123,3 @@
- checkTrue(all(is.na(mcols(promoter.seqs)$geneID)))
-}
-
---- a/inst/unitTests/test_select-methods.R
-+++ b/inst/unitTests/test_select-methods.R
-@@ -3,65 +3,14 @@
- ## Why test the lower level helpers? Because that way I will get a failure
- ## point right at the location where the trouble occurs (high resolution for
- ## trouble detection)._
--require("TxDb.Hsapiens.UCSC.hg19.knownGene")
--txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
- require("RUnit")
-
--test_getTableColMapping <- function(){
-- res <- GenomicFeatures:::.getTableColMapping(txdb)
-- exp <- list(cds=c("_cds_id","cds_name","cds_chrom","cds_strand","cds_start",
-- "cds_end"),
-- exon=c("_exon_id","exon_name","exon_chrom","exon_strand",
-- "exon_start","exon_end"),
-- gene=c("gene_id","_tx_id"),
-- splicing=c("_tx_id","exon_rank","_exon_id","_cds_id"),
-- transcript=c("_tx_id","tx_name","tx_chrom","tx_strand",
-- "tx_start","tx_end"))
-- checkIdentical(res, exp)
--}
--
--test_makeColAbbreviations <- function(){
-- res <- GenomicFeatures:::.makeColAbbreviations(txdb)
-- checkTrue(res[["_cds_id"]]=="CDSID")
-- res2 <- GenomicFeatures:::.getTableColMapping(txdb)
-- checkTrue(length(res)==20, length(unique(unlist(res2))))
--}
--
--test_reverseColAbbreviations <- function(){
-- cnames <- GenomicFeatures:::.makeColAbbreviations(txdb)
-- res <- GenomicFeatures:::.reverseColAbbreviations(txdb, cnames)
-- checkTrue(names(cnames)[[1]]==res[[1]])
-- checkTrue(length(res) == length(cnames))
--}
--
--test_getTableNames <- function(){
-- cnames <- GenomicFeatures:::.makeColAbbreviations(txdb)
-- res <- GenomicFeatures:::.getTableNames(txdb, cnames)
-- ## Let's check the ones that fail more easily
-- checkTrue(length(res[["_tx_id"]])==3)
-- checkTrue(length(res[["_exon_id"]])==2)
-- checkTrue(length(res[["_cds_id"]])==2)
--}
--
--test_getSimpleTableNames <- function(){
-- cnames <- GenomicFeatures:::.makeColAbbreviations(txdb)
-- res <- GenomicFeatures:::.getSimpleTableNames(txdb, cnames)
-- exp <- c("cds","splicing","exon","gene","transcript")
-- checkIdentical(res, exp)
--}
--
- test_encodeSortedTableKey <- function(){
- sTNames <- c("s", "e", "t")
- res <- GenomicFeatures:::.encodeSortedTableKey(sTNames)
- checkIdentical(res,"tse")
- }
-
--test_makeTableKey <- function(){
-- cnames <- GenomicFeatures:::.makeColAbbreviations(txdb)
-- res <- GenomicFeatures:::.makeTableKey(txdb, cnames)
-- checkIdentical(res,"gtsec")
--}
--
- test_missingTableInterpolator <- function(){
- tName <- "x"
- res <- GenomicFeatures:::.missingTableInterpolator(tName)
-@@ -82,231 +31,4 @@ test_tableJoinSelector <- function(){
- checkException(GenomicFeatures:::.tableJoinSelector(tName))
- }
-
--test_makeSelectList <- function(){
-- cnames <- GenomicFeatures:::.makeColAbbreviations(txdb)[c("_cds_id","_tx_id")]
-- res <- GenomicFeatures:::.makeSelectList(txdb, cnames)
-- exp <- "c._cds_id, g._tx_id" ## 2nd one will be a "g."
-- checkIdentical(res, exp)
--}
--
--test_makeAsList <- function(){
-- cnames <- GenomicFeatures:::.makeColAbbreviations(txdb)[c("_cds_id","_tx_id")]
-- res <- GenomicFeatures:::.makeAsList(txdb, cnames)
-- exp <- "cds AS c, splicing AS s, gene AS g, transcript AS t"
-- checkIdentical(res, exp)
--}
--
--test_makeJoinSQL <- function(){
-- cnames <- GenomicFeatures:::.makeColAbbreviations(txdb)[c("_cds_id","_tx_id")]
-- res <- GenomicFeatures:::.makeJoinSQL(txdb, cnames)
-- exp <- "(SELECT * FROM transcript LEFT JOIN gene ON (transcript._tx_id = gene._tx_id) INNER JOIN splicing ON (transcript._tx_id = splicing._tx_id) LEFT JOIN cds ON (splicing._cds_id = cds._cds_id) )"
-- checkIdentical(res, exp)
--}
--
--test_makeKeyList <- function(){
-- ks <- 1:6
-- kt <- "TXID"
-- res <- GenomicFeatures:::.makeKeyList(txdb, keys=ks, keytype=kt)
-- exp <- "g._tx_id IN ( '1','2','3','4','5','6' )"
-- checkIdentical(res, exp)
--}
--
--
--test_keys <- function(){
-- checkException(keys(txdb, keytype="CDSCHROM"))
--}
--
--test_keys_advancedArgs <- function(){
-- k1 <- keys(txdb, keytype="TXNAME")
-- checkTrue("uc001aaa.3" %in% k1)
--
-- k2 <- keys(txdb, keytype="TXNAME", pattern=".2$")
-- checkTrue("uc001aaq.2" %in% k2)
-- checkTrue(!("uc001aaa.3" %in% k2))
-- checkTrue(length(k2) < length(k1))
--
-- l1 <- length(keys(txdb, keytype="TXID", column="GENEID"))
-- l2 <- length(keys(txdb, keytype="TXID"))
-- checkTrue(l1 < l2)
--
-- k3 <- head(keys(txdb, keytype="GENEID", pattern=".2$",
-- column="TXNAME", fuzzy=TRUE))
-- res <- suppressWarnings( select(txdb, k3, columns=c("GENEID","TXNAME"),
-- keytype="GENEID"))
-- checkTrue(any(grepl(".2$",res$TXNAME)))
--}
--
--
--
--test_select <- function(){
-- keys = head(keys(txdb, "GENEID"))
-- cols = c("GENEID")
-- res <- select(txdb, keys, cols, keytype="GENEID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("GENEID"), colnames(res))
-- checkTrue(length(res$GENEID)==length(keys))
-- checkIdentical(res$GENEID, keys)
--
-- keys = head(keys(txdb, "TXID"))
-- cols = c("TXID")
-- res <- select(txdb, keys, cols, keytype="TXID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("TXID"), colnames(res))
-- checkTrue(length(res$TXID)==length(keys))
-- checkIdentical(res$TXID, keys)
--
-- keys = head(keys(txdb, "GENEID"))
-- cols = c("GENEID","TXID")
-- res <- select(txdb, keys, cols, keytype="GENEID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("GENEID","TXID"), colnames(res))
-- checkTrue(length(unique(res$GENEID))==length(keys))
--
-- keys = head(keys(txdb, "GENEID"))
-- cols = c("GENEID","TXID", "EXONRANK")
-- res <- select(txdb, keys, cols, keytype="GENEID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("GENEID","TXID","EXONRANK"), colnames(res))
-- checkTrue(length(unique(res$GENEID))==length(keys))
--
-- keys = head(keys(txdb, "GENEID"))
-- cols = c("GENEID","TXID", "EXONRANK","CDSID")
-- res <- select(txdb, keys, cols, keytype="GENEID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("GENEID","CDSID","TXID","EXONRANK"), colnames(res))
-- checkTrue(length(unique(res$GENEID))==length(keys))
--
-- ## It's really cosmetic but: should the order of the final data.frame match
-- ## the order of the cols?
-- ## I think so, except that we may add a col for keys (even if not requested)
-- ## if added, such a col should be in front.
--
-- keys = head(keys(txdb, "GENEID"))
-- cols = c("GENEID","TXID", "EXONRANK", "EXONID")
-- res <- select(txdb, keys, cols, keytype="GENEID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("GENEID","EXONID","TXID","EXONRANK"), colnames(res))
-- checkTrue(length(unique(res$GENEID))==length(keys))
--
-- keys = head(keys(txdb, "GENEID"))
-- cols = c("GENEID","TXID", "EXONRANK", "EXONID", "CDSID")
-- res <- select(txdb, keys, cols, keytype="GENEID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("GENEID","CDSID","EXONID","TXID","EXONRANK"), colnames(res))
-- checkTrue(length(unique(res$GENEID))==length(keys))
--
-- keys = head(keys(txdb, "TXID"))
-- cols = c("TXID", "EXONRANK", "EXONID", "CDSID")
-- res <- select(txdb, keys, cols, keytype="TXID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("TXID","CDSID","EXONID","EXONRANK"), colnames(res))
-- checkTrue(length(unique(res$TXID))==length(keys))
--
-- keys = head(keys(txdb, "EXONID"))
-- cols = c("EXONRANK", "EXONID", "CDSID")
-- res <- select(txdb, keys, cols, keytype="EXONID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("EXONID","CDSID","EXONRANK"), colnames(res))
-- checkTrue(length(unique(res$EXONID))==length(keys))
--
-- keys = head(keys(txdb, "TXNAME"))
-- cols = c("GENEID","TXNAME", "CDSID", "EXONSTART")
-- res <- select(txdb, keys, cols, keytype="TXNAME")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("TXNAME","CDSID","EXONSTART","GENEID"), colnames(res))
-- checkTrue(length(unique(res$TXNAME))==length(keys))
--
--
-- keys = head(keys(txdb, "TXNAME"))
-- cols = c("GENEID", "EXONSTART","TXNAME")
-- res <- select(txdb, keys, cols, keytype="TXNAME")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("TXNAME","EXONSTART","GENEID"), colnames(res))
-- checkTrue(length(unique(res$TXNAME))==length(keys))
--
--
-- keys = head(keys(txdb, "TXNAME"))
-- cols = c("GENEID", "CDSID","TXNAME")
-- res <- select(txdb, keys, cols, keytype="TXNAME")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("TXNAME","CDSID","GENEID"), colnames(res))
-- checkTrue(length(unique(res$TXNAME))==length(keys))
--
--
-- keys = head(keys(txdb, "TXID"))
-- cols = c("GENEID","TXNAME", "TXID")
-- res <- select(txdb, keys, cols, keytype="TXID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("TXID","GENEID","TXNAME"), colnames(res))
-- checkTrue(length(unique(res$TXID))==length(keys))
-- ## For this particular case, we want to make sure that the TXNAMES are not
-- ## being copied (there should be one unique one for each ID in this range)
-- checkTrue(length(unique(res$TXNAME)) == length(res$TXNAME))
--
-- keys = head(keys(txdb, "CDSNAME"))
-- cols = c("GENEID","TXNAME", "TXID", "CDSNAME")
-- checkException(select(txdb, keys, cols, keytype="CDSNAME"), silent=TRUE)
--
-- keys = head(keys(txdb, "CDSID"))
-- cols = c("GENEID","TXNAME", "TXID", "CDSNAME")
-- res <- select(txdb, keys, cols, keytype="CDSID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols)+1) ## this is one where we ADD an extra!
-- checkIdentical(c("CDSID","CDSNAME","GENEID","TXID","TXNAME"), colnames(res))
-- checkTrue(length(unique(res$CDSID))==length(keys))
--
--
-- ## stress test (this used to take way too long)
-- keys = head(keys(txdb, "GENEID"))
-- cols = c("GENEID","CDSSTART")
-- res <- select(txdb, keys, cols, keytype="GENEID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("GENEID","CDSSTART"), colnames(res))
--
--}
--
--test_select_isActiveSeq <- function(){
--
-- ## set isActiveSeq to only watch chr1
-- txdb <- restoreSeqlevels(txdb) ## This is to reset things (safety measure)
-- isActiveSeq(txdb)[seqlevels(txdb)] <- FALSE
-- isActiveSeq(txdb) <- c("chr1"=TRUE)
--
-- ## then use select
-- keys <- head(keys(txdb, "GENEID"))
-- cols <- c("GENEID","CDSSTART", "CDSCHROM")
-- res <- select(txdb, keys, columns = cols, keytype="GENEID")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("GENEID","CDSCHROM","CDSSTART"), colnames(res))
-- uniqChrs <- unique(res$CDSCHROM)[!is.na(unique(res$CDSCHROM))]
-- checkIdentical(c("chr1"),uniqChrs)
--
-- ## keys must contain keys that match to more than one thing
-- keys <- c(head(keys(txdb,keytype="TXNAME")),
-- tail(keys(txdb,keytype="TXNAME")))
-- cols <- c("TXNAME","TXCHROM","TXSTRAND")
-- res <- select(txdb, keys, columns = cols, keytype="TXNAME")
-- checkTrue(dim(res)[1]>0)
-- checkTrue(dim(res)[2]==length(cols))
-- checkIdentical(c("TXNAME","TXCHROM","TXSTRAND"), colnames(res))
-- uniqChrs <- unique(res$TXCHROM)[!is.na(unique(res$TXCHROM))]
-- checkIdentical(c("chr1"),uniqChrs)
--}
--
--
-
---- a/inst/unitTests/test_TranscriptDb_seqinfo.R
-+++ /dev/null
-@@ -1,114 +0,0 @@
--library(TxDb.Hsapiens.UCSC.hg19.knownGene);
--txdb=TxDb.Hsapiens.UCSC.hg19.knownGene
--
--test_rename_seqlevels <- function(){
-- seqlevels(txdb) <- as.character(1:length(seqlevels(txdb)))
-- checkIdentical(as.character(1:length(seqlevels(txdb))),
-- seqlevels(txdb))
--}
--
--test_restrict_seqlevels <- function(){
-- ## This should work
-- txdb <- restoreSeqlevels(txdb)
-- seqlevels(txdb, force=TRUE) <- c(chr5 = "5")
-- checkTrue(length(seqinfo(txdb))==1)
--
-- ## This should work
-- txdb <- restoreSeqlevels(txdb)
-- seqlevels(txdb, force=TRUE) <- c(chr5 = "5", chr6="6", chr4="4")
-- checkTrue(length(seqinfo(txdb))==3)
-- checkIdentical(c('5','6','4'), seqlevels(txdb))
-- checkTrue(seqlengths(txdb)[2] == min(seqlengths(txdb)))
-- checkTrue(seqlengths(txdb)[3] == max(seqlengths(txdb)))
--
-- ## And this should NOT work
-- txdb <- restoreSeqlevels(txdb)
-- checkException(seqlevels(txdb, force=TRUE) <- c(foo = "2"))
--}
--
--
--test_noChange_circ <- function(){
-- txdb <- restoreSeqlevels(txdb)
-- foo = seqinfo(txdb)
-- foo at is_circular = rep(TRUE, 93)
-- ## This should throw an exception
-- checkException(seqinfo(txdb, new2old=1:93) <- foo)
--}
--
--
--test_noChange_genome <- function(){
-- txdb <- restoreSeqlevels(txdb)
-- foo = seqinfo(txdb)
-- foo at genome = rep("hg18", 93)
-- ## This should throw an exception
-- checkException(seqinfo(txdb, new2old=1:93) <- foo)
--}
--
--
--test_noChange_lengths <- function(){
-- txdb <- restoreSeqlevels(txdb)
-- foo = seqinfo(txdb)
-- foo at seqlengths = rep(1000L, 93)
-- ## This should throw an exception
-- checkException(seqinfo(txdb, new2old=1:93) <- foo)
--}
--
--
--test_transcripts_accessor <- function(){
-- txdb <- restoreSeqlevels(txdb)
-- txs1 <- transcripts(txdb)
-- seqlevels(txs1, force=TRUE) <- c(chr5 = "5")
-- ## Then change seqlevels for txdb
-- seqlevels(txdb, force=TRUE) <- c(chr5 = "5")
-- txs2 <- transcripts(txdb)
-- checkIdentical(txs1, txs2)
--}
--
--test_exons_accessor <- function(){
-- txdb <- restoreSeqlevels(txdb)
-- exs1 <- exons(txdb)
-- seqlevels(exs1, force=TRUE) <- c(chr5 = "5")
-- ## Then change seqlevels for txdb
-- seqlevels(txdb, force=TRUE) <- c(chr5 = "5")
-- exs2 <- exons(txdb)
-- checkIdentical(exs1, exs2)
--}
--
--test_cds_accessor <- function(){
-- txdb <- restoreSeqlevels(txdb)
-- cds1 <- cds(txdb)
-- seqlevels(cds1, force=TRUE) <- c(chr5 = "5")
-- ## Then change seqlevels for txdb
-- seqlevels(txdb, force=TRUE) <- c(chr5 = "5")
-- cds2 <- cds(txdb)
-- checkIdentical(cds1, cds2)
--}
--
--test_promoters_accessor <- function(){
-- txdb <- restoreSeqlevels(txdb)
-- prm1 <- promoters(txdb)
-- seqlevels(prm1, force=TRUE) <- c(chr5 = "5")
-- ## Then change seqlevels for txdb
-- seqlevels(txdb, force=TRUE) <- c(chr5 = "5")
-- prm2 <- promoters(txdb)
-- checkIdentical(prm1, prm2)
--}
--
--
--test_transcriptsBy_accessors <- function(){
-- ## This one is a "fun" one.
-- ## There are issues because some genes are annotated as being on
-- ## TWO different chromosomes. Such genes are filtered for txs3,
-- ## but NOT for txs4... Hmmmm.
-- txdb <- restoreSeqlevels(txdb)
-- txs3 <- transcriptsBy(txdb, by="gene")
-- seqlevels(txs3, force=TRUE) <- c(chr5 = "5")
-- ## Then change seqlevels for txdb
-- seqlevels(txdb, force=TRUE) <- c(chr5 = "5")
-- txs4 <- transcriptsBy(txdb, by="gene")
--## checkIdentical(txs3, txs4) ## TROUBLE!!
--
--}
--
--
--## What to do about this? The reason for the difference is because of order of operations. txs3 gets all the ranges and then removes any that are not kosher (this is correct), txs4 OTOH gets only ranges from chr5 (efficient!), but then fails to filter out things that have hybrid seqnames (as they were pre-filtered). I think I have to make the query less efficient to fix this, but I want to discuss it with Herve 1st to get a 2nd opinion.
More information about the debian-med-commit
mailing list