<commit_before>
=head1 NAME

ProteinAnnotation.pm - DESCRIPTION of Object

=head1 SYNOPSIS

RunnableDB for copying genes from a source database to a target
database. By default all the genes in the database COPY_SOURCE_DB are copied into
the database COPY_TARGET_DB

=head1 DESCRIPTION

=head1 CONTACT

<EMAIL>

=cut

package Bio::EnsEMBL::Analysis::RunnableDB::CopyGenes;

use vars qw(@ISA);
use strict;

use Bio::EnsEMBL::Analysis::RunnableDB;
use Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild;

use Bio::EnsEMBL::Utils::Exception qw(throw warning);
use Bio::EnsEMBL::Utils::Argument qw (rearrange);

@ISA = qw (
           Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild
           );

sub new{
  my ($class,@args) = @_;
  my $self = $class->SUPER::new(@args);
  my ($source_db, $target_db, $biotype) = rearrange
    (['SOURCE_DB', 'TARGET_DB', 'BIOTYPE'], @args);
  ######################
  #SETTING THE DEFAULTS#
  ######################
  $self->source_db_name('COPY_SOURCE_DB');
  $self->target_db_name('COPY_TARGET_DB');
  #####################
  my $parameters_hash = $self->parameters_hash;
  $source_db = $parameters_hash->{-source_db} if(!$source_db);
  $target_db = $parameters_hash->{-target_db} if(!$target_db);
  $biotype = $parameters_hash->{-biotype} if(!$biotype);
  $self->source_db_name($source_db);
  $self->target_db_name($target_db);
  $self->biotype($biotype);
  return $self;
}


#getter/setters

sub source_db_name{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'source_db_name'} = $arg;
  }
  return $self->{'source_db_name'};
}

sub target_db_name{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'target_db_name'} = $arg;<commit_msg>Corrected priorities for attributes values: constructor-args > analysis table parameters > defaults (where ">" can be read as "more important than").<commit_after>
=head1 NAME

ProteinAnnotation.pm - DESCRIPTION of Object

=head1 SYNOPSIS

RunnableDB for copying genes from a source database to a target
database. By default all the genes in the database COPY_SOURCE_DB are copied into
the database COPY_TARGET_DB

=head1 DESCRIPTION

=head1 CONTACT

<EMAIL>

=cut

package Bio::EnsEMBL::Analysis::RunnableDB::CopyGenes;

use vars qw(@ISA);
use strict;

use Bio::EnsEMBL::Analysis::RunnableDB;
use Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild;

use Bio::EnsEMBL::Utils::Exception qw(throw warning);
use Bio::EnsEMBL::Utils::Argument qw (rearrange);

@ISA = qw (
           Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild
           );

sub new{
  my ($class,@args) = @_;
  my $self = $class->SUPER::new(@args);
  my ($given_source_db, $given_target_db, $given_biotype) = rearrange
    (['SOURCE_DB', 'TARGET_DB', 'BIOTYPE'], @args);

  #### Default values...
  $self->source_db_name("COPY_SOURCE_DB");
  $self->target_db_name("COPY_TARGET_DB");
  $self->biotype("");

  ### ...are over-ridden by parameters given in analysis table...
  my $ph = $self->parameters_hash;
  $self->source_db_name($ph->{-source_db}) if exists $ph->{-source_db};
  $self->target_db_name($ph->{-target_db}) if exists $ph->{-target_db};
  $self->biotype($ph->{-biotype}) if exists $ph->{-biotype};
  
  ### ...which are over-ridden by constructor arguments. 
  $self->source_db_name($given_source_db) if defined $given_source_db;
  $self->target_db_name($given_target_db) if defined $given_target_db;
  $self->biotype($given_biotype) if defined $given_biotype;
 
  return $self;
}


#getter/setters

sub source_db_name{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'source_db_name'} = $arg;
  }
  return $self->{'source_db_name'};
}

sub target_db_name{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'target_db_name'} = $arg;
{'fraction_non_alphanumeric': 0.17473118279569894, 'fraction_numerical': 0.002150537634408602, 'mean_word_length': 5.150413223140496, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '6099054', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1330, 'n_words': 288}