[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.2, Wed Aug 30 15:01:59 2006 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 68  Line 68 
68                                                code => ["1", "genome access code"],                                                code => ["1", "genome access code"],
69                                                geneFile => ["$FIG_Config::sproutData/genes.tbl", "output file"],                                                geneFile => ["$FIG_Config::sproutData/genes.tbl", "output file"],
70                                             },                                             },
71                                             "<exclude1> <exclude2> ...",                                             "<include1> <include2> ...",
72                                             @ARGV);                                             @ARGV);
73  # Set a variable to contain return type information.  # Set a variable to contain return type information.
74  my $rtype;  my $rtype;
# Line 79  Line 79 
79      my $code = $options->{code};      my $code = $options->{code};
80      # Get a list of the complete genomes.      # Get a list of the complete genomes.
81      my @genes = $fig->genomes(1);      my @genes = $fig->genomes(1);
82        # Add the genomes in the parameter list, taking care to avoid
83        # duplicates.
84        for my $parm (@parameters) {
85            if (grep { $_ eq $parm } @genes) {
86                Trace("Genome $parm is now in the standard list.") if T(2);
87            } else {
88                push @genes, $parm;
89            }
90        }
91      # Start a counter.      # Start a counter.
92      my $counter = 0;      my $counter = 0;
93      # Open the output file.      # Open the output file.
# Line 86  Line 95 
95      Open(\*GENEFILE, ">$outFile");      Open(\*GENEFILE, ">$outFile");
96      # Loop through the genes, creating output.      # Loop through the genes, creating output.
97      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 {  
98              print GENEFILE "$gene\t$code\n";              print GENEFILE "$gene\t$code\n";
99              $counter++;              $counter++;
100          }          }
     }  
101      # Close the output file.      # Close the output file.
102      close GENEFILE;      close GENEFILE;
103      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.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3