[BioC] problems when trying to use biomaRt

Jenny Drnevich drnevich at illinois.edu
Wed Mar 17 15:18:10 CET 2010


I did the debugging on useDataset, and it stopped here:

Browse[2]> martAttributes(mart) <- bmAttrFilt("attributes", mart)

I then started a fresh session and tried

 > debug(biomaRt:::bmAttrFilt)

Within bmAttrFilt(), it stopped here:

Browse[2]> attrfilt = bmRequest(request)

bmRequest() is very simple:

 > biomaRt:::bmRequest
function (request)
{
     result = tryCatch(getURL(request), error = function(e) {
         stop("Request to BioMart web service failed. Verify if you 
are still connected to the internet.  Alternatively the BioMart web 
service is temporarily down.")
     })
     return(result)
}
<environment: namespace:biomaRt>


So in another fresh R session, I tried debugging tryCatch, and it stopped here:

Browse[2]> tryCatchList(expr, classes, parentenv, handlers)


Interestingly, after ~1 min, the debugger did come back with the 
error message, and lot of other stuff and finally the prompt:

Browse[2]>
exiting from: tryCatch(getURL(request), error = function(e) {
     stop("Request to BioMart web service failed. Verify if you are 
still connected to the internet.  Alternatively the BioMart web 
service is temporarily down.")
})
debugging in: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
         if (identical(call[[1L]], quote(doTryCatch)))
             call <- sys.call(-4L)
         dcall <- deparse(call)[1L]
         prefix <- paste("Error in", dcall, ": ")
         LONG <- 75L
         msg <- conditionMessage(e)
         sm <- strsplit(msg, "\n")[[1L]]
         w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
         if (is.na(w))
             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
                 type = "b")
         if (w > LONG)
             prefix <- paste(prefix, "\n  ", sep = "")
     }
     else prefix <- "Error : "
     msg <- paste(prefix, conditionMessage(e), "\n", sep = "")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && identical(getOption("show.error.messages"),
         TRUE)) {
         cat(msg, file = stderr())
         .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error"))
})
debug: {
     tryCatchList <- function(expr, names, parentenv, handlers) {
         nh <- length(names)
         if (nh > 1L)
             tryCatchOne(tryCatchList(expr, names[-nh], parentenv,
                 handlers[-nh]), names[nh], parentenv, handlers[[nh]])
         else if (nh == 1L)
             tryCatchOne(expr, names, parentenv, handlers[[1L]])
         else expr
     }
     tryCatchOne <- function(expr, name, parentenv, handler) {
         doTryCatch <- function(expr, name, parentenv, handler) {
             .Internal(.addCondHands(name, list(handler), parentenv,
                 environment(), FALSE))
             expr
         }
         value <- doTryCatch(return(expr), name, parentenv, handler)
         if (is.null(value[[1L]])) {
             msg <- .Internal(geterrmessage())
             call <- value[[2L]]
             cond <- simpleError(msg, call)
         }
         else cond <- value[[1L]]
         value[[3L]](cond)
     }
     if (!missing(finally))
         on.exit(finally)
     handlers <- list(...)
     classes <- names(handlers)
     parentenv <- parent.frame()
     if (length(classes) != length(handlers))
         stop("bad handler specification")
     tryCatchList(expr, classes, parentenv, handlers)
}
Browse[2]>

I think that's as far as I can go now. Any ideas?

Thanks,
Jenny

 > sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32

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] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] biomaRt_2.2.0

loaded via a namespace (and not attached):
[1] RCurl_1.2-1 XML_2.6-0
 >





