Changeset 256

Show
Ignore:
Timestamp:
09/04/09 10:45:29 (3 months ago)
Author:
cholt
Message:

Update tiers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • MPI/mpi_iprscan

    r228 r256  
    7979use Error::Simple; 
    8080use Process::IPRchunk; 
    81 use Process::IPRtiers; 
     81use Process::MpiTiers; 
    8282use Parallel::MPIcar qw(:all); 
    8383 
     
    367367            my $tier; 
    368368            while (my $fasta = $iterator->nextFasta() || shift @failed){ 
    369                 $tier = Process::IPRtiers->new({fasta => $fasta, 
     369                $tier = Process::MpiTiers->new({fasta => $fasta, 
    370370                                                appl => \@appl, 
    371371                                                params => \@ARGV, 
     
    374374                                                outfile => $outfile, 
    375375                                                DS_CTL  => $DS_CTL}, 
    376                                                $root 
     376                                               $root, 
     377                                               'Process::IPRchunk' 
    377378                                              ); 
    378379                 
     
    434435                 
    435436                while (my $fasta = $iterator->nextFasta() || shift @failed){ 
    436                     $tier = Process::IPRtiers->new({fasta => $fasta, 
     437                    $tier = Process::MpiTiers->new({fasta => $fasta, 
    437438                                                    appl => \@appl, 
    438439                                                    params => \@ARGV, 
     
    441442                                                    outfile => $outfile, 
    442443                                                    DS_CTL  => $DS_CTL}, 
    443                                                    $who 
     444                                                   $who, 
     445                                                   'Process::IPRchunk' 
    444446                                                   ); 
    445447                     
  • MPI/mpi_maker

    r244 r256  
    399399                                            GFF_DB  => $GFF_DB, 
    400400                                            build   => $build}, 
    401                                            $root 
     401                                           $root, 
     402                                           'Process::MpiChunk' 
    402403                                          ); 
    403404 
     
    465466                                               GFF_DB  => $GFF_DB, 
    466467                                               build   => $build}, 
    467                                               $who 
     468                                              $who, 
     469                                              'Process::MpiChunk' 
    468470                                             ); 
    469471 
  • bin/maker

    r249 r256  
    249249                                    GFF_DB  => $GFF_DB, 
    250250                                    build   => $build}, 
    251                                    '0' 
     251                                   '0', 
     252                                   'Process::MpiChunk' 
    252253                                   ); 
    253254 
  • lib/Process/IPRchunk.pm

    r254 r256  
    4444         $self->{RESULTS} = {}; 
    4545 
    46          $self->_initialize($VARS); 
     46         $self->_initialize(); 
     47         $self->_initialize_vars($VARS) if(ref($VARS) eq 'HASH'); 
    4748      } 
    4849   } 
     
    5051   return $self; 
    5152} 
     53#-------------------------------------------------------------- 
     54#Perform any user specified initialization steps here. 
     55#This method always runs when a new chunk is created. 
     56#This method does not take any arguements. 
     57#$self->{VARS} has not been set yet, so if you need access 
     58#to values in $self->{VARS}, add your code to the 
     59#_initialize_vars method. 
     60 
     61sub _initialize{ 
     62    my $self = shift; 
     63} 
     64 
     65#-------------------------------------------------------------- 
     66#Set up chunk specific variables. 
     67#This method also reaches inside IPRtiers->{VARS} and pulls out 
     68#all need variables. 
     69#By Reaching into the IPRtiers object we keep control of the 
     70#VARS datastructure within the IPRchunk (see method results). 
     71#Another benefit is that variable order is no longer important, 
     72#as it would be if variables were directly passed 
     73 
     74sub _initialize_vars{ 
     75   my $self       = shift; 
     76   my $level      = $self->{LEVEL}; 
     77   my $VARS       = shift;      #this should be a hash reference 
     78 
     79   my @args = @{$self->_go('init', $level, $VARS)}; 
     80 
     81   foreach my $key (@args) { 
     82      if (! exists $VARS->{$key}) { 
     83         die "FATAL: argument \`$key\` does not exist in IPRtier object\n"; 
     84      } 
     85      else { 
     86         $self->{VARS}{$key} = $VARS->{$key}; 
     87      } 
     88   } 
     89} 
     90 
    5291#-------------------------------------------------------------- 
    5392#this function/method is called by IPRtiers as part of IPRtiers 
     
    136175 
    137176   return $chunks; 
    138 } 
    139 #-------------------------------------------------------------- 
    140 #Set up chunk specific variables. 
    141 #This method also reaches inside IPRtiers->{VARS} and pulls out 
    142 #all need variables. 
    143 #By Reaching into the IPRtiers object we keep control of the 
    144 #VARS datastructure within the IPRchunk (see method results). 
    145 #Another benefit is that variable order is no longer important, 
    146 #as it would be if variables were directly passed 
    147  
    148 sub _initialize{ 
    149    my $self       = shift; 
    150    my $level      = $self->{LEVEL}; 
    151    my $VARS       = shift;      #this should be a hash reference 
    152  
    153    my @args = @{$self->_go('init', $level, $VARS)}; 
    154  
    155    foreach my $key (@args) { 
    156       if (! exists $VARS->{$key}) { 
    157          die "FATAL: argument \`$key\` does not exist in IPRtier object\n"; 
    158       } 
    159       else { 
    160          $self->{VARS}{$key} = $VARS->{$key}; 
    161       } 
    162    } 
    163177} 
    164178#-------------------------------------------------------------- 
  • lib/Process/MpiChunk.pm

    r255 r256  
    1616#-----------------------------------METHODS----------------------------------- 
    1717#----------------------------------------------------------------------------- 
    18 sub new { 
     18sub new { #do not change or edit this 
    1919   my ($class, @args) = @_; 
    2020 
     
    3838         $self->{RESULTS} = {}; 
    3939 
    40          $self->_initialize($VARS); 
     40         $self->_initialize(); 
     41         $self->_initialize_vars($VARS) if(ref($VARS) eq 'HASH'); 
    4142      } 
    4243   } 
     
    4445   return $self; 
    4546} 
     47 
     48#-------------------------------------------------------------- 
     49#Perform any user specified initialization steps here. 
     50#This method always runs when a new chunk is created. 
     51#This method does not take any arguements. 
     52#$self->{VARS} has not been set yet, so if you need access 
     53#to values in $self->{VARS}, add your code to the 
     54#_initialize_vars method. 
     55 
     56sub _initialize{ 
     57   my $self = shift; 
     58} 
     59 
     60#-------------------------------------------------------------- 
     61#Set up chunk specific variables. Only runs when $VARS exist 
     62#This method also reaches inside MpiTiers->{VARS} and pulls out 
     63#all need variables. 
     64#By Reaching into the MpiTiers object we keep control of the 
     65#VARS datastructure within the MpiChunk (see method results). 
     66#Another benefit is that variable order is no longer important, 
     67#as it would be if variables were directly passed 
     68 
     69sub _initialize_vars{ 
     70   my $self       = shift; 
     71   my $level      = $self->{LEVEL}; 
     72   my $VARS       = shift;      #this should be a hash reference 
     73 
     74   my @args = @{$self->_go('init', $level, $VARS)}; 
     75 
     76   foreach my $key (@args) { 
     77      if (! exists $VARS->{$key}) { 
     78         die "FATAL: argument \`$key\` does not exist in MpiTier object\n"; 
     79      } 
     80      else { 
     81         $self->{VARS}{$key} = $VARS->{$key}; 
     82      } 
     83   } 
     84} 
     85 
    4686#-------------------------------------------------------------- 
    4787#this function/method is called by MpiTiers as part of MpiTiers 
     
    174214 
    175215   return $chunks; 
    176 } 
    177 #-------------------------------------------------------------- 
    178 #Set up chunk specific variables. 
    179 #This method also reaches inside MpiTiers->{VARS} and pulls out 
    180 #all need variables. 
    181 #By Reaching into the MpiTiers object we keep control of the 
    182 #VARS datastructure within the MpiChunk (see method results). 
    183 #Another benefit is that variable order is no longer important, 
    184 #as it would be if variables were directly passed 
    185  
    186 sub _initialize{ 
    187    my $self       = shift; 
    188    my $level      = $self->{LEVEL}; 
    189    my $VARS       = shift;      #this should be a hash reference 
    190  
    191    my @args = @{$self->_go('init', $level, $VARS)}; 
    192  
    193    foreach my $key (@args) { 
    194       if (! exists $VARS->{$key}) { 
    195          die "FATAL: argument \`$key\` does not exist in MpiTier object\n"; 
    196       } 
    197       else { 
    198          $self->{VARS}{$key} = $VARS->{$key}; 
    199       } 
    200    } 
    201216} 
    202217#-------------------------------------------------------------- 
  • lib/Process/MpiTiers.pm

    r255 r256  
    4343          #optionaly override chunk type 
    4444          $self->{CHUNK_REF} = shift @args || "Process::MpiChunk"; 
     45          $self->{CHUNK_REF} = new $self->{CHUNK_REF}; #turn into object 
    4546 
    4647          #setup the tier 
     
    7172 
    7273   return if($self->failed); 
     74 
     75   if(! defined $VARS->{c_flag}){ 
     76       die "ERROR: VARS->{c_flag} is not set in MpiTier.\n". 
     77           "This value should be set by ".ref($self->{CHUNK_REF})."::prepare\n". 
     78           "durring initialization of the MpiTier. Please\n". 
     79           "edit the ".ref($self->{CHUNK_REF})."::prepare code to set this\n". 
     80           "value appropriately\n\n"; 
     81   } 
    7382 
    7483   if($VARS->{c_flag} <= 0){