Is There A Non-Perl Alternative To Accessing Ensembl'S Api?
5
15
Entering edit mode
14.1 years ago
Rvidal ▴ 270

I'm looking for a programmatic way to access Ensembl or UCSC's genome browser using something like python or ruby. Perl is just not my thing, sadly. PyCogent seems to have something that I have not yet tested properly, but just wanted to ping the community before going ahead and coding something that might already exist.

Any ideas?

ensembl python biopython genome • 9.0k views
ADD COMMENT
11
Entering edit mode
14.1 years ago

The two ones I know under current development are PyCogent and pygr. I haven't played with either but both look useful.

ADD COMMENT
0
Entering edit mode

Thanks Brad. I'm rather intrigued by the fact that biopython doesn't have anything for this. You know if anything is planned or discussed? Can't seem to find anything.

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Ricardo; I'd prefer to see integration of these libraries with Biopython instead of reimplementing. We have PyCogent Ensembl targeted as part of our Google Summer of Code ideas:

I'd be interested in hearing how they work out for you since I haven't had a need to use them in my work yet.

ADD REPLY
0
Entering edit mode

Maybe I should apply for that project :) Sounds interesting.

ADD REPLY
0
Entering edit mode

Slightly off topic, but it surprises me how slow the Perl API is in comparison to other methods. I'm using Python and MySQLdb to directly query the MySQL database for some things and it's lightening fast in comparison to getting the same information using Perl. I can download information from 5 genomes in a fraction of the time it takes me to download 1 using Perl. Looking forward to see what PyCogent and PyGr can do for Ensembl using Biopython :)

ADD REPLY
4
Entering edit mode
14.1 years ago
Ian Simpson ▴ 960

I looked into this myself before I resigned myself to using the Perl APIs. I wouldn't be too down on them as they have a lot of functionality (but still depend on BioPerl1.5 !).

You can access the Ensembl database directly through their MySQL server, but building the queries for the very complex schema is very time consuming. I can see them coming under increasing pressure to provide support for other languages (Python certainly would be very popular) but they have a lot of work to do as it is and I think an initiative like that would probably require extra funding.

You can access the MySQL server using the details here http://www.ensembl.org/info/data/mysql.html

ADD COMMENT
0
Entering edit mode

I think the PyCogent method is exactly this. They have built a wrapper that takes advantage of the MySQL server access.

ADD REPLY
3
Entering edit mode
14.1 years ago
Neilfws 49k

Jan has written Ruby libraries for both Ensembl and UCSC APIs. Here is his original blog post on the Ensembl library.

There is certainly a lot of scope for writing libraries. However, I tend to agree with Ian: sometimes, when a working tool already exists, it's better to just swallow your disdain and work out how to use it.

ADD COMMENT
3
Entering edit mode
9.2 years ago

Our lab recently released PyEnsembl to work with Ensembl data locally. We also wrote a blog post with some information on how to use the library.

ADD COMMENT
0
Entering edit mode

Can I use PyEnsembl to get the start and end position for a transcript? For example this one for Hemoglobin Z:

http://www.ensembl.org/Homo_sapiens/Transcript/Exons?db=core;g=ENSG00000130656;r=16:152687-154503;t=ENST00000252951

ADD REPLY
2
Entering edit mode
14.1 years ago

In theory, you could try to use the Ensembl Java APIs with Python throught the Jython interpreter. However, I don't recommend you that, for you sanity.

I follow the pygr's mailing list and they have released a new tutorial on their Ensembl APIs lately, which means that they are stil developing that part. However, I have never tried that module, when I looked at it one year ago it didn's seem complete yet, I am not sure whether it is complete or not now.

ADD COMMENT
0
Entering edit mode

I believe the Ensembl Java APIs still work, but they have officially been dropped (unless someone else outside Ensembl has picked them up). As you imply I wouldn't rely on them for developing code.

ADD REPLY
0
Entering edit mode

I forgot to say that for most of the things you can use Biomart instead of the ensembl APIs. It works a lot better and I suppose it is the reason why the perl APIs are not maintained properly. There are a lot of libraries for biomart, in R, java, etc...

ADD REPLY

Login before adding your answer.

Traffic: 2434 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6