Commit cd531630 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Formatting

parent b12ebbad
......@@ -162,28 +162,33 @@ sub gen_load{
# return if the connection and species, group are the same
if(defined($dba->species)){
my $db_reg = $reg->get_DBAdaptor($dba->species,$dba->group);
if(defined($db_reg)){
if($dba->dbc->equals($db_reg->dbc)){
return $db_reg;
}
else{
warn "WARN: Species and group same for two seperate databases\nModify species name for one of these\n";
$dba->species(find_unique_species($dba->species,$dba->group));
if ( defined( $dba->species ) ) {
my $db_reg = $reg->get_DBAdaptor( $dba->species, $dba->group );
if ( defined($db_reg) ) {
if ( $dba->dbc->equals( $db_reg->dbc ) ) { return $db_reg }
else {
warn "WARN: Species and group same for two seperate databases\n"
. "Modify species name for one of these\n";
$dba->species(
find_unique_species( $dba->species, $dba->group ) );
}
}
}
else{ # no species
my @db_reg = @{$reg->get_all_DBAdaptors_by_connection($dba->dbc)};
foreach my $db_adaptor (@db_reg){
if($db_adaptor->group eq $dba->group){ # found same db connection and group
return $db_adaptor;
} else { # no species
my @db_reg =
@{ $reg->get_all_DBAdaptors_by_connection( $dba->dbc ) };
foreach my $db_adaptor (@db_reg) {
if ( $db_adaptor->group eq $dba->group ) {
# found same db connection and group
return $db_adaptor;
}
}
$dba->species(find_unique_species("DEFAULT",$dba->group));
if($dba->species ne "DEFAULT"){
warn "WARN: For multiple species use species attribute in DBAdaptor->new\n"
$dba->species( find_unique_species( "DEFAULT", $dba->group ) );
if ( $dba->species ne "DEFAULT" ) {
warn "WARN: For multiple species "
. "use species attribute in DBAdaptor->new()\n";
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment