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

Diff of /Sprout/NewStuffCheck.pl

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

revision 1.12, Sat Sep 2 17:02:08 2006 UTC revision 1.13, Wed Sep 6 19:29:46 2006 UTC
# Line 77  Line 77 
77  =item species  =item species
78    
79  Species of the group, or an empty string if the group is for an entire  Species of the group, or an empty string if the group is for an entire
80  genus.  genus. If the group contains more than one species, the species names
81    should be separated by commas.
82    
83  =back  =back
84    
# Line 112  Line 113 
113      # Get the group file.      # Get the group file.
114      my $groupFileName = $options->{groupFile};      my $groupFileName = $options->{groupFile};
115      Trace("Reading group file $groupFileName.") if T(2);      Trace("Reading group file $groupFileName.") if T(2);
     my @groupLines = Tracer::GetFile($groupFileName);  
116      # Well put each group's data into a hash, keyed by group      # Well put each group's data into a hash, keyed by group
117      # name, each entry being a 3-tuple of page name, genus,      # name, each entry being a 3-tuple of page name, genus,
118      # and species      # and species
119      my %groups;      my %groups = Sprout::ReadGroupFile($groupFileName);
     for my $groupLine (@groupLines) {  
         my ($name, $page, $genus, $species) = split(/\t/, $groupLine);  
         $groups{$name} = [$page, $genus, $species];  
     }  
120      Trace("Processing genomes.") if T(2);      Trace("Processing genomes.") if T(2);
121      # Get the current SEED.      # Get the current SEED.
122      my $fig = FIG->new();      my $fig = FIG->new();
# Line 230  Line 226 
226          # Get a list of its possible genomes.          # Get a list of its possible genomes.
227          my $filter = 'Genome(genus) = ?';          my $filter = 'Genome(genus) = ?';
228          my @parms = ($genus);          my @parms = ($genus);
229            # The species list is tricky because a given group may involve more than
230            # one target species. The species names will be comma-separated, and
231            # we use some PERL trickiness to generate an OR filter for them.
232          if ($species) {          if ($species) {
233              $filter .= ' AND Genome(species) = ?';              # Get the individual species.
234              push @parms, $species;              my @speciesList = split /\s*,\s*/, $species;
235                # Create one species filter per species.
236                my @filterClauses = map { 'Genome(species) = ?' } @speciesList;
237                # OR the filter clauses together to get a real filter.
238                $filter .= " AND (" . (join " OR ", @filterClauses) . ")";
239                # Add the specieis names to the SQL parameter list.
240                push @parms, @speciesList;
241          }          }
242          my @possibles = $newSprout->GetFlat(['Genome'], $filter, \@parms, 'Genome(id)');          my @possibles = $newSprout->GetFlat(['Genome'], $filter, \@parms, 'Genome(id)');
243          # Get the possibles that aren't in the group and add identifying information.          # Get the possibles that aren't in the group and add identifying information.

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3