This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error in txdb workflow

Hi,

I am practicing "making and utilizing TxDb objects". It produces the following error. Any advise is appreciated.

> library("GenomicFeatures")
> samplefile <- system.file("extdata", "hg19_knownGene_sample.sqlite",
                          package="GenomicFeatures")
> txdb <- loadDb(samplefile)
> seqlevels(txdb, force=T) <- c("chr15")
> keys <- c("100033416", "100033417", "100033420")
> select(txdb, keys=keys, columns="TXNAME", keytype="GENEID")

Error in .testForValidKeys(x, keys, keytype) :
  None of the keys entered are valid keys for 'GENEID'. Please use the keys method to see a listing of valid arguments.

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252  
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                         
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils   
[7] datasets  methods   base     

other attached packages:
[1] GenomicFeatures_1.18.3 biomaRt_2.22.0       
[3] AnnotationDbi_1.28.1   Biobase_2.26.0       
[5] GenomicRanges_1.18.4   GenomeInfoDb_1.2.4   
[7] IRanges_2.0.1          S4Vectors_0.4.0      
[9] BiocGenerics_0.12.1   

loaded via a namespace (and not attached):
[1] base64enc_0.1-2         BatchJobs_1.5         
[3] BBmisc_1.8              BiocParallel_1.0.0    
[5] Biostrings_2.34.1       bitops_1.0-6          
[7] brew_1.0-6              checkmate_1.5.1       
[9] codetools_0.2-10        DBI_0.3.1             
[11] digest_0.6.8            fail_1.2              
[13] foreach_1.4.2           GenomicAlignments_1.2.1
[15] iterators_1.0.7         RCurl_1.95-4.5        
[17] Rsamtools_1.18.2        RSQLite_1.0.0         
[19] rtracklayer_1.26.2      sendmailR_1.2-1       
[21] stringr_0.6.2           tools_3.1.2           
[23] XML_3.98-1.1            XVector_0.6.0         
[25] zlibbioc_1.12.0        
r select txdb

1 answer

That step is actually meant to be run after:

library(TxDb.Hsapiens.UCSC.hg19.knownGene)

The example database lacks the keys in the example.

Thanks a bunch!

Log in to answer this question.