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

Diff of /FigKernelPackages/FIG.pm

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

revision 1.800, Tue Aug 25 20:57:42 2009 UTC revision 1.801, Wed Aug 26 20:24:23 2009 UTC
# Line 18763  Line 18763 
18763    
18764   Return the list of subsystems and roles that this peg appears in.   Return the list of subsystems and roles that this peg appears in.
18765   Returns an array. Each item in the array is   Returns an array. Each item in the array is
18766   a reference to a tuple of subsystem and role.  If the last argument ($noaux)   a reference to a tuple of subsystem and role.  If the second argument ($noaux)
18767   is "true", only roles playing non-auxiliary roles will be returned.   is "true", only roles playing non-auxiliary roles will be returned.
18768     If the third argument ($active_only), only roles where the peg's row
18769     has a non-0 and non-"-1" variant are returned.
18770    
18771  =cut  =cut
18772    
18773  sub subsystems_for_peg  sub subsystems_for_peg
18774  {  {
18775      my($self, $peg,$noaux) = @_;      my($self, $peg,$noaux, $active_only) = @_;
18776    
18777      if ($self->is_deleted_fid($peg)) { return () }      if ($self->is_deleted_fid($peg)) { return () }
18778    
# Line 18778  Line 18780 
18780    
18781      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
18782    
18783      my $q = "SELECT subsystem, role FROM subsystem_index WHERE protein = '$peg'";      my $q = "SELECT subsystem, role FROM subsystem_index WHERE protein = ?";
18784        if ($active_only)
18785        {
18786            $q .= " AND (variant != '-1' and variant != '0') ";
18787        }
18788    
18789      if (my $relational_db_response = $rdbH->SQL($q))      if (my $relational_db_response = $rdbH->SQL($q, undef, $peg))
18790      {      {
18791          my %seen;          my %seen;
18792          my @in;          my @in;
# Line 18797  Line 18803 
18803          }          }
18804          if ($noaux)          if ($noaux)
18805          {          {
18806                #
18807                # Note that we can handle this case more directly by joining to the aux_roles
18808                # table
18809                # SELECT i.subsystem, i.role
18810                # FROM subsystem_index i LEFT JOIN aux_roles a ON i.role = a.role
18811                # WHERE protein = ? AND a.subsystem IS NULL
18812                #
18813    
18814              my @nonaux = ();              my @nonaux = ();
18815              foreach my $x (@in)              foreach my $x (@in)
18816              {              {
# Line 19257  Line 19271 
19271    
19272  sub peg_to_subsystems  sub peg_to_subsystems
19273  {  {
19274      my($self, $peg, $noaux) = @_;      my($self, $peg, $noaux, $active_only) = @_;
19275    
19276      if ($self->is_deleted_fid($peg)) { return () }      if ($self->is_deleted_fid($peg)) { return () }
19277      my @subs;      my @subs;
19278      my %in = map { $_->[0] =~ s/ /_/g; $_->[0] => 1 } $self->subsystems_for_peg($peg,$noaux);      my %in = map { $_->[0] =~ s/ /_/g; $_->[0] => 1 } $self->subsystems_for_peg($peg,$noaux, $active_only);
19279      return sort keys(%in);      return sort keys(%in);
19280  }  }
19281    
# Line 22647  Line 22661 
22661  =cut  =cut
22662    
22663  sub to_structured_english {  sub to_structured_english {
22664      my ($self, $peg, $escape_flag) = @_;      my ($self, $peg, $escape_flag, %options) = @_;
22665      return FIGRules::to_structured_english($self, $peg, $escape_flag);      return FIGRules::to_structured_english($self, $peg, $escape_flag, %options);
22666  }  }
22667    
22668  =head3 GetUserDataDirectory  =head3 GetUserDataDirectory

Legend:
Removed from v.1.800  
changed lines
  Added in v.1.801

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3