At 08:54 AM 3/17/2010, Juan Pablo Fededa wrote:
>Thanks Martin,
>
>I get the next answer performing debug on useMart:
>
>
> > library("biomaRt")
> > debug(useMart)
> > ensembl = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
>debugging in: useMart("ensembl", dataset = "hsapiens_gene_ensembl")
>debug: {
>     if (local || mysql || !missing(user) || !missing(password)) {
>         .Defunct(msg = "mysql access to Ensembl is no longer available
>through this package the web service mode supports all queries.  If mysql is
>needed a separate package will become available with limited mysql query
>support.")
>     }
>     if (missing(biomart))
>         stop("No biomart databases specified. Specify a biomart database to
>use using the biomart argument")
>     if (!(is.character(biomart)))
>         stop("biomart argument is no string.  The biomart argument should be
>a single character string")
>     marts = NULL
>     marts = listMarts(host = host, path = path, port = port,
>         includeHosts = TRUE, archive = archive)
>     mindex = match(biomart, marts$biomart)
>     if (is.na(mindex) || archive) {
>         mindex = match(biomart, marts$database)
>     }
>     if (is.na(mindex))
>         stop("Incorrect BioMart name, use the listMarts function to see
>which BioMart databases are available")
>     if (is.na(marts$path[mindex]) || is.na(marts$vschema[mindex]) ||
>         is.na(marts$host[mindex]) || is.na(marts$port[mindex]) ||
>         is.na(marts$path[mindex]))
>         stop("The selected biomart databases is not available due to error
>in the BioMart central registry, please report so the BioMart registry file
>can be fixed.")
>     if (marts$path[mindex] == "")
>         marts$path[mindex] = "/biomart/martservice"
>     if (archive)
>         biomart = marts$biomart[mindex]
>     biomart = sub(" ", "%20", biomart)
>     mart <- new("Mart", biomart = biomart, vschema = marts$vschema[mindex],
>         host = paste("http://", marts$host[mindex], ":", marts$port[mindex],
>
>             marts$path[mindex], sep = ""), archive = archive)
>     if (!missing(dataset)) {
>         mart = useDataset(mart = mart, dataset = dataset)
>     }
>     return(mart)
>}
>Browse[2]>
>
>
>In the step-by-step execution of the above function, R GUI starts not
>responding after:
>
>mart = useDataset(mart = mart, dataset = dataset)
>
>Any clue about what is going on?
>Thanks again,
>
>
>Juan
>
>
>
>
>
>On Wed, Mar 17, 2010 at 2:39 PM, Martin Morgan <mtmorgan at fhcrc.org> wrote:
>
> > On 03/17/2010 04:00 AM, Juan Pablo Fededa wrote:
> > > Dear bioconductor-help contributors,
> > >
> > >
> > > I'm trying to use biomaRt package in R, and when I run the next line, the
> > R
> > > GUI crashes:
> > >
> > > ensembl = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
> > >
> > > Theres is no error message at all, simply R is not responding anymore.
> > > when loading library(biomaRt) the prompt sign appears again, and you can
> > > already run basic things like:
> > > listMarts()
> >
> > This is unusual, because the only part of useMart that might end up with
> > real trouble is a call to listMarts() ! Start R with the --vanilla
> > argument, e.g., from the DOS shell
> >
> >  Rgui --vanilla
> >
> > try to place a debugger on useMart, and step through until R stops
> > responding. Restart R, get to a similar place, and look at the arguments
> > to the function that causes problems. Any hints?
> >
> >  > debug(useMart)
> >   > ensembl = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
> >   Browser[2]> n
> >
> > ('n' is for 'next', see ?browser)
> >
> > Martin
> >
> > >
> > > When I run sessionInfo() I get this:
> > >
> > > R version 2.10.1 (2009-12-14)
> > > i386-pc-mingw32
> > >
> > > locale:
> > > [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
> > > States.1252
> > > [3] LC_MONETARY=English_United States.1252
> > > LC_NUMERIC=C
> > > [5] LC_TIME=English_United States.1252
> > >
> > > attached base packages:
> > > [1] stats     graphics  grDevices utils     datasets  methods   base
> > >
> > > other attached packages:
> > > [1] biomaRt_2.2.0
> > >
> > > loaded via a namespace (and not attached):
> > > [1] RCurl_1.3-1 XML_2.6-0
> > >
> > > Do you have any idea of what can I change to make it work?
> > > Thanks in advance,
> > >
> > >       [[alternative HTML version deleted]]
> > >
> > > _______________________________________________
> > > 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
> >
> >
> > --
> > Martin Morgan
> > Computational Biology / Fred Hutchinson Cancer Research Center
> > 1100 Fairview Ave. N.
> > PO Box 19024 Seattle, WA 98109
> >
> > Location: Arnold Building M1 B861
> > Phone: (206) 667-2793
> >
>
>         [[alternative HTML version deleted]]
>
>_______________________________________________
>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

Jenny Drnevich, Ph.D.

Functional Genomics Bioinformatics Specialist
W.M. Keck Center for Comparative and Functional Genomics
Roy J. Carver Biotechnology Center
University of Illinois, Urbana-Champaign

330 ERML
1201 W. Gregory Dr.
Urbana, IL 61801
USA

ph: 217-244-7355
fax: 217-265-5066
e-mail: drnevich at illinois.edu



More information about the Bioconductor mailing list