Entering edit mode
Julian Lee
▴
10
@julian-lee-4101
Last seen 10.2 years ago
hi all,
I'm building a custom annotation service, and have encountered the
following
problems.
Upon Reading the SQLForge.pdf vignette, i decided that i would not
choose to
use these functions
popHUMANCHIPDB
populateDB
but instead build my own SQLite Database following the Database Schema
Version 1.0 described in
AnnotationDbi/inst/DBschemas/schemas_1.0/HUMANCHIP_DB.sql
The SQLite Database was initiated by the following R code
*library(AnnotationDbi)
library(RSQLite)
filename<-'myCustomChip.sqlite'
drv<-dbDriver('SQLite')
db<-dbConnect(drv,dbname=filename)
##Create SQLite Database
create.sql <- readLines('HUMANCHIP_DB.sql')
create.sql <- paste(collapse="\n", create.sql)
create.sql <- strsplit(create.sql, ";")[[1]]
create.sql <- create.sql[-length(create.sql)]
database <- sapply(create.sql, function(x) sqliteQuickSQL(db, x))*
Subsequently, the following tables were populated according to the
rules
stated
Genes
Probes
Alias
Ensembl
Chromosomes
Chromosomes_Locations
Cytogenetic_Locations
Gene_Info
Refseq
Unigene
MetaData Tables were populated as follows. Other tables, go, ec, etc
were
left empty
*metadata<-rbind(c("DBSCHEMA", "HUMANCHIP_DB"),
c("ORGANISM", "Homo sapiens"),
c("SPECIES", "Human"),
c("DBSCHEMAVERSON", "1.0"),
c("MANUFACTURER","AFFYMETRIX"),
c("CHIPNAME","HG-U133_Plus_2"),
c("MANUFACTURERURL","http://www.affymetrix.com"))
q11<- paste(sep="", 'INSERT INTO "metadata" VALUES("', metadata[,1],
'", "', metadata[,2], '");')
database<- sapply(q11, function(x) sqliteQuickSQL(db,x))
map.counts<-rbind(c("GENES", nrow(idtable)),
c("PROBES", nrow(finalprobes)),
c("ALIAS", nrow(alias)),
c("ENSEMBL", nrow(ensembl)),
c("CHROMOSOMES", nrow(chromosomes)),
c("CHROMOSOME_LOCATIONS",
nrow(chromosome_location)),
c("CYTOGENETIC_LOCATIONS", nrow(cytoband)),
c("GENE_INFO", nrow(gene_info)),
c("REFSEQ", nrow(refseq)),
c("UNIGENE", nrow(unigene)))
q12<- paste(sep="", 'INSERT INTO "map_counts" VALUES("',
map.counts[,1],
'",' , map.counts[,2], ');') *
*database<- sapply(q12, function(x) sqliteQuickSQL(db,x)) *
*map.metadata<-rbind(c("GENES", "XXXX", "TST612", "26 MAY 2010"),
c("PROBES", "XXXX", "TST612", "26 MAY 2010"),
c("ALIAS", "XXXX", "TST612", "26 MAY 2010"),
c("ENSEMBL", "XXXX", "TST612", "26 MAY 2010"),
c("CHROMOSOMES", "XXXX", "TST612", "26 MAY 2010"),
c("CHROMOSOME_LOCATIONS", "XXXX", "TST612", "26 MAY
2010"),
c("CYTOGENETIC_LOCATIONS", "XXXX", "TST612", "26 MAY
2010"),
c("GENE_INFO", "XXXX", "TST612", "26 MAY 2010"),
c("REFSEQ", "XXXX", "TST612", "26 MAY 2010"),
c("UNIGENE", "XXXX", "TST612", "26 MAY 2010"))*
*
q13<- paste(sep="", 'INSERT INTO "map_metadata" VALUES("',
map.metadata[,1],
'", "', map.metadata[,2], '","', map.metadata[,3], '","',
map.metadata[,4], '");')
database <- sapply(q13, function(x) sqliteQuickSQL(db,x))*
Upon completion of populating the SQLite Database, i then proceeded to
build
my custom annotationDBI.db package.
*seed <- new("AnnDbPkgSeed",
Package = "myCustomChip.db",
Version = "1.0-0",
PkgTemplate = "HUMANCHIP.DB",
AnnObjPrefix = "myCustomChip",
Title = "MyCustom Annotation for HG-U133PLUS2",
Author = "Annotation Services",
Maintainer = "Julian Lee <julianlhe@gmail.com>",
organism = "Homo sapiens",
species = "Human",
biocViews = "AnnotationData, FunctionalAnnotation",
DBschema = "HUMANCHIP_DB",
)
system("rm -rf myCustomChip.db")
makeAnnDbPkg(seed, filename, dest.dir=getwd(),no.man=F)*
and got the following errors
*Error in cpSubsCon(src[k], destname) :
trying to replace @ACCNUMSOURCE@ by an NA*
I'm trying to figure out where @ACCNUMSOURCE@ is used, and i can't
quite
find it. There's some mention of it in the man *.Rd pages, but can't
quite
get to it.
Much help in getting to the bottom of this would help.
Thank you very much
Julian Lee
*> sessionInfo()
R version 2.10.1 (2009-12-14)
x86_64-unknown-linux-gnu
locale:
[1] LC_CTYPE=en_US LC_NUMERIC=C LC_TIME=en_US
[4] LC_COLLATE=en_US LC_MONETARY=C LC_MESSAGES=en_US
[7] LC_PAPER=en_US LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RSQLite_0.8-4 DBI_0.2-5 AnnotationDbi_1.8.2
[4] Biobase_2.6.1
loaded via a namespace (and not attached):
[1] tools_2.10.1
*
*Acknowledgements for some scripts to get me started*
Computational Biology Group
Department of Medical Genetics <http: www.unil.ch="" dgm="">, University of
Lausanne <http: www.unil.ch=""/>
http://www2.unil.ch/cbg/index.php?title=Building_BioConductor_Annotati
on_Packages
[[alternative HTML version deleted]]