[Bio] / Sprout / ScenarioSaplingLoader.pm Repository:
ViewVC logotype

Diff of /Sprout/ScenarioSaplingLoader.pm

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

revision 1.7, Mon Feb 1 20:14:28 2010 UTC revision 1.8, Wed Apr 28 14:04:49 2010 UTC
# Line 66  Line 66 
66                           HasParticipant Shows Displays Diagram DiagramContent Overlaps);                           HasParticipant Shows Displays Diagram DiagramContent Overlaps);
67      # Create the BaseSaplingLoader object.      # Create the BaseSaplingLoader object.
68      my $retVal = BaseSaplingLoader::new($class, $erdb, $options, @tables);      my $retVal = BaseSaplingLoader::new($class, $erdb, $options, @tables);
     # Create and attach a FIGMODEL object.  
     $retVal->{figModel} = FIGMODEL->new();  
69      # Return it.      # Return it.
70      return $retVal;      return $retVal;
71  }  }
# Line 121  Line 119 
119      my $erdb = $self->db();      my $erdb = $self->db();
120      # Get the FIGMODEL object. This is used to map KEGG reaction IDs (used in      # Get the FIGMODEL object. This is used to map KEGG reaction IDs (used in
121      # scenarios) to our reaction IDs.      # scenarios) to our reaction IDs.
122      my $figmodel = $self->{figModel};      my $figmodel = $self->GetFigModel();
123      # We run through the subsystems and roles, generating the scenarios.      # We run through the subsystems and roles, generating the scenarios.
124      # We'll need a role hash to prevent duplicates.      # We'll need a role hash to prevent duplicates.
125      my %roles = ();      my %roles = ();
# Line 307  Line 305 
305      my ($self, $mapID, $fileName, $relName, $method) = @_;      my ($self, $mapID, $fileName, $relName, $method) = @_;
306      # Get the FIGMODEL object. This is used to map KEGG reaction and compound IDs      # Get the FIGMODEL object. This is used to map KEGG reaction and compound IDs
307      # (used in disagrams) to our IDs.      # (used in disagrams) to our IDs.
308      my $figmodel = $self->{figModel};      my $figmodel = $self->GetFigModel();
309      # Check the file.      # Check the file.
310      if (! -s $fileName) {      if (! -s $fileName) {
311          Trace("File \"$fileName\" not found for map $mapID.") if T(ERDBLoadGroup => 1);          Trace("File \"$fileName\" not found for map $mapID.") if T(ERDBLoadGroup => 1);
# Line 328  Line 326 
326  }  }
327    
328    
329    =head3 GetFigModel
330    
331        my $figModel = $self->GetFigModel();
332    
333    Return a FIGMODEL object that can be used to map KEGG IDs to our IDs for reactions
334    and compounds. If we don't have a FIGMODEL object yet, one will be created and
335    cached in this object.
336    
337    =cut
338    
339    sub GetFigModel {
340        # Get the parameters.
341        my ($self) = @_;
342        # Look for a cached object.
343        my $retVal = $self->{figModel};
344        if (! defined $retVal) {
345            # It doesn't exist, so create one.
346            $retVal = FIGMODEL->new();
347            $self->{figModel} = $retVal;
348        }
349        # Return the cached object.
350        return $retVal;
351    }
352    
353  1;  1;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3