[ensembl-dev] local Compara and perl API
Thomas Derrien
tderrien at univ-rennes1.fr
Fri Jul 18 13:36:01 BST 2014
Hi Stephen,
Thank you for your reply.
With your example, I encounter another error (copy-pasted here):
Could not connect to database XXXX as user XXXX using [DBI:mysql:database=XXXXX;host=XXXX;port=5306] as a locator:
DBI connect(‘database=XXXX;host=genobdd;port=5306’,'XXXX',...) failed: Can't connect to MySQL server on ‘XXXX' (111) at src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm line 263.
-------------------- EXCEPTION --------------------
MSG: Could not connect to database GENOCOMP as user XXXXX using [DBI:mysql:database=XXXXX;host=XXXX;port=5306] as a locator:
DBI connect(‘database=XXX;host=genobdd;port=5306’,'XXXXX',...) failed: Can't connect to MySQL server on ‘xxxxx' (111) at /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm line 263.
STACK Bio::EnsEMBL::DBSQL::DBConnection::connect /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:279
STACK Bio::EnsEMBL::DBSQL::DBConnection::db_handle /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:676
STACK Bio::EnsEMBL::DBSQL::DBConnection::prepare /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:707
STACK Bio::EnsEMBL::DBSQL::BaseAdaptor::prepare /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm:176
STACK Bio::EnsEMBL::DBSQL::BaseMetaContainer::list_value_by_key /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseMetaContainer.pm:121
STACK Bio::EnsEMBL::DBSQL::BaseMetaContainer::get_schema_version /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseMetaContainer.pm:77
STACK Bio::EnsEMBL::Registry::version_check /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/Registry.pm:2675
STACK Bio::EnsEMBL::Registry::get_adaptor /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/Registry.pm:1050
STACK toplevel connect.pl:7
Date (localtime) = Fri Jul 18 14:27:14 2014
Ensembl API version = 75
For information, a "normal" connection with "mysql -u XXX -h XXXX -D XXXX -p" works well.
Thank you for your help.
Cheers,
Thomas
Le 18 juil. 2014 à 12:23, Stephen Fitzgerald <stephenf at ebi.ac.uk> a écrit :
> Hi Thomas, try using this "reg_conf.pl" file in the same directory as your script:
>
>> cat reg_conf.pl
>
> ###
> use strict;
> use Bio::EnsEMBL::Utils::ConfigRegistry;
> use Bio::EnsEMBL::DBSQL::DBAdaptor;
> use Bio::EnsEMBL::Compara::DBSQL::DBAdaptor;
> use Bio::EnsEMBL::Registry;
>
> my @aliases;
>
>
> new Bio::EnsEMBL::Compara::DBSQL::DBAdaptor(
> -host => 'xxxx',
> -user => 'xxxx',
> -port => 5306,
> -pass => 'xxxx',
> -species => 'Multi',
> -group => 'compara',
> -dbname => 'xxxx');
>
> 1;
>
>
>
> and call it explicitly in your script.
>
> ###
> use strict;
> use warnings;
> use Data::Dumper;
> use Bio::EnsEMBL::Registry;
>
> Bio::EnsEMBL::Registry->load_all("reg_conf.pl");
> my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Multi', 'compara', 'GeneMember');
> print Dumper $member_adaptor;
> ###
>
> See if this works.
>
> Cheers,
> Stephen.
>
>
>
>
> On Fri, 18 Jul 2014, Thomas Derrien wrote:
>
>> Dear all,
>> I have installed a local version of the compara database named GENOCOMP (without the core(s) databases).
>> Then, I would like to use the perl API to query it.
>> Here is the simple script I used with the ensembl.init file at the end of the email.
>> ###############
>> use strict;
>> use warnings;
>> use Data::Dumper;
>> use Bio::EnsEMBL::Registry;
>> Bio::EnsEMBL::Registry->load_all();
>> my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Compara', 'compara', 'GeneMember');
>> print Dumper $member_adaptor;
>> #################
>> This scripts returns the following error:
>> ------------------- WARNING ----------------------
>> MSG: Compara is not a valid species name (check DB and API version)
>> FILE: Bio/EnsEMBL/Registry.pm LINE: 1198
>> CALLED BY: Bio/EnsEMBL/Registry.pm LINE: 983
>> Date (localtime) = Fri Jul 18 11:04:36 2014
>> Ensembl API version = 75
>> ---------------------------------------------------
>> -------------------- EXCEPTION --------------------
>> MSG: Can not find internal name for species 'Compara'
>> STACK Bio::EnsEMBL::Registry::get_adaptor /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/Registry.pm:985
>> STACK toplevel getOrthologAPI_genocomp.pl:65
>> Date (localtime) = Fri Jul 18 11:04:36 2014
>> Ensembl API version = 75
>> ---------------------------------------------------
>> I also tried with:
>> my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor(‘Multi', 'compara', 'GeneMember');
>> without any success.
>> Any help would be much appreciated.
>> Thanks in advance
>> Thomas
>> PS: My ensembl.init file
>> $ cat ~/.ensembl_init
>> use strict;
>> use Bio::EnsEMBL::Utils::ConfigRegistry;
>> use Bio::EnsEMBL::DBSQL::DBAdaptor;
>> use Bio::EnsEMBL::Compara::DBSQL::DBAdaptor;
>> my $host = 'genobdd';
>> my $user = 'GENOCOMP';
>> my $port = 5306;
>> my $dbname = 'GENOCOMP';
>> my $pass = ‘XXXXXXXXX';
>> new Bio::EnsEMBL::Compara::DBSQL::DBAdaptor(
>> -host => $host,
>> -user => $user,
>> -pass => $pass,
>> -port => $port,
>> -dbname => $dbname,
>> -verbose => 1
>> );
>> 1;
> _______________________________________________
> 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/20140718/58b8ee3f/attachment.html>
More information about the Dev
mailing list