[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.107, Tue May 22 18:16:37 2007 UTC revision 1.108, Mon Jun 11 17:37:59 2007 UTC
# Line 18  Line 18 
18  package Subsystem;  package Subsystem;
19    
20  use Carp;  use Carp;
 use FIG;  
   
 use FIGAttributes;  
 use base 'FIGAttributes';  
21    
22  use POSIX;  use POSIX;
23  use DirHandle;  use DirHandle;
# Line 415  Line 411 
411      my($self, $id) = @_;      my($self, $id) = @_;
412    
413      my $name = GetDiagramName($self->{dir}, $id);      my $name = GetDiagramName($self->{dir}, $id);
414      my ($link, $img_link) = ComputeDiagramURLs($self->{name}, $id);      my ($link, $img_link) = ComputeDiagramURLs($self, $self->{name}, $id);
415    
416      return($name, $link, $img_link);      return($name, $link, $img_link);
417  }  }
# Line 528  Line 524 
524    
525      my $dir = "$self->{dir}/diagrams";      my $dir = "$self->{dir}/diagrams";
526    
527      &FIG::verify_dir($dir);      Tracer::Insure($dir);
528    
529      my $path;      my $path;
530    
# Line 558  Line 554 
554          }          }
555      }      }
556    
557      &FIG::verify_dir($path);      Tracer::Insure($path);
558    
559      if ($name)      if ($name)
560      {      {
# Line 928  Line 924 
924  {  {
925      my($self) = @_;      my($self) = @_;
926    
927      $self->{notes} = &FIG::file_read(File::Spec->catfile($self->{dir}, "notes"));      $self->{notes} = Tracer::GetFile(File::Spec->catfile($self->{dir}, "notes"));
928  }  }
929    
930  sub load_hope_kegg_info  sub load_hope_kegg_info
# Line 981  Line 977 
977  {  {
978      my($self) = @_;      my($self) = @_;
979    
980      $self->{hope_curation_notes} = &FIG::file_read(File::Spec->catfile($self->{dir}, "hope_curation_notes"));      $self->{hope_curation_notes} = Tracer::GetFile(File::Spec->catfile($self->{dir}, "hope_curation_notes"));
981  }  }
982    
983  sub load_reactions  sub load_reactions
# Line 1077  Line 1073 
1073  {  {
1074      my($self) = @_;      my($self) = @_;
1075    
1076      my $class = &FIG::file_read(File::Spec->catfile($self->{dir}, "CLASSIFICATION"));      my $class = Tracer::GetFile(File::Spec->catfile($self->{dir}, "CLASSIFICATION"));
1077      if ($class) {$self->{classification} = [split /\t/, $class]} else {$self->{classification} = ['', '', '']}      if ($class) {$self->{classification} = [split /\t/, $class]} else {$self->{classification} = ['', '', '']}
1078  }  }
1079    
# Line 2061  Line 2057 
2057  }  }
2058    
2059    
2060  sub get_row :Scalar  sub get_row
2061  {  {
2062      my($self, $row) = @_;      my($self, $row) = @_;
2063    
2064      return $self->{spreadsheet}->[$row];      return $self->{spreadsheet}->[$row];
2065  }  }
2066    
2067  sub get_col :Scalar  sub get_col
2068  {  {
2069      my($self, $col) = @_;      my($self, $col) = @_;
2070    
2071      return $self->{spreadsheet_inv}->[$col];      return $self->{spreadsheet_inv}->[$col];
2072  }  }
2073    
2074  sub get_cell :Scalar  sub get_cell
2075  {  {
2076      my($self, $row, $col) = @_;      my($self, $row, $col) = @_;
2077    
# Line 2108  Line 2104 
2104    
2105  =cut  =cut
2106    
2107  sub get_genome_index :Scalar  sub get_genome_index
2108  {  {
2109      my($self, $genome) = @_;      my($self, $genome) = @_;
2110    
2111      return $self->{genome_index}->{$genome};      return $self->{genome_index}->{$genome};
2112  }  }
2113    
2114  sub get_genome :Scalar  sub get_genome
2115  {  {
2116      my($self, $gidx) = @_;      my($self, $gidx) = @_;
2117    
# Line 2142  Line 2138 
2138    
2139  =cut  =cut
2140    
2141  sub get_role_index :Scalar  sub get_role_index
2142  {  {
2143      my($self, $role) = @_;      my($self, $role) = @_;
2144    
2145      return $self->{role_index}->{$role};      return $self->{role_index}->{$role};
2146  }  }
2147    
2148  sub get_role :Scalar  sub get_role
2149  {  {
2150      my($self, $ridx) = @_;      my($self, $ridx) = @_;
2151    
# Line 2178  Line 2174 
2174    
2175  =cut  =cut
2176    
2177  sub get_role_abbr :Scalar  sub get_role_abbr
2178  {  {
2179      my($self, $ridx) = @_;      my($self, $ridx) = @_;
2180    
2181      return $self->{role_abbrs}->[$ridx];      return $self->{role_abbrs}->[$ridx];
2182  }  }
2183    
2184  sub get_role_from_abbr :Scalar  sub get_role_from_abbr
2185  {  {
2186      my($self, $abbr) = @_;      my($self, $abbr) = @_;
2187    
# Line 3115  Line 3111 
3111    
3112  }  }
3113    
3114  sub get_name :Scalar  sub get_name
3115  {  {
3116      my($self) = @_;      my($self) = @_;
3117      my $name = $self->{name};      my $name = $self->{name};
# Line 3123  Line 3119 
3119      return $name;      return $name;
3120  }  }
3121    
3122  sub get_dir :Scalar  sub get_dir
3123  {  {
3124      my($self) = @_;      my($self) = @_;
3125      return $self->{dir};      return $self->{dir};
3126  }  }
3127    
3128    
3129  sub get_version :Scalar  sub get_version
3130  {  {
3131      my($self) = @_;      my($self) = @_;
3132      return $self->{version};      return $self->{version};
# Line 3144  Line 3140 
3140    
3141  =cut  =cut
3142    
3143  sub get_notes :Scalar  sub get_notes
3144  {  {
3145      my($self) = @_;      my($self) = @_;
3146    
# Line 3394  Line 3390 
3390      $self->{hope_reaction_links}->{$role} = $rstring;      $self->{hope_reaction_links}->{$role} = $rstring;
3391  }  }
3392    
3393  sub get_hope_curation_notes :Scalar  sub get_hope_curation_notes
3394  {  {
3395      my($self) = @_;      my($self) = @_;
3396    
# Line 3438  Line 3434 
3434    
3435  =cut  =cut
3436    
3437  sub get_curator :Scalar  sub get_curator
3438  {  {
3439      my($self) = @_;      my($self) = @_;
3440      return $self->{curator};      return $self->{curator};
# Line 4207  Line 4203 
4203    
4204  =head3 ComputeDiagramURLs  =head3 ComputeDiagramURLs
4205    
4206  C<< my ($link, $imgLink) = Subsystem::ComputeDiagramURLs($ssName, $diagramID); >>  C<< my ($link, $imgLink) = Subsystem::ComputeDiagramURLs($self, $ssName, $diagramID, $sprout); >>
4207    
4208  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.
4209  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
# Line 4215  Line 4211 
4211    
4212  =over 4  =over 4
4213    
4214    =item self
4215    
4216    Relevant subsystem object.
4217    
4218  =item ssName  =item ssName
4219    
4220  Name of the relevant subsystem.  Name of the relevant subsystem.
# Line 4238  Line 4238 
4238    
4239  sub ComputeDiagramURLs {  sub ComputeDiagramURLs {
4240      # Get the parameters.      # Get the parameters.
4241      my ($ssName, $diagramID, $sprout) = @_;      my ($self, $ssName, $diagramID, $sprout) = @_;
4242      # Compute the CGI directory base. Originally this was a configuration      # Compute the CGI directory base. Originally this was a configuration
4243      # parameter. Now we use a dot to force a relative URL.      # parameter. Now we use a dot to force a relative URL.
4244      # my $base = $FIG_Config::cgi_base;      # my $base = $FIG_Config::cgi_base;
4245      my $base = './';      my $base = './';
4246      # Create the links.      # Create the links.
4247      my $link = $base . "subsys_diagram.cgi?ssa=$ssName&diagram=$diagramID";      my $link;
4248        if ($self->is_new_diagram($diagramID)) {
4249            Trace("New diagram found for $diagramID in $ssName.") if T(3);
4250            $link = $base . "diagram.cgi?subsystem_name=$ssName&diagram=$diagramID";
4251        } else {
4252            Trace("Old diagram found for $diagramID in $ssName.") if T(3);
4253            $link = $base . "subsys_diagram.cgi?ssa=$ssName&diagram=$diagramID";
4254        }
4255      if ($sprout) {      if ($sprout) {
4256          $link .= "&SPROUT=1";          $link .= "&SPROUT=1";
4257      }      }

Legend:
Removed from v.1.107  
changed lines
  Added in v.1.108

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3