[ensembl-dev] searchin on ensembl with perl API

Carnë Draug carandraug+dev at gmail.com
Tue Jul 19 20:41:53 BST 2011


2011/7/19 Animesh Sharma <sharma.animesh at gmail.com>:
> Hi Carnë,
> I feel most of the useful stuff is mentioned at
> http://www.ensembl.org/info/docs/api/core/core_tutorial.html , need to
> modify to suit the purpose. Last time I used this approach to get genes in a
> region of genome by calling slice via the registry method, something on the
> lines:
>         my @db_adaptors = @{ $registry->get_all_DBAdaptors() };
>         my $slice_adaptor = $registry->get_adaptor( $genome, 'Core', 'Slice'
> );
>         my $slice = $slice_adaptor->fetch_by_region( 'chromosome', $chr,
> $chrs,$chre );
>         my @genes = @{ $slice->get_all_Genes() };
> Hope this helps,
> Regards,
> Animesh

Hi Animesh,

I believe you may have misunderstood my question or maybe I'm just not
use the Ensembl API yet.

If I understood it correctly, the code you send gets me all genes on a
specific slice. What I want to do is emulate the search results on the
ensebml site. For example, I go to http://www.ensembl.org/ enter the
search 'histone h2a histone cluster 1' and get a list of 21 genes for
human, 19 for mus musculus and several others for other organisms.
What I need is that list of genes, just the IDs are fine.

Carnë




More information about the Dev mailing list