<commit_before>=head1 LICENSE

  Copyright (c) 1999-2013 The European Bioinformatics Institute and
  Genome Research Limited.  All rights reserved.

  This software is distributed under a modified Apache license.
  For license details, please see

    http://www.ensembl.org/info/about/code_licence.html

=head1 CONTACT

  Please email comments or questions to the public Ensembl
  developers list at <<EMAIL>>.

  Questions may also be sent to the Ensembl help desk at
  <<EMAIL>>.

=cut

=head1 NAME

Bio::EnsEMBL::Production::DBSQL::DBAdaptor

=head1 SYNOPSIS

  $db = Bio::EnsEMBL::Production::DBSQL::DBAdaptor->new(
    -user   => 'root',
    -dbname => 'pog',
    -host   => 'caldy',
    -driver => 'mysql'
  );


=head1 DESCRIPTION

A specialised database adaptor which allows to set up the environment for 
interfacing to a production database using the EnsEMBL::ORM framework.

=head1 METHODS

=cut

package Bio::EnsEMBL::Production::DBSQL::DBAdaptor;

use strict;
use warnings;

use ORM::EnsEMBL::Rose::DbConnection;

use Bio::EnsEMBL::Utils::Exception qw( throw );
use base ('Bio::EnsEMBL::DBSQL::DBAdaptor');


sub new {
  my ($class, @args) = @_;

  #############################################################
  #
  # Temporary hack
  # 
  # Works for the local copy of ORM::EnsEMBL::Rose::Metadata,
  # before Harpreet updated the repository version, where method 
  # trackable check for the following environment
  #
  # $ENV{ENS_NOTRACKING} = 1;
  #
  #############################################################

  my $self = $class->SUPER::new(@args) or
    throw "Unable to connect to DBA using parameters (".join(', ', @args).")\n";

  ORM::EnsEMBL::Rose::DbConnection->register_database({# domain    => 'ensembl',
						       type      => 'production', 
						       database  => $self->dbc->dbname, 
						       host      => $self->dbc->host, 
						       port      => $self->dbc->port, 
						       username  => $self->dbc->username,
						       password  => $self->dbc->password,
						       trackable => 0});

  # this needs to be executed after the registration of the database,
  # otherwise we get a compilation error
  require ORM::EnsEMBL::DB::Production::Manager::Biotype;

  return $self;
}

sub get_available_adaptors {
  return {};
}

sub get_biotype_manager {<commit_msg>Update the way to import ensembl-orm stuff<commit_after>=head1 LICENSE

  Copyright (c) 1999-2013 The European Bioinformatics Institute and
  Genome Research Limited.  All rights reserved.

  This software is distributed under a modified Apache license.
  For license details, please see

    http://www.ensembl.org/info/about/code_licence.html

=head1 CONTACT

  Please email comments or questions to the public Ensembl
  developers list at <<EMAIL>>.

  Questions may also be sent to the Ensembl help desk at
  <<EMAIL>>.

=cut

=head1 NAME

Bio::EnsEMBL::Production::DBSQL::DBAdaptor

=head1 SYNOPSIS

  $db = Bio::EnsEMBL::Production::DBSQL::DBAdaptor->new(
    -user   => 'root',
    -dbname => 'pog',
    -host   => 'caldy',
    -driver => 'mysql'
  );


=head1 DESCRIPTION

A specialised database adaptor which allows to set up the environment for 
interfacing to a production database using the EnsEMBL::ORM framework.

=head1 METHODS

=cut

package Bio::EnsEMBL::Production::DBSQL::DBAdaptor;

use strict;
use warnings;

use ORM::EnsEMBL::Rose::DbConnection;
use ORM::EnsEMBL::DB::Production::Manager::Biotype;

use Bio::EnsEMBL::Utils::Exception qw( throw );
use base ('Bio::EnsEMBL::DBSQL::DBAdaptor');


sub new {
  my ($class, @args) = @_;

  my $self = $class->SUPER::new(@args) or
    throw "Unable to connect to DBA using parameters (".join(', ', @args).")\n";

  ORM::EnsEMBL::Rose::DbConnection->register_database({domain    => 'ensembl',
						       type      => 'production', 
						       database  => $self->dbc->dbname, 
						       host      => $self->dbc->host, 
						       port      => $self->dbc->port, 
						       username  => $self->dbc->username,
						       password  => $<PASSWORD>,
						       trackable => 0});

  # require ORM::EnsEMBL::DB::Production::Manager::Biotype;

  return $self;
}

sub get_available_adaptors {
  return {};
}

sub get_biotype_manager {
{'fraction_non_alphanumeric': 0.1537914691943128, 'fraction_numerical': 0.007345971563981043, 'mean_word_length': 3.476139978791092, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6953855', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1324, 'n_words': 369}