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

View of /FigKernelScripts/check_hope_info.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (as text) (annotate)
Wed Oct 15 21:24:43 2008 UTC (11 years, 5 months ago) by dejongh
Branch: MAIN
CVS Tags: mgrast_rel_2008_1110_v2, mgrast_rel_2008_1110, rast_rel_2008_10_29, rast_rel_2008_11_24
Changes since 1.3: +2 -0 lines
Check for classification change to experimental

use strict;
use FIG;
use Subsystem;

my $fig = new FIG;
my @subsystems = @ARGV;

if (scalar @subsystems == 0)
{
  open(SS, "$FIG_Config::data/Global/Models/hope_supersets.txt");

  while(<SS>){
    chomp;
    my ($junk, $ss) = split "\t" , $_;
    push(@subsystems, $ss);
  }
}

foreach my $ss (@subsystems)
{
    print "Checking hope info for $ss\n";

    my $sub = $fig->get_subsystem($ss);
    my $classification = $sub->get_classification->[0];
    print "\tClassification changed: $classification\n" if ($classification eq '' || $classification =~ /Experimental/);
    my %hope_reactions = $sub->get_hope_reactions;
    my @roles = $sub->get_roles;
    my %roles;
    my %reactions;
    
    map { $roles{$_} = 1 } @roles;

    foreach my $role (keys %hope_reactions)
    {
	if (! defined($roles{$role}))
	{
	    print "\tRole no longer exists: $role [@{$hope_reactions{$role}}]\n";
	}
	
	map {push @{$reactions{$_}}, $role} @{$hope_reactions{$role}};
    }

    foreach my $reaction (keys %reactions)
    {
	unless ($fig->valid_reaction_id($reaction))
	{
	    print "\tReaction is not valid: $reaction [@{$reactions{$reaction}}]\n";
	}
    }

}


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3