[Bio] / FigKernelScripts / server_paper_example2.pl Repository:
ViewVC logotype

View of /FigKernelScripts/server_paper_example2.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (download) (as text) (annotate)
Mon Jan 4 20:05:58 2010 UTC (10 years, 1 month ago) by disz
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, rast_rel_2014_0912, myrast_rel40, mgrast_dev_05262011, mgrast_dev_04082011, rast_rel_2010_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, rast_rel_2010_0526, rast_rel_2014_0729, mgrast_dev_02212011, rast_rel_2010_1206, mgrast_release_3_0, mgrast_dev_03252011, rast_rel_2010_0118, rast_rel_2011_0119, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, rast_rel_2010_0827, myrast_33, rast_rel_2011_0928, mgrast_dev_04052011, mgrast_dev_02222011, mgrast_dev_10262011, HEAD
Changes since 1.6: +3 -3 lines
Changed to use ANNO server

use strict;
use ANNOserver;

# Example 2: Metabolic Reconstruction for a Complete Prokaryotic Genome

# This script reads a set of gene ID / function pairs and produces a table of the
# subsystems that can be identified. The pairs are taken from the standard
# input. The input is in the form of a tab-delimited file, each record
# containing a gene ID followed by the function assigned to the gene. The output
# file is also tab-delimited. Each output record will contain a subsystem ID,
# its variant code, the relevant functional role, and its gene ID.
#
# By passing in all of the functional roles for a particular genome, you can
# use this program to find roles that may imply missing gene calls.


my $asObject = ANNOserver->new();
my @pairs;
while (<STDIN>) {
    chomp;
    my ($id, $role) = split(/\t/, $_);
    push @pairs, [$role, $id];
}

my $reconstruction = $asObject->metabolic_reconstruction(-roles => \@pairs);
for my $record (@$reconstruction) {
    my ($variantID, $role, $id) = @$record;
    my ($subsysID, $code) = $variantID =~ /^(.+):(.+)$/;
    print join("\t", $subsysID, $code, $role, $id) . "\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3