Arbitrary Queries To Ensembl Api In Python (Retrieving Stable Id History)
1
1
Entering edit mode
11.4 years ago
jergosh ▴ 70

I would like to be map between Ensembl stable IDs between different releases

I found a small tool to do this in Perl (link) which essentially boils down to connecting to the Ensembl registry:

my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db( -host => 'ensembldb.ensembl.org',
                              -user => 'anonymous' );
my $adaptor = $registry->get_DBAdaptor( $species, 'Core' );

and performing the following query:

SELECT  old_version,
        old_release,
        new_stable_id, new_version,
        new_release,
        score
FROM    stable_id_event
  JOIN  mapping_session USING (mapping_session_id)
WHERE   old_stable_id = ?
ORDER BY old_version ASC, CAST(new_release AS UNSIGNED)

I would like to the same in Python and I looked into pygr/pyensembl which is outdated and pycogent (couldn't figure out how to do this kind of custom query). What's the best way to do the mapping in Python?

ensembl python • 2.4k views
ADD COMMENT
1
Entering edit mode
11.4 years ago
Laura ★ 1.8k

Your best bet would be to program against the Ensembl Rest API I would of thought

http://www.ensembl.info/blog/2012/09/27/ensembl-rest-api-ensembl-data-from-any-language/

ADD COMMENT

Login before adding your answer.

Traffic: 1649 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