[Bio] / Sprout / GeneFile.pl Repository:
ViewVC logotype

Diff of /Sprout/GeneFile.pl

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

revision 1.1, Sat Jul 15 07:31:38 2006 UTC revision 1.4, Tue Feb 5 05:47:32 2008 UTC
# Line 3  Line 3 
3  =head1 GenomeFile  =head1 GenomeFile
4    
5  This script generates a genome file. The file will include all complete genomes  This script generates a genome file. The file will include all complete genomes
6  except the ones listed as parameters.  plus the ones listed as parameters.
7    
8  The currently-supported command-line options are as follows.  The currently-supported command-line options are as follows.
9    
# Line 54  Line 54 
54    
55  use strict;  use strict;
56  use Tracer;  use Tracer;
 use DocUtils;  
 use TestUtils;  
57  use Cwd;  use Cwd;
58  use File::Copy;  use File::Copy;
59  use File::Path;  use File::Path;
# Line 64  Line 62 
62  # Get the command-line options and parameters.  # Get the command-line options and parameters.
63  my ($options, @parameters) = StandardSetup([qw() ],  my ($options, @parameters) = StandardSetup([qw() ],
64                                             {                                             {
65                                                  trace => [2, 'tracing level'],
66                                                phone => ["", "phone number (international format) to call when load finishes"],                                                phone => ["", "phone number (international format) to call when load finishes"],
67                                                code => ["1", "genome access code"],                                                code => ["1", "genome access code"],
68                                                geneFile => ["$FIG_Config::sproutData/genes.tbl", "output file"],                                                geneFile => ["$FIG_Config::sproutData/genes.tbl", "output file"],
69                                             },                                             },
70                                             "<exclude1> <exclude2> ...",                                             "<include1> <include2> ...",
71                                             @ARGV);                                             @ARGV);
72  # Set a variable to contain return type information.  # Set a variable to contain return type information.
73  my $rtype;  my $rtype;
# Line 79  Line 78 
78      my $code = $options->{code};      my $code = $options->{code};
79      # Get a list of the complete genomes.      # Get a list of the complete genomes.
80      my @genes = $fig->genomes(1);      my @genes = $fig->genomes(1);
81        # Add the genomes in the parameter list, taking care to avoid
82        # duplicates.
83        for my $parm (@parameters) {
84            if (grep { $_ eq $parm } @genes) {
85                Trace("Genome $parm is now in the standard list.") if T(2);
86            } else {
87                push @genes, $parm;
88            }
89        }
90      # Start a counter.      # Start a counter.
91      my $counter = 0;      my $counter = 0;
92      # Open the output file.      # Open the output file.
# Line 86  Line 94 
94      Open(\*GENEFILE, ">$outFile");      Open(\*GENEFILE, ">$outFile");
95      # Loop through the genes, creating output.      # Loop through the genes, creating output.
96      for my $gene (@genes) {      for my $gene (@genes) {
         # Check to see if this gene is being excluded.  
         if (grep { $_ eq $gene } @parameters) {  
             Trace("Genome $gene excluded.") if T(3);  
         } else {  
97              print GENEFILE "$gene\t$code\n";              print GENEFILE "$gene\t$code\n";
98              $counter++;              $counter++;
99          }          }
     }  
100      # Close the output file.      # Close the output file.
101      close GENEFILE;      close GENEFILE;
102      Trace("$counter genomes written to $outFile.") if T(2);      Trace("$counter genomes written to $outFile.") if T(2);

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3