Question: List Species Names In Local Mysql Ensembl Database Via Pycogent?
gravatar for a1ultima
4.3 years ago by
a1ultima640 wrote:

We have a local EnsEMBL MySQL database containing annotated mosquito genomes.

The PyCogent cookbook states **Here** that you can access/query data from a local MySQL EnsEMBL database via the cogent.db.ensembl.HostAccount module. **Here** is the source code for PyCogent's ensembl-api.

But I cannot access the data as the functions assume a priori that I know the exact names of species (string) whose genomes I am trying to query... After hours of searching online, I would greatly appreciate if somebody could tell me how I can list the names of species (that PyCogent would understand) so that I can finally query the local database for the genome data.

This code shows my problem, note the commenting:

Release = 73

from cogent.db.ensembl import HostAccount, Genome

acc = HostAccount('localhost', 'username1', 'password1')  # login details to MySQL server

genome = Genome(Species='?????',Release=73,account=acc)   # Where can I find the available Species list so I can replace the '?????'
ensembl database mysql python • 1.7k views
ADD COMMENTlink modified 2.0 years ago by admin0 • written 4.3 years ago by a1ultima640

Presumably it recognizes things listed in _species_common_map here.

Edit: It does in fact, at least from a cursory read through the code. If you're familiar with SQL you should also be able to just browse through the tables.

ADD REPLYlink modified 4.3 years ago • written 4.3 years ago by Devon Ryan78k

@dpryan79 when I run the "Species" module.. it just lists all species available in the public database - not the local. I was told the whole point of these APIs was to avoid complex MySQL querying due to the complexity of EnsEMBL schema

ADD REPLYlink written 4.3 years ago by a1ultima640

I know nothing about PyCogent, but the things listed there are the species recognized. If you're customized the local database instance, then presumably you would have tracked what you did.

ADD REPLYlink written 4.3 years ago by Devon Ryan78k

That gave me a lead to work out how, thank you very much

ADD REPLYlink written 4.2 years ago by a1ultima640

cross posted on SO:

ADD REPLYlink written 4.3 years ago by Pierre Lindenbaum106k
gravatar for a1ultima
4.2 years ago by
a1ultima640 wrote:

After a useful tip from @dpryan79 I looked at PyCogent's source code and it turns out the only way I could view species names available was by actually logging into the MySQL server and listing the databases, importantly the database names themselves require a naming convention whereby the first two strings delimited by underscores (_) are the genus and species names respectively.

So by logging into the mysql server via terminal:

mysql -hlocalhost -uuser1 -ppass1

Then typing:


I can see the species available by looking at the names of each database, specifically the first two strings delimited by underscores, e.g. the following databases listed:


Suggest I have the following species available: anopheles gambiae, anopheles arabeinsis, anopheles funestus and anopheles gambiae type M

ADD COMMENTlink modified 4.2 years ago • written 4.2 years ago by a1ultima640
gravatar for admin
2.0 years ago by
admin0 wrote:

To make things easier, I suggest you use the software application called Aditway made by Aditware. This allows access to the database without any programming. All users in your org can share the definitions. Please look at for more info.

ADD COMMENTlink written 2.0 years ago by admin0

This is at least somewhat relevant. But you're pushing your luck with some of you other comments.

ADD REPLYlink written 2.0 years ago by Devon Ryan78k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 935 users visited in the last hour