<commit_before>package Bio::EnsEMBL::Pipeline::Tools::MM_Taxonomy;

use strict;
use Bio::EnsEMBL::Utils::Argument qw(rearrange);
use DBI;

# Use this module to fetch information from the Mole&Mushroom taxonomy tree

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

	my ( $mm_host , $mm_port , $mm_user, $mm_name ) = rearrange(
        [  'MM_HOST', 'MM_PORT','MM_USER', 'MM_NAME' ], @args );
    $self->mm_host($mm_host || 'cbi3');
    $self->mm_port($mm_port || 3306);
    $self->mm_user($mm_user || 'genero');
    $self->mm_name($mm_name || 'mm_ini');
    $self->init_connection();

    return $self;
}

sub init_connection {
	my ( $self ) = @_;
	my $dsn_mm_ini = "DBI:mysql:host=".$self->mm_host.":".$self->mm_name;
	my $dbh_mm_ini = DBI->connect( $dsn_mm_ini, $self->mm_user, '',{ 'RaiseError' => 1 } );
	my $mushroom_db;
	my $query = "SELECT database_name FROM ini
				 WHERE database_category = 'mushroom'
				 AND current = 'yes'
				 AND available = 'yes'";
	my $ini_sth = $dbh_mm_ini->prepare($query);
	$ini_sth->execute() or die "Couldn't execute statement: " . $ini_sth->errstr;
	while(my $hash = $ini_sth->fetchrow_hashref()) {
		$mushroom_db = $hash->{'database_name'};
	}
	$ini_sth->finish();
	my $dsn_mushroom = "DBI:mysql:host=".$self->mm_host.":$mushroom_db";
	my $dbh_mushroom = DBI->connect( $dsn_mushroom, $self->mm_user, '',{ 'RaiseError' => 1 } );

	$self->dbh($dbh_mushroom);
}

sub get_parent_id {<commit_msg>changed mole host, cbi3 changed to cbi5d<commit_after>package Bio::EnsEMBL::Pipeline::Tools::MM_Taxonomy;

use strict;
use Bio::EnsEMBL::Utils::Argument qw(rearrange);
use DBI;

# Use this module to fetch information from the Mole&Mushroom taxonomy tree

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

	my ( $mm_host , $mm_port , $mm_user, $mm_name ) = rearrange(
        [  'MM_HOST', 'MM_PORT','MM_USER', 'MM_NAME' ], @args );
    $self->mm_host($mm_host || 'cbi5d');
    $self->mm_port($mm_port || 3306);
    $self->mm_user($mm_user || 'genero');
    $self->mm_name($mm_name || 'mm_ini');
    $self->init_connection();

    return $self;
}

sub init_connection {
	my ( $self ) = @_;
	my $dsn_mm_ini = "DBI:mysql:host=".$self->mm_host.":".$self->mm_name;
	my $dbh_mm_ini = DBI->connect( $dsn_mm_ini, $self->mm_user, '',{ 'RaiseError' => 1 } );
	my $mushroom_db;
	my $query = "SELECT database_name FROM ini
				 WHERE database_category = 'mushroom'
				 AND current = 'yes'
				 AND available = 'yes'";
	my $ini_sth = $dbh_mm_ini->prepare($query);
	$ini_sth->execute() or die "Couldn't execute statement: " . $ini_sth->errstr;
	while(my $hash = $ini_sth->fetchrow_hashref()) {
		$mushroom_db = $hash->{'database_name'};
	}
	$ini_sth->finish();
	my $dsn_mushroom = "DBI:mysql:host=".$self->mm_host.":$mushroom_db";
	my $dbh_mushroom = DBI->connect( $dsn_mushroom, $self->mm_user, '',{ 'RaiseError' => 1 } );

	$self->dbh($dbh_mushroom);
}

sub get_parent_id {
{'fraction_non_alphanumeric': 0.1924643584521385, 'fraction_numerical': 0.005431093007467753, 'mean_word_length': 4.487895716945996, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3394640', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1195, 'n_words': 226}