[BioC] GenomeGraphs alternate input

James Bullard bullard at berkeley.edu
Tue Aug 19 19:58:00 CEST 2008


Hi Amanda,

chunk 4 is a the 4th code chunk of the Sweave document (the vignette).  
When you build the package you are building the document: inst/docs/ 
GenomeGraphs.Rnw. It seems that what is happening is that you are not  
passing in a valid data.frame for the construction of the Gene object.  
Under the current code you have below of modifying the code directly  
(which is not really advisable, you should rather subclass Gene, but  
that is not important here) it would be helpful to see what the  
data.frame returned from your sql queries are. I would imagine that  
you could query the biomaRt servers with the same query (or  
equivalent) and see what the difference is. If you could send me a  
head of the following snippet of your code, I could probably see what  
is going on.

> dbGetQuery(con, paste(q1,.Object at type,q3,p4,.Object at id,p4,
> sep=""))

and then we can compare this to what getBM returns - i am guessing we  
are not getting numbers for start and end positions.

jim



On Aug 18, 2008, at 8:54 PM, Amanda Miotto wrote:

> 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_exon_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_exon_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)
> ##########################################################################################################################
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor



More information about the Bioconductor mailing list