[Bio] / FigKernelPackages / model.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/model.pm

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

revision 1.27, Wed Dec 3 14:28:04 2008 UTC revision 1.28, Thu Dec 11 16:54:24 2008 UTC
# Line 4320  Line 4320 
4320    
4321  }  }
4322    
4323    # return three values:
4324    # 1) reference to a hash of invalid roles, i.e., roles no longer in the subsystem.
4325    # 2) reference to a hash of invalid reactions, i.e., reactions no longer in KEGG.
4326    # 3) flag set to main classification value if the subsystem classification has changed
4327    #    to Experimental or none.
4328    sub check_hope_info
4329    {
4330        my ($ss) = @_;
4331        my (%invalid_roles, %invalid_reactions, $invalid_classification);
4332        my $sub = $fig->get_subsystem($ss);
4333    
4334        if (! defined $sub)
4335        {
4336            return ( {}, {}, "Subsystem no longer exists" );
4337        }
4338    
4339        my $classification = $sub->get_classification->[0];
4340        $invalid_classification = $classification if ($classification eq '' || $classification =~ /Experimental/);
4341        my %hope_reactions = $sub->get_hope_reactions;
4342        my @roles = $sub->get_roles;
4343        my %roles;
4344        my %reactions;
4345    
4346        map { $roles{$_} = 1 } @roles;
4347    
4348        foreach my $role (keys %hope_reactions)
4349        {
4350            if (! exists($roles{$role}))
4351            {
4352                $invalid_roles{$role} = $hope_reactions{$role};
4353            }
4354    
4355            map {push @{$reactions{$_}}, $role} @{$hope_reactions{$role}};
4356        }
4357    
4358        foreach my $name ($sub->get_hope_scenario_names)
4359        {
4360            my @additional_reactions = $sub->get_hope_additional_reactions($name);
4361            map { push @{$reactions{$_}}, "ADDITIONAL_REACTIONS" } @additional_reactions;
4362        }
4363    
4364    
4365        foreach my $reaction (keys %reactions)
4366        {
4367            unless ($fig->valid_reaction_id($reaction))
4368            {
4369                $invalid_reactions{$reaction} = $reactions{$reaction};
4370            }
4371        }
4372    
4373        return (\%invalid_roles, \%invalid_reactions, $invalid_classification);
4374    
4375    }
4376    
4377  1;  1;

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3