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

Annotation of /Sprout/NewStuffCheck.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (view) (download) (as text)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :    
3 :     =head1 New Stuff Checker
4 :    
5 :     This script compares the genomes, features, and annotations in
6 :     the old and new sprouts and lists the differences.
7 :    
8 : parrello 1.11 The currently-supported command-line options for NewStuffCheck are as follows.
9 : parrello 1.1
10 :     =over 4
11 :    
12 : parrello 1.2 =item summary
13 :    
14 :     Do not display details, only difference summaries.
15 :    
16 : parrello 1.8 =item nofeats
17 :    
18 :     Do not process features.
19 :    
20 : parrello 1.1 =item user
21 :    
22 :     Name suffix to be used for log files. If omitted, the PID is used.
23 :    
24 :     =item trace
25 :    
26 :     Numeric trace level. A higher trace level causes more messages to appear. The
27 :     default trace level is 2. Tracing will be directly to the standard output
28 :     as well as to a C<trace>I<User>C<.log> file in the FIG temporary directory,
29 :     where I<User> is the value of the B<user> option above.
30 :    
31 :     =item sql
32 :    
33 :     If specified, turns on tracing of SQL activity.
34 :    
35 :     =item background
36 :    
37 :     Save the standard and error output to files. The files will be created
38 :     in the FIG temporary directory and will be named C<err>I<User>C<.log> and
39 :     C<out>I<User>C<.log>, respectively, where I<User> is the value of the
40 :     B<user> option above.
41 :    
42 :     =item h
43 :    
44 :     Display this command's parameters and options.
45 :    
46 :     =item phone
47 :    
48 :     Phone number to message when the script is complete.
49 :    
50 : parrello 1.11 =item groupFile
51 :    
52 :     Name of the group file (described below). The default is C<groups.tbl>
53 :     in the Sprout data directory.
54 :    
55 :     =back
56 :    
57 :     =head2 The Group File
58 :    
59 :     A key data file for this process is C<groups.tbl>. This file is kept in the
60 :     Sprout Data directory, and contains the following columns:
61 :    
62 :     =over 4
63 :    
64 :     =item name
65 :    
66 :     Name of the group.
67 :    
68 :     =item page
69 :    
70 :     Name of the group's page on the web site (e.g. C<campy.php> for
71 :     Campylobacter)
72 :    
73 :     =item genus
74 :    
75 :     Genus of the group
76 :    
77 :     =item species
78 :    
79 :     Species of the group, or an empty string if the group is for an entire
80 :     genus.
81 :    
82 : parrello 1.1 =back
83 :    
84 :     =cut
85 :    
86 :     use strict;
87 :     use Tracer;
88 :     use DocUtils;
89 :     use TestUtils;
90 :     use Cwd;
91 :     use File::Copy;
92 :     use File::Path;
93 :     use FIG;
94 :     use SFXlate;
95 :     use Sprout;
96 :    
97 :     # Get the command-line options and parameters.
98 :     my ($options, @parameters) = StandardSetup([qw(Sprout) ],
99 :     {
100 : parrello 1.11 groupFile => ["$FIG_Config::sproutData/groups.tbl", "location of the NMPDR group description file"],
101 : parrello 1.8 nofeats => ["", "if specified, only genome changes will be displayed; otherwise, genome features will be compared and differences shown"],
102 : parrello 1.5 trace => ["2-", "tracing level; use a minus to prevent tracing to standard output"],
103 : parrello 1.2 summary => ["", "if specified, detailed lists of the different items will not be displayed"],
104 : parrello 1.1 phone => ["", "phone number (international format) to call when load finishes"],
105 :     },
106 :     "",
107 :     @ARGV);
108 :     # Set a variable to contain return type information.
109 :     my $rtype;
110 :     # Insure we catch errors.
111 :     eval {
112 : parrello 1.11 # Get the group file.
113 :     my $groupFileName = $options->{groupFile};
114 :     Trace("Reading group file $groupFileName.") if T(2);
115 :     my @groupLines = Tracer::GetFile($groupFileName);
116 :     # Well put each group's data into a hash, keyed by group
117 :     # name, each entry being a 3-tuple of page name, genus,
118 :     # and species
119 :     my %groups;
120 :     for my $groupLine (@groupLines) {
121 :     my ($name, $page, $genus, $species) = split(/\t/, $groupLine);
122 :     $groups{$name} = [$page, $genus, $species];
123 :     }
124 : parrello 1.2 Trace("Processing genomes.") if T(2);
125 : parrello 1.8 # Get the current SEED.
126 :     my $fig = FIG->new();
127 : parrello 1.1 # Get the old Sprout.
128 :     my $oldSprout = SFXlate->new_sprout_only($FIG_Config::oldSproutDB);
129 :     # Get its genomes in alphabetical order.
130 : parrello 1.8 my @oldGenomes = GetGenomes($oldSprout);
131 : parrello 1.1 # Get the new Sprout.
132 :     my $newSprout = SFXlate->new_sprout_only();
133 :     # Get its genomes in alphabetical order.
134 : parrello 1.8 my @newGenomes = GetGenomes($newSprout);
135 : parrello 1.7 # Compare the two genomes lists.
136 : parrello 1.1 my ($insertedGenomes, $deletedGenomes) = Tracer::CompareLists(\@newGenomes, \@oldGenomes);
137 : parrello 1.7 # Add feature counts to the new genomes.
138 :     for my $insertedGenome (@{$insertedGenomes}) {
139 :     my $genomeID = $insertedGenome->[0];
140 :     # For a new genome, display the feature count.
141 :     my $count = $newSprout->GetCount(['HasFeature'], "HasFeature(from-link) = ?",
142 :     [$genomeID]);
143 :     my $suffix = ($count == 1 ? " one feature" : "$count features");
144 :     $insertedGenome->[1] .= "($suffix)";
145 :     }
146 : parrello 1.8 # Add information about SEED status to the deleted genomes.
147 :     for my $deletedGenome (@{$deletedGenomes}) {
148 :     my $genomeID = $deletedGenome->[0];
149 :     if ($fig->is_genome($genomeID)) {
150 :     my $complete = ($fig->is_complete($genomeID) ? "complete" : "incomplete");
151 : parrello 1.9 $deletedGenome->[1] .= "(still in SEED, $complete)";
152 : parrello 1.8 }
153 :     }
154 : parrello 1.1 # Display the lists.
155 : parrello 1.2 ShowLists(! $options->{summary},
156 :     'New Genomes' => $insertedGenomes,
157 :     'Deleted Genomes' => $deletedGenomes);
158 : parrello 1.8 # Now the groups.
159 :     Trace("Comparing groups.") if T(2);
160 :     my %oldGroups = $oldSprout->GetGroups();
161 :     my %newGroups = $newSprout->GetGroups();
162 :     # Loop through the new groups.
163 :     for my $newGroup (sort keys %newGroups) {
164 :     Trace("Processing group $newGroup.") if T(3);
165 :     # Find out if this group is new to this version.
166 :     if (! exists $oldGroups{$newGroup}) {
167 :     # Construct a list of this group's genes.
168 :     my @groupGenomes = NameGenomes($newSprout, $newGroups{$newGroup});
169 :     ShowLists(! $options->{summary}, "Genomes in new group $newGroup" => \@groupGenomes);
170 :     } else {
171 :     # Here the group is in both versions. Fix the lists and compare them.
172 :     my @newGroupList = NameGenomes($newSprout, $newGroups{$newGroup});
173 :     my @oldGroupList = NameGenomes($oldSprout, $oldGroups{$newGroup});
174 : parrello 1.10 Trace("Comparing lists for $newGroup.") if T(4);
175 : parrello 1.8 my ($insertedGroupGenomes, $deletedGroupGenomes) = Tracer::CompareLists(\@newGroupList, \@oldGroupList);
176 : parrello 1.10 Trace("Comparison complete.") if T(4);
177 : parrello 1.8 # Delete the old group data. When we're done, this means we'll have a list of the deleted
178 :     # groups.
179 :     delete $oldGroups{$newGroup};
180 :     # Show the lists. Empty lists will not be shown.
181 : parrello 1.10 Trace("Displaying group lists.") if T(4);
182 : parrello 1.8 ShowLists(! $options->{summary},
183 :     "Genomes new to $newGroup" => $insertedGroupGenomes,
184 :     "Genomes no longer in $newGroup" => $deletedGroupGenomes);
185 :     }
186 :     }
187 : parrello 1.10 Trace("Processing deleted groups.") if T(4);
188 : parrello 1.8 # Now list the deleted groups.
189 :     for my $oldGroup (sort keys %oldGroups) {
190 :     Trace("Processing deleted group $oldGroup.") if T(3);
191 :     my @groupGenomes = NameGenomes($oldSprout, $oldGroups{$oldGroup});
192 :     ShowLists(! $options->{summary}, "Genomes in deleted group $oldGroup" => \@groupGenomes);
193 :     }
194 : parrello 1.1 # Next, we get the subsystems.
195 : parrello 1.2 Trace("Processing subsystems.") if T(2);
196 : parrello 1.1 my @oldSubsystems = GetSubsystems($oldSprout);
197 :     my @newSubsystems = GetSubsystems($newSprout);
198 :     # Compare and display the subsystem lists.
199 :     my ($insertedSubs, $deletedSubs) = Tracer::CompareLists(\@newSubsystems, \@oldSubsystems);
200 : parrello 1.8 # Check the deleted subsystems to see if they're in SEED.
201 :     if (scalar @{$deletedSubs} > 0) {
202 :     my %subChecker = map { $_ => 1 } $fig->all_subsystems();
203 :     for my $deletedSub (@{$deletedSubs}) {
204 :     my $subID = $deletedSub->[0];
205 :     if ($subChecker{$subID}) {
206 :     my $trusted = ($fig->usable_subsystem($subID) ? "usable" : "not usable");
207 : parrello 1.9 $deletedSub->[1] .= " (still in SEED, $trusted)";
208 : parrello 1.8 }
209 :     }
210 :     }
211 : parrello 1.2 ShowLists(! $options->{summary},
212 :     'New Subsystems' => $insertedSubs,
213 :     'Deleted Subsystems' => $deletedSubs);
214 : parrello 1.11 # Next, we show some basic counts.
215 :     print "\nStatistics for old Sprout\n\n";
216 :     ShowCounts($oldSprout);
217 :     print "\nStatistics for new Sprout\n\n";
218 :     ShowCounts($newSprout);
219 :     # Now we show the genomes that are not in groups but could be. First, we convert
220 :     # our group hash from the new Sprout into the form used on the web site.
221 :     Trace("Examining possible missing genomes in groups.") if T(2);
222 :     my %fixedGroups = Sprout::Fix(%newGroups);
223 :     for my $group (sort keys %groups) {
224 :     Trace("Checking group $group.");
225 :     # Get this group's genus and species.
226 :     my $genus = $groups{$group}->[1];
227 :     my $species = $groups{$group}->[2];
228 :     # Get a hash of the genomes already in it.
229 :     my %inGroup = map { $_ => 1 } @{$fixedGroups{$group}};
230 :     # Get a list of its possible genomes.
231 :     my $filter = 'Genome(genus) = ?';
232 :     my @parms = ($genus);
233 :     if ($species) {
234 :     $filter .= ' AND Genome(species) = ?';
235 :     push @parms, $species;
236 :     }
237 :     my @possibles = $newSprout->GetFlat(['Genome'], $filter, \@parms, 'Genome(id)');
238 :     # Get the possibles that aren't in the group and add identifying information.
239 :     my @leftOut = NameGenomes($newSprout, [ grep { $inGroup{$_} } @possibles ]);
240 :     # If anything survived, show the list.
241 :     if (@leftOut) {
242 :     ShowLists(! $options->{summary}, "Candidates for $group" => \@leftOut);
243 :     }
244 :     }
245 :     # Compare the property tables.
246 :     Trace("Comparing properties.") if T(2);
247 :     # Set up lists of all the properties in each sprout.
248 :     my @oldProps = GetProperties($oldSprout);
249 :     my @newProps = GetProperties($newSprout);
250 :     # Compare the lists.
251 :     my ($insertedProps, $deletedProps) = Tracer::CompareLists(\@oldProps, \@newProps);
252 :     # Now get all the properties in the new Sprout without any features.
253 :     my @emptyProps = grep { $_->[1] == 0 } @newProps;
254 :     # Show what we've found.
255 :     ShowLists(! $options->{summary}, 'New Properties' => $insertedProps,
256 :     'Deleted Properties' => $deletedProps,
257 :     'Empty Properties' => \@emptyProps);
258 : parrello 1.8 # Now we process the features of the common genes.
259 :     if (! $options->{nofeats}) {
260 :     # First we need a hash of the inserted stuff so we know to skip it.
261 :     my %skipGenomes = map { $_->[0] => 1 } @{$insertedGenomes};
262 :     # Loop through the genomees.
263 :     for my $genome (@newGenomes) {
264 :     # Get the ID and name.
265 :     my ($genomeID, $genomeName) = @{$genome};
266 :     Trace("Processing $genomeID.") if T(3);
267 :     # Only process the common genes.
268 :     if (! $skipGenomes{$genomeID}) {
269 :     # Compare the genome group information.
270 :     # Get the new and old features. This will be very stressful to the machine,
271 :     # because there are lots of features.
272 :     my @oldFeatures = GetFeatures($oldSprout, $genomeID);
273 :     my @newFeatures = GetFeatures($newSprout, $genomeID);
274 :     Trace("Comparing features for $genomeID.") if T(3);
275 :     # Compare the lists.
276 :     my ($insertedFeatures, $deletedFeatures) = Tracer::CompareLists(\@newFeatures, \@oldFeatures);
277 :     # Display the lists. Only nonempty lists are displayed; however, we do a check
278 :     # first anyway so the trace tells us what's happening.
279 :     if (scalar @{$insertedFeatures} + scalar @{$deletedFeatures} > 0) {
280 :     Trace("Displaying feature differences.") if T(3);
281 :     ShowLists(! $options->{summary},
282 :     "New Features for $genomeID" => $insertedFeatures,
283 :     "Features Deleted from $genomeID" => $deletedFeatures);
284 :     }
285 : parrello 1.1 }
286 :     }
287 :     }
288 :     };
289 :     if ($@) {
290 :     Trace("Script failed with error: $@") if T(0);
291 :     $rtype = "error";
292 :     } else {
293 :     Trace("Script complete.") if T(2);
294 :     $rtype = "no error";
295 :     }
296 :     if ($options->{phone}) {
297 : parrello 1.11 my $msgID = Tracer::SendSMS($options->{phone}, "New Stuff Checker terminated with $rtype.");
298 : parrello 1.1 if ($msgID) {
299 :     Trace("Phone message sent with ID $msgID.") if T(2);
300 :     } else {
301 :     Trace("Phone message not sent.") if T(2);
302 :     }
303 :     }
304 :    
305 : parrello 1.8 =head3 GetGenomes
306 : parrello 1.1
307 : parrello 1.8 C<< my @geneList = GetGenomes($sprout); >>
308 : parrello 1.1
309 :     Return a list of the genomes in the specified Sprout instance. The genomes
310 :     are returned in alphabetical order by genome ID.
311 :    
312 :     =over 4
313 :    
314 :     =item sprout
315 :    
316 :     Sprout instance whose gene list is desired.
317 :    
318 :     =item RETURN
319 :    
320 :     Returns a list of two-tuples. The first element in each tuple is the genome ID,
321 :     and the second is the genome name (genus, species, strain).
322 :    
323 :     =back
324 :    
325 :     =cut
326 :    
327 : parrello 1.8 sub GetGenomes {
328 : parrello 1.1 # Get the parameters.
329 :     my ($sprout) = @_;
330 :     # Get the desired data.
331 :     my @genomes = $sprout->GetAll(['Genome'], "ORDER BY Genome(id)", [], ['Genome(id)',
332 :     'Genome(genus)',
333 :     'Genome(species)',
334 :     'Genome(unique-characterization)']);
335 :     # Create the genome names from the three pieces of the name.
336 :     my @retVal = map { [$_->[0], join(" ", @{$_}[1..3])] } @genomes;
337 :     # Return the result.
338 :     return @retVal;
339 :     }
340 :    
341 : parrello 1.8 =head3 NameGenomes
342 :    
343 : parrello 1.11 C<< my @newList = NameGenomes($sprout, \@genomes); >>
344 : parrello 1.8
345 :     Convert a list of genome IDs to a list of genome IDs with names.
346 :    
347 :     =over 4
348 :    
349 :     =item sprout
350 :    
351 :     The relevant sprout instance.
352 :    
353 :     =item genomes
354 :    
355 :     Reference to a list of genome IDs
356 :    
357 :     =item RETURN
358 :    
359 :     Returns a list of 2-tuples, each tuple consisting of a genome ID followed by a
360 :     genome name.
361 :    
362 :     =back
363 :    
364 :     =cut
365 :    
366 :     sub NameGenomes {
367 :     # Get the parameters.
368 :     my ($sprout, $genomes) = @_;
369 :     # Attach the names.
370 :     my @retVal = map { [$_, $sprout->GenusSpecies($_) ] } @{$genomes};
371 :     # Return the result.
372 :     return @retVal;
373 :     }
374 :    
375 : parrello 1.1 =head3 GetSubsystems
376 :    
377 :     C<< my @subsystems = GetSubsystems($sprout); >>
378 :    
379 :     Get a list of the subsystems in the specified Sprout instance.
380 :    
381 :     =over 4
382 :    
383 :     =item sprout
384 :    
385 :     Sprout instance whose subsystems are desired.
386 :    
387 :     =item RETURN
388 :    
389 :     Returns a list of 2-tuples, each consisting of the subsystem name followed by
390 :     the name of the curator.
391 :    
392 :     =back
393 :    
394 :     =cut
395 :    
396 :     sub GetSubsystems {
397 :     # Get the parameters.
398 :     my ($sprout) = @_;
399 :     # Declare the return variable.
400 :     my @retVal = $sprout->GetAll(['Subsystem'], "ORDER BY Subsystem(id)",
401 :     [], ['Subsystem(id)', 'Subsystem(curator)']);
402 :     # Return the result.
403 :     return @retVal;
404 :     }
405 :    
406 : parrello 1.11 =head3 GetProperties
407 :    
408 :     C<< my @propertyList = GetProperties($sprout); >>
409 :    
410 :     Return a list of properties. Each element in the list will be a 2-tuple containing
411 :     the property name and value in the first column and its ID in the second column.
412 :    
413 :     =over 4
414 :    
415 :     =item sprout
416 :    
417 :     Sprout instance to be used to retrieve the properties.
418 :    
419 :     =item RETURN
420 :    
421 :     Returns a list of 2-tuples. The first element in each 2-tuple will be a string
422 :     in the form of an assignment of the property value to the property name. The second
423 :     element will be the number of features possessing the property. The list will be
424 :     sorted in ascending alphabetical order.
425 :    
426 :     =back
427 :    
428 :     =cut
429 :    
430 :     sub GetProperties {
431 :     # Get the parameters.
432 :     my ($sprout) = @_;
433 :     # Get the properties.
434 :     my @props = $sprout->GetAll(['Property'],
435 :     "ORDER BY Property(property-name), Property(property-value)", [],
436 :     ['Property(property-name)', 'Property(property-value)', 'Property(id)']);
437 :     # Combine the property names and values and replace each property ID by a feature count.
438 :     my @retVal;
439 :     for my $propItem (@props) {
440 :     my $label = $propItem->[0] . " = " . $propItem->[1];
441 :     my $count = $sprout->GetCount(['Feature', 'HasProperty'], "HasProperty(to-link) = ?",
442 :     [$propItem->[2]]);
443 :     push @retVal, [$label, $count];
444 :     }
445 :     # Return the result.
446 :     return @retVal;
447 :     }
448 :    
449 : parrello 1.1 =head3 GetFeatures
450 :    
451 :     C<< my @features = GetFeatures($sprout, $genomeID); >>
452 :    
453 :     Return the features of the specified genome in the specified Sprout instance.
454 :    
455 :     =over 4
456 :    
457 :     =item sprout
458 :    
459 :     Sprout instance to use to get the features.
460 :    
461 :     =item genomeID
462 :    
463 :     ID of the genome in question.
464 :    
465 :     =item RETURN
466 :    
467 :     Returns a list of 2-tuples, the first element being the feature ID and the second its
468 :     functional assignment (if any).
469 :    
470 :     =back
471 :    
472 :     =cut
473 :    
474 :     sub GetFeatures {
475 :     # Get the parameters.
476 :     my ($sprout, $genomeID) = @_;
477 :     # Get a list of the feature IDs and map them to their functional assignments.
478 :     my @retVal = map { [$_, $sprout->FunctionOf($_)] } $sprout->GetFlat(['HasFeature'],
479 :     "HasFeature(from-link) = ? ORDER BY HasFeature(to-link)",
480 :     [$genomeID], 'HasFeature(to-link)');
481 :     # Return the result.
482 :     return @retVal;
483 :     }
484 :    
485 :     =head3 ShowLists
486 :    
487 : parrello 1.2 C<< ShowLists($all, %lists); >>
488 : parrello 1.1
489 : parrello 1.2 Display a set of lists. Each list should consist of 2-tuples.
490 : parrello 1.1
491 :     =over 4
492 :    
493 : parrello 1.2 =item all
494 :    
495 :     TRUE if details should be displayed; FALSE if only summaries should be displayed.
496 :    
497 : parrello 1.1 =item lists
498 :    
499 :     A hash mapping list names to list references.
500 :    
501 :     =cut
502 :    
503 :     sub ShowLists {
504 :     # Get the parameters.
505 : parrello 1.2 my $all = shift @_;
506 : parrello 1.1 my %lists = @_;
507 :     # Loop through the lists in alphabetical order by list name.
508 : parrello 1.6 for my $listName (sort keys %lists) {
509 : parrello 1.1 # Get the list itself.
510 :     my $list = $lists{$listName};
511 :     # Get the number of list items.
512 :     my $listSize = scalar @{$list};
513 : parrello 1.6 # Only proceed if the list is nonempty.
514 :     if ($listSize > 0) {
515 : parrello 1.7 my $header = ShowHeader($listName, $listSize);
516 : parrello 1.6 print "$header\n";
517 :     Trace($header) if T(3);
518 :     # If we're at trace level 3, display the list.
519 :     if ($all) {
520 :     # Put a spacer under the title.
521 :     print "\n";
522 :     # Get the width of the name column.
523 :     my $width = 0;
524 :     for my $entryLen (map { length $_->[0] } @{$list}) {
525 :     $width = $entryLen if $entryLen > $width;
526 :     }
527 :     # Now display the list.
528 :     for my $entry (@{$list}) {
529 :     my ($name, $data) = @{$entry};
530 :     print " $name" . (" " x ($width - length $name)) . " $data\n";
531 :     }
532 :     print "\n\n";
533 : parrello 1.1 }
534 :     }
535 :     }
536 :     }
537 :    
538 : parrello 1.7 =head3 ShowHeader
539 :    
540 :     C<< my $header = ShowHeader($name, $count); >>
541 :    
542 :     Return a list header for a list of the specified length.
543 :    
544 :     =over 4
545 :    
546 :     =item name
547 :    
548 :     Name of the list.
549 :    
550 :     =item count
551 :    
552 :     Number of entries in the list.
553 :    
554 :     =item RETURN
555 :    
556 :     Returns a list header that shows the name of the list and the number of entries.
557 :    
558 :     =back
559 :    
560 :     =cut
561 :    
562 :     sub ShowHeader {
563 :     # Get the parameters.
564 :     my ($name, $count) = @_;
565 :     # Declare the return variable.
566 :     my $retVal;
567 :     if ($count == 0) {
568 :     $retVal = "*** $name: none";
569 :     } elsif ($count == 1) {
570 :     $retVal = "*** $name: one";
571 :     } else {
572 :     $retVal = "*** $name: $count";
573 :     }
574 :     # Return the result.
575 :     return $retVal;
576 :     }
577 :    
578 : parrello 1.11 =head3 ShowCounts
579 :    
580 :     C<< ShowCounts($sprout); >>
581 :    
582 :     Display general counts for the specified sprout instance. These counts are
583 :     used in progress reports.
584 :    
585 :     =over 4
586 :    
587 :     =item sprout
588 :    
589 :     Sprout instance for which counts are to be produced.
590 :    
591 :     =back
592 :    
593 :     =cut
594 :    
595 :     sub ShowCounts {
596 :     # Get the parameters.
597 :     my ($sprout) = @_;
598 :     # Count genomes and subsystems.
599 :     my $genomes = $sprout->GetCount(['Genome']);
600 :     my $subsystems = $sprout->GetCount(['Subsystem']);
601 :     # Count roles, external functional assignments, and functional couplings.
602 :     my $roles = $sprout->GetCount(['OccursInSubsystem']);
603 :     my $funcs = $sprout->GetCount(['ExternalAliasFunc']);
604 :     my $couples = $sprout->GetCount(['Coupling']);
605 :     # Count features and BBHs.
606 :     my $bbhs = int ($sprout->GetCount(['IsBidirectionalBestHitOf']) / 2);
607 :     my $features = $sprout->GetCount(['Feature']);
608 :     # Display the counts.
609 :     print "Genomes = $genomes.\n";
610 :     print "Subsystems = $subsystems.\n";
611 :     print "Roles = $roles.\n";
612 :     print "External function assignments = $funcs.\n";
613 :     print "Features = $features.\n";
614 :     print "Bidirectional Best Hits = $bbhs.\n";
615 :     print "Functional couplings = $couples.\n";
616 :     print "\n";
617 :     }
618 : parrello 1.1 1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3