[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.746, Mon Jan 26 21:09:30 2009 UTC revision 1.747, Fri Jan 30 12:42:15 2009 UTC
# Line 18477  Line 18477 
18477      }      }
18478  }  }
18479    
18480    =head3 subsystems_for_pegs_complete
18481    
18482     Return the list of subsystems, roles and variants that the pegs appear in.
18483     Returns a hash keyed by peg. Each item in the hash is a reference to a tuple
18484     of subsystem, role and variant. If the last argument ($include_aux)
18485     is "true", also roles playing auxiliary roles will be returned.
18486    
18487    =cut
18488    
18489    sub subsystems_for_pegs_complete {
18490        my ($self, $pegs, $include_aux) = @_;
18491        my $rdbH = $self->db_handle;
18492        my %results;
18493    
18494        my $q = "SELECT subsystem, role, variant, protein FROM (SELECT subsystem, role, variant, protein FROM subsystem_index WHERE protein IN ('".join("', '", @$pegs)."')) AS t1 LEFT JOIN deleted_fids ON t1.protein=deleted_fids.fid WHERE deleted_fids.fid IS NULL";
18495        unless ($include_aux) {
18496            $q = "SELECT t2.subsystem, t2.role, t2.variant, t2.protein FROM (".$q.") AS t2 LEFT JOIN aux_roles ON (t2.subsystem=aux_roles.subsystem AND t2.role=aux_roles.role) WHERE aux_roles.role IS NULL";
18497        }
18498        my $ret = $rdbH->SQL($q);
18499    
18500        foreach my $row (@$ret) {
18501            if (exists($results{$row->[3]})) {
18502                push(@{$results{$row->[3]}}, [ $row->[0], $row->[1], $row->[2] ]);
18503            } else {
18504                $results{$row->[3]} = [ [ $row->[0], $row->[1], $row->[2] ] ];
18505            }
18506        }
18507    
18508        return %results;
18509    }
18510    
18511  =head3 subsystems_for_peg  =head3 subsystems_for_peg
18512    
18513   Return the list of subsystems and roles that this peg appears in.   Return the list of subsystems and roles that this peg appears in.

Legend:
Removed from v.1.746  
changed lines
  Added in v.1.747

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3