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

Diff of /FigKernelPackages/Subsystem.pm

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

revision 1.118, Fri Nov 2 19:12:58 2007 UTC revision 1.119, Thu Dec 6 13:59:34 2007 UTC
# Line 156  Line 156 
156    
157  =head3 new  =head3 new
158    
159  C<< my $sub = Subsystem->new($subName, $fig, $createFlag); >>      my $sub = Subsystem->new($subName, $fig, $createFlag);
160    
161  Load the subsystem. If it does not exist, and $createFlag is true, create  Load the subsystem. If it does not exist, and $createFlag is true, create
162  a new, empty subsystem.  a new, empty subsystem.
# Line 330  Line 330 
330    
331  =head3 get_diagrams  =head3 get_diagrams
332    
333  C<< my @list = $sub->get_diagrams(); >>      my @list = $sub->get_diagrams();
334    
335  Return a list of the diagrams associated with this subsystem. Each diagram  Return a list of the diagrams associated with this subsystem. Each diagram
336  is represented in the return list as a 4-tuple C<[diagram_id, diagram_name,  is represented in the return list as a 4-tuple C<[diagram_id, diagram_name,
# Line 386  Line 386 
386    
387  =head3 get_diagram  =head3 get_diagram
388    
389  C<< my ($name, $pageURL, $imgURL) = $sub->get_diagram($id); >>      my ($name, $pageURL, $imgURL) = $sub->get_diagram($id);
390    
391  Get the information (if any) for the specified diagram. The diagram corresponds  Get the information (if any) for the specified diagram. The diagram corresponds
392  to a subdirectory of the subsystem's C<diagrams> directory. For example, if the  to a subdirectory of the subsystem's C<diagrams> directory. For example, if the
# Line 1080  Line 1080 
1080  {  {
1081      my($self) = @_;      my($self) = @_;
1082    
1083      my $hope_reactions = {};      my $hope_reactions = FIGRules::GetHopeReations($self, $self->{dir});
     if (open(HOPE_REACT,"<$self->{dir}/hope_reactions"))  
     {  
         while (defined($_ = <HOPE_REACT>))  
         {  
             if ($_ =~ /^(\S.*\S)\t(\S+)/)  
             {  
                 my ($role, $reactions) = ($1, $2);  
   
                 if ($self->get_role_index($role) >= 0)  
                 {  
                     push(@{$hope_reactions->{$role}},split(/,\s*/,$reactions));  
                 }  
                 else  
                 {  
                     print STDERR "\nIgnoring obsolete role '$role' for ", $self->get_name,  
                     ", role index is ", $self->get_role_index($role), "\n";  
                 }  
             }  
         }  
         close(HOPE_REACT);  
     }  
1084    
1085      $self->{hope_reactions} = $hope_reactions;      $self->{hope_reactions} = $hope_reactions;
1086  }  }
# Line 1415  Line 1394 
1394    
1395  =head3 get_peg_roles  =head3 get_peg_roles
1396    
1397  C<< my @cols = $sub->get_peg_roles($peg); >>      my @cols = $sub->get_peg_roles($peg);
1398    
1399  Return the column numbers in which the specified PEG appears.  Return the column numbers in which the specified PEG appears.
1400    
# Line 1449  Line 1428 
1428    
1429  =head3 get_all_pegs  =head3 get_all_pegs
1430    
1431  C<< my @pegs = $sub->get_all_pegs(); >>      my @pegs = $sub->get_all_pegs();
1432    
1433  Return all pegs appearing in the subsystem.  Return all pegs appearing in the subsystem.
1434    
 =item RETURN  
   
 List of PEG ids.  
   
 =back  
   
1435  =cut  =cut
1436    
1437  sub get_all_pegs {  sub get_all_pegs {
# Line 1782  Line 1755 
1755    
1756  =head3 write_spreadsheet  =head3 write_spreadsheet
1757    
1758  C<< $sub->write_spreadsheet($fh); >>      $sub->write_spreadsheet($fh);
1759    
1760  Write the spreadsheet for this subsystem to filehandle $fh.  Write the spreadsheet for this subsystem to filehandle $fh.
1761    
# Line 1919  Line 1892 
1892    
1893  =head3 get_genomes  =head3 get_genomes
1894    
1895  C<< my @genomeList = $sub->get_genomes(); >>      my @genomeList = $sub->get_genomes();
1896    
1897  Return a list of the genome IDs for this subsystem. Each genome corresponds to a row  Return a list of the genome IDs for this subsystem. Each genome corresponds to a row
1898  in the subsystem spreadsheet. Indexing into this list returns the ID of the genome  in the subsystem spreadsheet. Indexing into this list returns the ID of the genome
# Line 1938  Line 1911 
1911    
1912  =head3 get_variant_codes  =head3 get_variant_codes
1913    
1914  C<< my @codes = $sub->get_variant_codes(); >>      my @codes = $sub->get_variant_codes();
1915    
1916  Return a list of the variant codes for each genome, in row index order. The variant  Return a list of the variant codes for each genome, in row index order. The variant
1917  code indicates which variation of the subsystem is used by the given genome.  code indicates which variation of the subsystem is used by the given genome.
# Line 1956  Line 1929 
1929    
1930  =head3 get_variant_code  =head3 get_variant_code
1931    
1932  C<< my $code = $sub->get_variant_code($gidx); >>      my $code = $sub->get_variant_code($gidx);
1933    
1934  Return the variant code for the specified genome. Each subsystem has multiple  Return the variant code for the specified genome. Each subsystem has multiple
1935  variants which involve slightly different chemical reactions, and each variant  variants which involve slightly different chemical reactions, and each variant
# Line 2040  Line 2013 
2013    
2014  =head3 get_roles  =head3 get_roles
2015    
2016  C<< my @roles = $sub->get_roles(); >>      my @roles = $sub->get_roles();
2017    
2018  Return a list of the subsystem's roles. Each role corresponds to a column  Return a list of the subsystem's roles. Each role corresponds to a column
2019  in the subsystem spreadsheet. The list entry at a specified position in  in the subsystem spreadsheet. The list entry at a specified position in
# Line 2068  Line 2041 
2041    
2042  =head3 get_abbr_for_role  =head3 get_abbr_for_role
2043    
2044  C<< my $abbr = $sub->get_abbr_for_role($name); >>      my $abbr = $sub->get_abbr_for_role($name);
2045    
2046  Return the abbreviation for the given role name.  Return the abbreviation for the given role name.
2047    
# Line 2091  Line 2064 
2064    
2065  =head3 get_roles_for_genome  =head3 get_roles_for_genome
2066    
2067  C<< my $abbr = $sub->get_roles_for_genome($genome_id); >>      my $abbr = $sub->get_roles_for_genome($genome_id);
2068    
2069  Return the list of roles for which the given genome has nonempty cells.  Return the list of roles for which the given genome has nonempty cells.
2070    
# Line 2203  Line 2176 
2176    
2177  =head3 get_genome_index  =head3 get_genome_index
2178    
2179  C<< my $idx = $sub->get_genome_index($genome); >>      my $idx = $sub->get_genome_index($genome);
2180    
2181  Return the row index for the genome with the specified ID.  Return the row index for the genome with the specified ID.
2182    
# Line 2238  Line 2211 
2211    
2212  =head3 get_role_index  =head3 get_role_index
2213    
2214  C<< my $idx = $sub->get_role_index($role); >>      my $idx = $sub->get_role_index($role);
2215    
2216  Return the column index for the role with the specified ID.  Return the column index for the role with the specified ID.
2217    
# Line 2272  Line 2245 
2245    
2246  =head3 get_role_abbr  =head3 get_role_abbr
2247    
2248  C<< my $abbr = $sub->get_role_abbr($ridx); >>      my $abbr = $sub->get_role_abbr($ridx);
2249    
2250  Return the abbreviation for the role in the specified column. The abbreviation  Return the abbreviation for the role in the specified column. The abbreviation
2251  is a shortened identifier that is not necessarily unique, but is more likely to  is a shortened identifier that is not necessarily unique, but is more likely to
# Line 2308  Line 2281 
2281    
2282  =head3 set_pegs_in_cell  =head3 set_pegs_in_cell
2283    
2284  C<< $sub->set_pegs_in_cell($genome, $role, $peg_list); >>      $sub->set_pegs_in_cell($genome, $role, $peg_list);
2285    
2286  Set the cell for the given genome and role to $peg_list.  Set the cell for the given genome and role to $peg_list.
2287    
# Line 2425  Line 2398 
2398    
2399  =head3 get_pegs_from_cell  =head3 get_pegs_from_cell
2400    
2401  C<< my @pegs = $sub->get_pegs_from_cell($rowstr, $colstr); >>      my @pegs = $sub->get_pegs_from_cell($rowstr, $colstr);
2402    
2403  Return a list of the peg IDs for the features in the specified spreadsheet cell.  Return a list of the peg IDs for the features in the specified spreadsheet cell.
2404    
# Line 2545  Line 2518 
2518      $self->{row_active_subset} = $subset;      $self->{row_active_subset} = $subset;
2519  }  }
2520    
2521    # This method is deprecated. Use get_subset_namesC.
2522  sub get_subset_names  sub get_subset_names
2523  {  {
2524      my($self) = @_;      my($self) = @_;
# Line 2555  Line 2528 
2528    
2529  =head3 get_subset_namesC  =head3 get_subset_namesC
2530    
2531  C<< my @subsetNames = $sub->get_subset_namesC(); >>      my @subsetNames = $sub->get_subset_namesC();
2532    
2533  Return a list of the names for all the column (role) subsets. Given a subset  Return a list of the names for all the column (role) subsets. Given a subset
2534  name, you can use the L</get_subsetC_roles> method to get the roles in the  name, you can use the L</get_subsetC_roles> method to get the roles in the
# Line 2579  Line 2552 
2552    
2553  =head3 get_subsetC_roles  =head3 get_subsetC_roles
2554    
2555  C<< my @roles = $sub->get_subsetC_roles($subname); >>      my @roles = $sub->get_subsetC_roles($subname);
2556    
2557  Return the names of the roles contained in the specified role (column) subset.  Return the names of the roles contained in the specified role (column) subset.
2558    
# Line 2624  Line 2597 
2597    
2598  =head3 get_subsetR  =head3 get_subsetR
2599    
2600  C<< my @genomes = $sub->get_subsetR($subName); >>      my @genomes = $sub->get_subsetR($subName);
2601    
2602  Return the genomes in the row subset indicated by the specified subset name.  Return the genomes in the row subset indicated by the specified subset name.
2603    
# Line 2706  Line 2679 
2679    
2680  =head3 set_subsetC  =head3 set_subsetC
2681    
2682  C<< $sub->set_subsetC($name, $members); >>      $sub->set_subsetC($name, $members);
2683    
2684  Create a subset with the given name and members.  Create a subset with the given name and members.
2685    
# Line 2772  Line 2745 
2745    
2746  =head3 set_roles  =head3 set_roles
2747    
2748  C<< $sub->set_roles($role_list); >>      $sub->set_roles($role_list);
2749    
2750  Set the list of roles. C<$role_list> is a list of tuples C<[$role_name, $abbreviation]>.  Set the list of roles. C<$role_list> is a list of tuples C<[$role_name, $abbreviation]>.
2751    
# Line 3255  Line 3228 
3228    
3229  =head3 get_notes  =head3 get_notes
3230    
3231  C<< my $text = $sub->get_notes(); >>      my $text = $sub->get_notes();
3232    
3233  Return the descriptive notes for this subsystem.  Return the descriptive notes for this subsystem.
3234    
# Line 3270  Line 3243 
3243    
3244  =head3 get_description  =head3 get_description
3245    
3246  C<< my $text = $sub->get_description(); >>      my $text = $sub->get_description();
3247    
3248  Return the description for this subsystem.  Return the description for this subsystem.
3249    
# Line 3285  Line 3258 
3258    
3259  =head3 get_literature  =head3 get_literature
3260    
3261  C<< my $text = $sub->get_literature(); >>      my $text = $sub->get_literature();
3262    
3263  Return the literature for this subsystem.  Return the literature for this subsystem.
3264    
# Line 3300  Line 3273 
3273    
3274  =head3 get_reactions  =head3 get_reactions
3275    
3276  C<< my $reactHash = $sub->get_reactions(); >>      my $reactHash = $sub->get_reactions();
3277    
3278  Return a reference to a hash that maps each role ID to a list of the reactions  Return a reference to a hash that maps each role ID to a list of the reactions
3279  catalyzed by the role.  catalyzed by the role.
# Line 3593  Line 3566 
3566    
3567  =head3 get_curator  =head3 get_curator
3568    
3569  C<< my $userName = $sub->get_curator(); >>      my $userName = $sub->get_curator();
3570    
3571  Return the name of this subsystem's official curator.  Return the name of this subsystem's official curator.
3572    
# Line 3848  Line 3821 
3821    
3822  =head3 functional_role_instances  =head3 functional_role_instances
3823    
3824  C<< my @role_instances = $sub->functional_role_instances($role); >>      my @role_instances = $sub->functional_role_instances($role);
3825    
3826  Returns the set of genes for a functional role that belong to  Returns the set of genes for a functional role that belong to
3827  genomes with functional variants (> 0).  genomes with functional variants (> 0).
# Line 3902  Line 3875 
3875    
3876  =head3 get_dir_from_name  =head3 get_dir_from_name
3877    
3878  C<< my $dirName = Subsystem::get_dir_from_name($name); >>      my $dirName = Subsystem::get_dir_from_name($name);
3879    
3880  Return the name of the directory containing the SEED data for the specified  Return the name of the directory containing the SEED data for the specified
3881  subsystem.  subsystem.
# Line 4295  Line 4268 
4268    
4269  =head3 GetDiagramIDs  =head3 GetDiagramIDs
4270    
4271  C<< my @diagramIDs = Subsystem::GetDiagramIDs($subDir); >>      my @diagramIDs = Subsystem::GetDiagramIDs($subDir);
4272    
4273  Return a list of the subsystem diagram IDs. The parameters are  Return a list of the subsystem diagram IDs. The parameters are
4274    
# Line 4328  Line 4301 
4301    
4302  =head3 GetDiagramName  =head3 GetDiagramName
4303    
4304  C<< my $name = Subsystem::GetDiagramName($subDir, $diagramID); >>      my $name = Subsystem::GetDiagramName($subDir, $diagramID);
4305    
4306  Return the name of the subsystem diagram with the specified ID.  Return the name of the subsystem diagram with the specified ID.
4307    
# Line 4380  Line 4353 
4353    
4354  =head3 ComputeDiagramURLs  =head3 ComputeDiagramURLs
4355    
4356  C<< my ($link, $imgLink) = Subsystem::ComputeDiagramURLs($self, $ssName, $diagramID, $sprout); >>      my ($link, $imgLink) = Subsystem::ComputeDiagramURLs($self, $ssName, $diagramID, $sprout);
4357    
4358  This is an internal static method that computes the URLs for a subsystem diagram.  This is an internal static method that computes the URLs for a subsystem diagram.
4359  It insures that both SEED and Sprout use the same rules for generating the  It insures that both SEED and Sprout use the same rules for generating the

Legend:
Removed from v.1.118  
changed lines
  Added in v.1.119

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3