[ensembl-dev] database access

Gary Duncan gryduncan at gmail.com
Tue Mar 12 15:35:12 GMT 2013


I was given a script that pulled data from ensembl its over 2 years old and
it doesnt work did of the below change.

use strict;
use warnings;
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::DBSQL::DBConnection;
use Bio::EnsEMBL::Utils::SqlHelper;

#Load all DBs from Ensembl Genomes
Bio::EnsEMBL::Registry->load_registry_from_db(
  -HOST => 'mysql.ebi.ac.uk',
  -PORT => 4157,
  -USER => 'anonymous',
  -verbose => 1
);

my $dbc = Bio::EnsEMBL::DBSQL::DBConnection->new(
  -HOST => 'localhost',
  -PORT => 3306,
  -USER => 'x',
  -PASS => 'x',
  -DBNAME => 'x'
);
#Holds a soft reference to the DBConnection so we cannot combine the two
news
my $h = Bio::EnsEMBL::Utils::SqlHelper->new(-DB_CONNECTION => $dbc);

#Cleanup schema using do()
$dbc->do('DROP TABLE IF EXISTS introns');
$dbc->do(<<'SQL');
CREATE TABLE introns (
  idgld int(10) NOT NULL auto_increment,
   stbl_id varchar(12),
  seq_start varchar(12),
  seq_stop varchar(12),
  sequence text,
  PRIMARY KEY(idgld)
)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20130312/7030daf1/attachment.html>


More information about the Dev mailing list