[Bio] / FigWebServices / subsystem_server_sapling.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/subsystem_server_sapling.cgi

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

revision 1.2, Mon Jun 22 19:48:14 2009 UTC revision 1.6, Wed Jul 15 20:52:28 2009 UTC
# Line 81  Line 81 
81          print &YAML::Dump($result);          print &YAML::Dump($result);
82    
83      } elsif  ($function eq "all_subsystems") {      } elsif  ($function eq "all_subsystems") {
84          print $cgi->header();          #print $cgi->header();
85    
86          my @resultRows = $sapling->GetAll("Subsystem Includes Role",          my @resultRows = $sapling->GetAll("Subsystem Includes Role",
87                                        'ORDER BY Subsystem(id)', [], [qw(Subsystem(id) Subsystem(curator)                                        'ORDER BY Subsystem(id)', [], [qw(Subsystem(id) Subsystem(curator)
# Line 102  Line 102 
102          }          }
103          print &YAML::Dump($result);          print &YAML::Dump($result);
104    
105        } elsif ($function eq "pegs_in_subsystems") {
106            my $result = [];
107            my (@args)  = &YAML::Load($cgi->param('args'));
108            my $genomes = $args[0];
109            my $subs = $args[1];
110            foreach my $sub (@{$subs}) {
111                    my $ss = SaplingSubsys->new($sub, $sapling);
112                    foreach my $g (@{$genomes}) {
113                            my @roles = $ss->get_roles_for_genome($g, 1);
114                            foreach my $role (@roles) {
115                                    push (@$result, [$sub, $role]);
116                            }
117                    }
118            }
119            print &YAML::Dump($result);
120    
121       } elsif ($function eq "pegs_implementing_roles") {
122            my $result = [];
123            my (@args)  = &YAML::Load($cgi->param('args'));
124            my $subsys = $args[0];
125            my @roles = @{$args[1]};
126            my $ss = SaplingSubsys->new($subsys, $sapling);
127            foreach my $role (@roles) {
128                    my @pegs = $ss->pegs_for_role($role);
129                    push (@$result, [$role, \@pegs]);
130            }
131    
132            print &YAML::Dump($result);
133    
134      } elsif ($function eq "metabolic_reconstruction") {      } elsif ($function eq "metabolic_reconstruction") {
135    
136          #print $cgi->header();          #print $cgi->header();
# Line 166  Line 195 
195          my $qh = $sapling->Get("Subsystem Describes Variant", 'Subsystem(id) = ? AND Variant(type) = ?', [$sub, 'normal']);          my $qh = $sapling->Get("Subsystem Describes Variant", 'Subsystem(id) = ? AND Variant(type) = ?', [$sub, 'normal']);
196          while (my $resultRow = $qh->Fetch()) {          while (my $resultRow = $qh->Fetch()) {
197              my @variantRoleRule = $resultRow->Value('Variant(role-rule)');              my @variantRoleRule = $resultRow->Value('Variant(role-rule)');
198              my $variantCode = $resultRow->Value('Variant(code)');              my ($variantCode) = $resultRow->Value('Variant(code)');
199              my $variantId = $sub.":".$variantCode;              my $variantId = $sub.":".$variantCode;
200              foreach my $setB (@variantRoleRule) {              foreach my $setB (@variantRoleRule) {
201                          my $size = is_A_a_superset_of_B($setA, $setB);                          my $size = is_A_a_superset_of_B($setA, $setB);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3