1. use strict;
2. use ANNOserver;
3.
4. # Example 2: Metabolic Reconstruction for a Complete Prokaryotic Genome
5.
6. # This script reads a set of gene ID / function pairs and produces a table of the
7. # subsystems that can be identified. The pairs are taken from the standard
8. # input. The input is in the form of a tab-delimited file, each record
9. # containing a gene ID followed by the function assigned to the gene. The output
10. # file is also tab-delimited. Each output record will contain a subsystem ID,
11. # its variant code, the relevant functional role, and its gene ID.
12. #
13. # By passing in all of the functional roles for a particular genome, you can
14. # use this program to find roles that may imply missing gene calls.
15.
16.
17. my $asObject = ANNOserver->new();
18. my @pairs;
19. while () {
20. chomp;
21. my ($id, $role) = split(/\t/, $_);
22. push @pairs, [$role, $id];
23. }
24.
25. my $reconstruction = $asObject->metabolic_reconstruction(-roles => \@pairs);
26. for my $record (@$reconstruction) {
27. my ($variantID, $role, $id) = @$record;
28. my ($subsysID, $code) = $variantID =~ /^(.+):(.+)$/;
29. print join("\t", $subsysID, $code, $role, $id) . "\n";
30. }