Entering edit mode
Amanda Miotto
▴
120
@amanda-miotto-2933
Last seen 10.2 years ago
When trying to alter GenomeGraphs so that it queries a local mysql
database
instead of ensembl_mart, I get the following error. Why? What is chunk
4? and
is it due to ens not being classed correctly?
Thankyou.
sudo R --verbose CMD build MyGenomeGraphs
......
* DONE (GenomeGraphs)
* creating vignettes ... ERROR
Loading required package: biomaRt
Loading required package: RCurl
Loading required package: grid
Loading required package: DBI
Error: processing vignette 'GenomeGraphs.Rnw' failed with diagnostics:
chunk 4
Error in ens[i, 5] - ens[i, 4] : non-numeric argument to binary
operator
Execution halted
The additional code I included was in GenomeGraphs-classes.R
----------------------------------------------------------------------
-----------------
######################################################################
#######################################################
setMethod("initialize", "Gene", function(.Object, ...){
.Object <- callNextMethod()
library(RMySQL)
con <- dbConnect(MySQL(),host="", user="", dbname="", password="")
q1<-("select * from alldata where " )
q3<-("=")
p4<-("'")
.Object at ens<-dbGetQuery(con, paste(q1,.Object at type,q3,p4,.Object
at id,p4,
sep=""))
dbDisconnect(con)
# .Object at ens <-
getBM(c("ensembl_gene_id","structure_transcript_stable_id","structure_
exon_stable_id",
# "structure_exon_chrom_start","structure_exo
n_chrom_end","structure_exon_rank",
# "structure_transcript_chrom_strand",
"structure_biotype"),
# filters = .Object at type, values=.Object at
id,
mart=.Object at biomart)
######################################################################
#####################################################
----------------------------------------------------------------------
-------------------
######################################################################
#######################################################
if (!is.null(.Object at biomart)) {
library(RMySQL)
con <- dbConnect(MySQL(),host="", user="", dbname="", password="")
q1<-("select * from alldata where structure_transcript_chrom_strand ="
)
q3<-("and exon_chrom_start<")
q4<-("and exon_chrom_end>")
q5<-("and structure_strand=")
p4<-("'")
.Object at ens<-dbGetQuery(con,
paste(q1,.Object at chromosome,q3,.Object at start,q4,.Object at
end,q5,p4,strand,p4,
sep=""))
dbDisconnect(con)
# .Object at ens <-
getBM(c("ensembl_gene_id","structure_transcript_stable_id",
# "structure_exon_stable_id","structure_e
xon_chrom_start","structure_exon_chrom_end",
# "structure_exon_rank",
"structure_transcript_chrom_strand","structure_biotype"),
#
filters=c("chromosome_name", "start", "end", "strand"),
#
values=list(.Object at chromosome,.Object at start, .Object at end,
strand),
# mart=.Object at biomart)
}
######################################################################
######################################################
----------------------------------------------------------------------
--------------------------
######################################################################
###################################################
library(RMySQL)
con <- dbConnect(MySQL(),host="", user="", dbname="", password="")
q1<-("select * from alldata where " )
q3<-("='")
p4<-("'")
.Object at ens<-dbGetQuery(con, paste(q1,.Object at type,q3,.Object at
id,p4, sep=""))
dbDisconnect(con)
# .Object at ens <-
getBM(c("ensembl_gene_id","structure_transcript_stable_id","structure_
exon_stable_id",
# "structure_exon_chrom_start","structure_exon_
chrom_end","structure_exon_rank",
#
"structure_transcript_chrom_strand","structure_biotype"),
# filters = .Object at type,
values=.Object at id,mart=.Object at biomart)
######################################################################
####################################################