This is a test version of Biostars. For the public version, visit https://www.biostars.org.
I have 2 identical jupyter notebooks and I get BiomartException when I run one but not the other.

I have 2 copies of a Jupyter notebook, at different locations in my machine. When I run one of the notebooks I get a "BiomartException", but not when I run the other one. The exception I get is:


BiomartException: Query ERROR: caught BioMart::Exception::Database: Could not connect to mysql database ensembl_mart_99: DBI connect('database=ensembl_mart_99;host=127.0.0.1;port=5316','ensro',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /net/isilonP/public/ro/ensweb/live/mart/www_99/biomart-perl/lib/BioMart/Configuration/DBLocation.pm line 98.


Anything similar happened to anybody? how did they cope with it?

Thank you :)

biomart python

looks like from either one location you can't access the MySQL (or ensembl web-) server.

Can you check that you're able to connect to it from both locations you mention?

Hey thanks for your reply!

I do connect to the MySQL server as I can successfully run the below command:

dataset = pb.Dataset(name='dmelanogaster_gene_ensembl', host='http://www.ensembl.org')

It is when I run the below command, requesting for the gene_biotype that I get the issue raised:

fulldataset = dataset.query(attributes=['ensembl_gene_id','external_gene_name','chromosome_name',
                                    'percentage_gene_gc_content', 'strand', 'transcript_length',
                                    'gene_biotype','transcript_biotype', 'start_position','end_position'])

I am getting the same issue in R. I will run a getBM function one time and get that error, then I will try again seconds later and it will run with no error. Here is a simple example that is doing this:

mart.mm <- useMart("ensembl", "mmusculus_gene_ensembl")
name <- "FLT1"
mouseid <-getBM(attributes = "ensembl_gene_id",filters = "external_gene_name",values = name, mart = mart.mm)[1, 1]
mousePheno <- getBM(attributes = "phenotype_description",filters = "ensembl_gene_id",values = mouseid,mart = mart.mm)

Just to clarify--I am accessing mine from the same location each time with inconsistent results.

I believe I am getting the error raised at the same point as you, as I can access the full drosophila dataset, but when I query it I get the exception raised. :/

I'm getting the same problem, from this code:

mart <- useMart("ENSEMBL_MART_ENSEMBL")
mart <- useDataset("hsapiens_gene_ensembl", mart)
annotLookup <- getBM(mart=mart, attributes=c("ensembl_gene_id", "gene_biotype", "external_gene_name"), filter="ensembl_gene_id", values=rownames(cts), uniqueRows=TRUE)

and consistently, i.e. re-trying doesn't help

Moving this to a comment since it is not an answer to the question originally posted above.

Sounds like there is some kind of a database lock that may be preventing access. Have you tried adding a delay before the second query?

0 answers

No answers yet.

Log in to answer this question.