[Bioc-devel] makeAnnDbPkg (AnnotationDbi)
James F. Reid
james.reid at ifom-ieo-campus.it
Thu Mar 11 22:49:06 CET 2010
Dear list,
I am building a custom annotation package using AnnotationDbi and I have
run into problems using a template package structure that does not
belong to the the ones supplied under AnnotatioDbi/inst.
For example:
makeAnnDbPkg(myseed, mydbfile, dest_dir = tempdir())
gives
Error in createPackage(x at Package, destinationDir = dest_dir, originDir =
template_path, : 'originDir' must be a directory ()
This is because 'myseed' contains a PkgTemplate pointing to my custom
directory "/myhome/template/mydb".
The devel version of AnnotationDbi (v. 1.9.4) is doing this to assign
the path to the template directory:
if (!grepl("^/", x at PkgTemplate)[1]) {
template_path <- system.file("AnnDbPkg-templates",
x at PkgTemplate,
package="AnnotationDbi")
} else {
template_path <- x at PkgTemplate
}
Another point related to this issue of providing custom pointers for
annotation packages is the function mydb_dbschema() which only works if
the schema is present under Annotation/inst/DBSchemas/, I had to
substitute the code with the following:
@ANNOBJPREFIX at _dbschema <- function() {
x <- dbconn(datacache)
schema <- dbmeta(x, "DBSCHEMA")
version <- dbmeta(x, "DBSCHEMAVERSION")
cat(readLines(system.file("DBschemas",
paste("schemas_", version, sep=""),
paste(schema, ".sql", sep=""),
package=sprintf("%s.db",
"@ANNOBJPREFIX@"))),
sep="\n")
}
Best,
James.
More information about the Bioc-devel
mailing list