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

Diff of /FigKernelScripts/svr_pegs_in_subsystems.pl

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

revision 1.1, Wed Jul 15 23:36:53 2009 UTC revision 1.2, Fri Jul 17 19:45:18 2009 UTC
# Line 41  Line 41 
41          push (@subs, $_);          push (@subs, $_);
42  }  }
43    
 #print Dumper @genomes;  
44  my $pegs_inss = $ss->pegs_in_subsystems(\@genomes, \@subs);  my $pegs_inss = $ss->pegs_in_subsystems(\@genomes, \@subs);
45  if ($roles) {  if ($roles) {
46          foreach my $pegs (@{$pegs_inss}) {          foreach my $ss_role (@{$pegs_inss}) { #foreach subsystem/role
47                  #ss, role, peg                  #(ss, role, (peg))
48                  if ($group) {                  if ($group) {
49                          print $pegs->[0], "\t", $pegs->[1]->[0], "\t", join (",", @{$pegs->[1]->[1]}), "\n";                          print $ss_role->[0], "\t", $ss_role->[1]->[0], "\t", join (",", @{$ss_role->[1]->[1]}), "\n";
50                  } else {                  } else {
51                          foreach my $peg (@{$pegs->[1]->[1]}) {                          foreach my $peg (@{$ss_role->[1]->[1]}) { #foreach peg in this peg list
52                                  print join("\t", ($pegs->[0], $pegs->[1]->[0], $peg)), "\n";                                  print join("\t", ($ss_role->[0], $ss_role->[1]->[0], $peg)), "\n";
53                          }                          }
54                  }                  }
55          }          }
56    
57  } else { # do group here  } else { # no roles
58          my %ss_pegs;          my %ss_pegs;
59          foreach my $pegs (@{$pegs_inss}) {          foreach my $ss_role (@{$pegs_inss}) {
60                  foreach my $peg (@{$pegs->[1]->[1]}) {                  foreach my $peg (@{$ss_role->[1]->[1]}) {
61                          push (@{$ss_pegs{$pegs->[0]}}, $peg);                          $ss_pegs{$ss_role->[0]}{$peg} = 1;
62                  }                  }
63          }          }
64          for my $k (keys %ss_pegs) {          for my $ss (keys %ss_pegs) {
65                  print $k, "\t", join(",", @{$ss_pegs{$k}}), "\n";                  if ($group) {
66                            print $ss, "\t", join(",", keys %{$ss_pegs{$ss}}), "\n";
67                    } else {
68                            foreach my $peg (keys %{$ss_pegs{$ss}}) {
69                                    print join("\t", $ss, $peg), "\n";
70                            }
71          }          }
72  }  }
73    }
74    
75  exit;  exit;
76    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3