[ensembl-dev] question regarding geneadaptor
mag
mr6 at ebi.ac.uk
Tue Nov 4 13:48:03 GMT 2014
Hi Duarte,
Could you copy-paste the exact registry call you have in your script?
Using
$registry->load_registry_from_db(
-db_version => 75,
-host => 'ensembldb.ensembl.org',
-user => 'anonymous',
-port => '3306',
);
I get a list of two genes with the snippet of code you have shown.
Regards,
Magali
On 04/11/2014 13:33, Duarte Molha wrote:
> I am connected to v75
>
>
> =========================
> Duarte Miguel Paulo Molha
> http://about.me/duarte
> =========================
>
> On 4 November 2014 13:21, mag <mr6 at ebi.ac.uk <mailto:mr6 at ebi.ac.uk>>
> wrote:
>
> Hi Duarte,
>
> Can you check which database you are connecting to?
>
> I tried the following:
> my $registry = "Bio::EnsEMBL::Registry";
> $registry->load_registry_from_db(
> -db_version => 77,
> -host => 'ensembldb.ensembl.org <http://ensembldb.ensembl.org>',
> -user => 'anonymous',
> -port => '3337',
> );
>
> my $query_gene = "CYP2D7P";
> my $gene_adaptor = $registry->get_adaptor('human', 'core', 'gene');
> print "Using database " . $gene_adaptor->dbc->dbname() . "\n";
> my @fetched_genes =
> @{$gene_adaptor->fetch_all_by_display_label($query_gene)};
> foreach my $gene (@fetched_genes) {
> print "Found " . $gene->stable_id . " with name " .
> $gene->display_xref->display_id . "\n";
> }
>
> And got the following results:
> Using database homo_sapiens_core_77_37
> Found ENSG00000205702 with name CYP2D7P
> Found ENSG00000263181 with name CYP2D7P
>
> This also works on the live GRCh38 database.
>
>
> Regards,
> Magali
>
>
> On 04/11/2014 12:03, Duarte Molha wrote:
>> Dear developer
>>
>> I have simple script to fetch gene information and I am having
>> problems with a particular gene that I know is correct and on the
>> database:
>>
>> http://grch37.ensembl.org/Homo_sapiens/Gene/Summary?db=core;g=ENSG00000205702;r=22:42536214-42540576
>>
>> here is the code I use to fecth it:
>>
>> $query_gene = "CYP2D7P";
>>
>> my @fetched_genes =
>> @{$gene_adaptor->fetch_all_by_display_label($query_gene)};
>>
>> however ...
>>
>> this method returns an empty list.
>>
>> Why is this?
>>
>>
>> I have also tried:
>>
>> my @fetched_genes = @{
>> $gene_adaptor->fetch_all_by_external_name($query_gene) };
>>
>> and this also fails.
>>
>> Can someone tell me what I am doing wrong?
>>
>>
>> Best regards
>>
>> Duarte
>>
>>
>> _______________________________________________
>> Dev mailing listDev at ensembl.org <mailto:Dev at ensembl.org>
>> Posting guidelines and subscribe/unsubscribe info:http://lists.ensembl.org/mailman/listinfo/dev
>> Ensembl Blog:http://www.ensembl.info/
>
>
> _______________________________________________
> Dev mailing list Dev at ensembl.org <mailto:Dev at ensembl.org>
> Posting guidelines and subscribe/unsubscribe info:
> http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
>
>
>
>
> _______________________________________________
> Dev mailing list Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20141104/8b0d976f/attachment.html>
More information about the Dev
mailing list