Changeset 256
- Timestamp:
- 09/04/09 10:45:29 (3 months ago)
- Files:
-
- MPI/mpi_iprscan (modified) (5 diffs)
- MPI/mpi_maker (modified) (2 diffs)
- bin/maker (modified) (1 diff)
- lib/Process/IPRchunk.pm (modified) (3 diffs)
- lib/Process/IPRtiers.pm (deleted)
- lib/Process/MpiChunk.pm (modified) (4 diffs)
- lib/Process/MpiTiers.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
MPI/mpi_iprscan
r228 r256 79 79 use Error::Simple; 80 80 use Process::IPRchunk; 81 use Process:: IPRtiers;81 use Process::MpiTiers; 82 82 use Parallel::MPIcar qw(:all); 83 83 … … 367 367 my $tier; 368 368 while (my $fasta = $iterator->nextFasta() || shift @failed){ 369 $tier = Process:: IPRtiers->new({fasta => $fasta,369 $tier = Process::MpiTiers->new({fasta => $fasta, 370 370 appl => \@appl, 371 371 params => \@ARGV, … … 374 374 outfile => $outfile, 375 375 DS_CTL => $DS_CTL}, 376 $root 376 $root, 377 'Process::IPRchunk' 377 378 ); 378 379 … … 434 435 435 436 while (my $fasta = $iterator->nextFasta() || shift @failed){ 436 $tier = Process:: IPRtiers->new({fasta => $fasta,437 $tier = Process::MpiTiers->new({fasta => $fasta, 437 438 appl => \@appl, 438 439 params => \@ARGV, … … 441 442 outfile => $outfile, 442 443 DS_CTL => $DS_CTL}, 443 $who 444 $who, 445 'Process::IPRchunk' 444 446 ); 445 447 MPI/mpi_maker
r244 r256 399 399 GFF_DB => $GFF_DB, 400 400 build => $build}, 401 $root 401 $root, 402 'Process::MpiChunk' 402 403 ); 403 404 … … 465 466 GFF_DB => $GFF_DB, 466 467 build => $build}, 467 $who 468 $who, 469 'Process::MpiChunk' 468 470 ); 469 471 bin/maker
r249 r256 249 249 GFF_DB => $GFF_DB, 250 250 build => $build}, 251 '0' 251 '0', 252 'Process::MpiChunk' 252 253 ); 253 254 lib/Process/IPRchunk.pm
r254 r256 44 44 $self->{RESULTS} = {}; 45 45 46 $self->_initialize($VARS); 46 $self->_initialize(); 47 $self->_initialize_vars($VARS) if(ref($VARS) eq 'HASH'); 47 48 } 48 49 } … … 50 51 return $self; 51 52 } 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 61 sub _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 74 sub _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 52 91 #-------------------------------------------------------------- 53 92 #this function/method is called by IPRtiers as part of IPRtiers … … 136 175 137 176 return $chunks; 138 }139 #--------------------------------------------------------------140 #Set up chunk specific variables.141 #This method also reaches inside IPRtiers->{VARS} and pulls out142 #all need variables.143 #By Reaching into the IPRtiers object we keep control of the144 #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 passed147 148 sub _initialize{149 my $self = shift;150 my $level = $self->{LEVEL};151 my $VARS = shift; #this should be a hash reference152 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 }163 177 } 164 178 #-------------------------------------------------------------- lib/Process/MpiChunk.pm
r255 r256 16 16 #-----------------------------------METHODS----------------------------------- 17 17 #----------------------------------------------------------------------------- 18 sub new { 18 sub new { #do not change or edit this 19 19 my ($class, @args) = @_; 20 20 … … 38 38 $self->{RESULTS} = {}; 39 39 40 $self->_initialize($VARS); 40 $self->_initialize(); 41 $self->_initialize_vars($VARS) if(ref($VARS) eq 'HASH'); 41 42 } 42 43 } … … 44 45 return $self; 45 46 } 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 56 sub _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 69 sub _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 46 86 #-------------------------------------------------------------- 47 87 #this function/method is called by MpiTiers as part of MpiTiers … … 174 214 175 215 return $chunks; 176 }177 #--------------------------------------------------------------178 #Set up chunk specific variables.179 #This method also reaches inside MpiTiers->{VARS} and pulls out180 #all need variables.181 #By Reaching into the MpiTiers object we keep control of the182 #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 passed185 186 sub _initialize{187 my $self = shift;188 my $level = $self->{LEVEL};189 my $VARS = shift; #this should be a hash reference190 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 }201 216 } 202 217 #-------------------------------------------------------------- lib/Process/MpiTiers.pm
r255 r256 43 43 #optionaly override chunk type 44 44 $self->{CHUNK_REF} = shift @args || "Process::MpiChunk"; 45 $self->{CHUNK_REF} = new $self->{CHUNK_REF}; #turn into object 45 46 46 47 #setup the tier … … 71 72 72 73 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 } 73 82 74 83 if($VARS->{c_flag} <= 0){
