我正在尝试使用以下 Perl 代码连接到 Ensembl API:
#!/bin/perl
use Bio::EnsEMBL::Registry;
use DBI qw(:sql_types);
my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org', # alternatively 'useastdb.ensembl.org'
-user => 'anonymous'
);
my @db_adaptors = @{ $registry->get_all_DBAdaptors() };
foreach my $db_adaptor (@db_adaptors) {
my $db_connection = $db_adaptor->dbc();
printf(
"species/group\t%s/%s\ndatabase\t%s\nhost:port\t%s:%s\n\n",
$db_adaptor->species(), $db_adaptor->group(),
$db_connection->dbname(), $db_connection->host(),
$db_connection->port()
);
}
Bioperl 和 CPAN 都是使用 Ensembl API 所必需的,我很确定它们已正确安装在我的 Ubuntu 上。我还将所需的模块添加到 PERL5LIB 环境变量中。尽管如此,我还是收到以下错误消息:
Bareword "SQL_INTEGER" not allowed while "strict subs" in use at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm line 299.
Compilation failed in require at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm line 45.
BEGIN failed--compilation aborted at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm line 45.
Compilation failed in require at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm line 60.
BEGIN failed--compilation aborted at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm line 60.
Compilation failed in require at /home/src/ensembl/modules/Bio/EnsEMBL/Registry.pm line 127.
BEGIN failed--compilation aborted at /home/src/ensembl/modules/Bio/EnsEMBL/Registry.pm line 127.
这是脚本用于连接 Ensembl 数据库的注册表文件:
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous',
-verbose => '1'
);
use strict;
use Bio::EnsEMBL::Utils::ConfigRegistry;
use Bio::EnsEMBL::DBSQL::DBAdaptor;
new Bio::EnsEMBL::DBSQL::DBAdaptor(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous',
-port => '3306',
-species => 'homo_sapiens',
-group => 'core',
-dbname => 'homo_sapiens_core_70_37'
);
my @aliases = ( 'H_Sapiens', 'Homo sapiens', 'human' );
Bio::EnsEMBL::Utils::ConfigRegistry->add_alias(
-species => 'homo_sapiens',
-alias => \@aliases
);
1