[Bio] / FigKernelScripts / TransactFeatures.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/TransactFeatures.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9, Mon Aug 15 20:29:10 2005 UTC revision 1.12, Mon Aug 15 21:08:56 2005 UTC
# Line 54  Line 54 
54    
55  Move the attributes from the old features to the ones that replaced them.  Move the attributes from the old features to the ones that replaced them.
56    
57    =item attributeCheck
58    
59    Same as C<attribute>, but no changes are made to the database.
60    
61  =back  =back
62    
63  =head2 The Transaction File  =head2 The Transaction File
# Line 171  Line 175 
175    
176  Trace SQL commands.  Trace SQL commands.
177    
178    =item start
179    
180    ID of the first genome to process. This allows restarting a transaction run that failed
181    in the middle. The default is to run all transaction files.
182    
183  =back  =back
184    
185  =cut  =cut
# Line 193  Line 202 
202  use MoveAliases;  use MoveAliases;
203    
204  # Get the command-line options.  # Get the command-line options.
205  my ($options, @parameters) = Tracer::ParseCommand({ trace => 3, sql => 0, safe => 0, noAlias => 0 },  my ($options, @parameters) = Tracer::ParseCommand({ trace => 3, sql => 0, safe => 0, noAlias => 0,
206                                                        start => ' '},
207                                                    @ARGV);                                                    @ARGV);
208  # Get the command.  # Get the command.
209  my $mainCommand = lc shift @parameters;  my $mainCommand = lc shift @parameters;
# Line 220  Line 230 
230      $controlBlock = MoveAliases->new($options, $mainCommand, @parameters);      $controlBlock = MoveAliases->new($options, $mainCommand, @parameters);
231  } elsif ($mainCommand eq 'attribute') {  } elsif ($mainCommand eq 'attribute') {
232      $controlBlock = AttributeTransactions->new($options, $mainCommand, @parameters);      $controlBlock = AttributeTransactions->new($options, $mainCommand, @parameters);
233    } elsif ($mainCommand eq 'attributecheck') {
234        $controlBlock = AttributeTransactions->new($options, $mainCommand, @parameters);
235  } else {  } else {
236      Confess("Invalid command \"$mainCommand\" specified on command line.");      Confess("Invalid command \"$mainCommand\" specified on command line.");
237  }  }
# Line 234  Line 246 
246      my $orgsFound = 0;      my $orgsFound = 0;
247      my %transFiles = ();      my %transFiles = ();
248      my @transDirectory = OpenDir($parameters[0], 1);      my @transDirectory = OpenDir($parameters[0], 1);
249        # Pull out the "start" option value. This will be a space if all genomes should
250        # be processed, in which case it will always compare less than the genome ID.
251        my $startGenome = $options->{start};
252      # The next step is to create a hash of organism IDs to file names. This      # The next step is to create a hash of organism IDs to file names. This
253      # saves us some painful parsing later.      # saves us some painful parsing later.
254      for my $transFileName (@transDirectory) {      for my $transFileName (@transDirectory) {
255            # Parse the file name. This will only match if it's a real transaction file.
256          if ($transFileName =~ /^tbl_diff_(\d+\.\d+)$/) {          if ($transFileName =~ /^tbl_diff_(\d+\.\d+)$/) {
257                # Get the genome ID;
258                my $genomeID = $1;
259                # If we're skipping, only include this genome ID if it's equal to
260                # or greater than the start value.
261                if ($genomeID > $startGenome) {
262              $transFiles{$1} = "$parameters[0]/$transFileName";              $transFiles{$1} = "$parameters[0]/$transFileName";
263              $orgsFound++;              $orgsFound++;
264          }          }
265      }      }
266        }
267      Trace("$orgsFound genome transaction files found in directory $parameters[0].") if T(2);      Trace("$orgsFound genome transaction files found in directory $parameters[0].") if T(2);
268      if (! $orgsFound) {      if (! $orgsFound) {
269          Confess("No \"tbl_diff\" files found in directory $parameters[1].");          Confess("No \"tbl_diff\" files found in directory $parameters[1].");

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.12

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3