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

Diff of /Sprout/ModelSaplingLoader.pm

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

revision 1.15, Mon Feb 28 20:27:17 2011 UTC revision 1.19, Sat Oct 1 10:35:02 2011 UTC
# Line 61  Line 61 
61      # Create the table list.      # Create the table list.
62      my @tables = qw(Compound Reaction EcNumber Model Media IsTriggeredBy      my @tables = qw(Compound Reaction EcNumber Model Media IsTriggeredBy
63                      IsCategorizedInto IsConsistentWith IsModeledBy Involves                      IsCategorizedInto IsConsistentWith IsModeledBy Involves
64                      IsRequiredBy);                      IsRequiredBy Complex IsSetOf IsExemplarOf);
65      # Create the BaseSaplingLoader object.      # Create the BaseSaplingLoader object.
66      my $retVal = BaseSaplingLoader::new($class, $erdb, $options, @tables);      my $retVal = BaseSaplingLoader::new($class, $erdb, $options, @tables);
67      # Create the reaction tracking hash.      # Create the reaction tracking hash.
# Line 106  Line 106 
106    
107  # hash of ubiquitous compounds.  # hash of ubiquitous compounds.
108  use constant UBIQUITOUS => {  use constant UBIQUITOUS => {
109        cpd00001 => 'OH-',
110      cpd00002 => 'ATP',      cpd00002 => 'ATP',
111      cpd00008 => 'ADP',      cpd00003 => 'Nicotinamideadeninedinucleotide',
112        cpd00004 => 'Nicotinamideadeninedinucleotide-reduced',
113        cpd00005 => 'Nicotinamideadeninedinucleotidephosphate-reduced',
114        cpd00006 => 'Nicotinamideadeninedinucleotidephosphate',
115      cpd00007 => 'Oxygen',      cpd00007 => 'Oxygen',
116        cpd00008 => 'ADP',
117        cpd00009 => 'Orthophosphoric acid',
118      cpd00010 => 'CoenzymeA',      cpd00010 => 'CoenzymeA',
119        cpd00011 => 'Carbon dioxide',
120      cpd00012 => 'PPi',      cpd00012 => 'PPi',
     cpd15560 => 'Ubiquinone-8',  
     cpd15561 => 'Ubiquinol-8',  
     cpd15500 => 'Menaquinone',  
     cpd15499 => 'Menaquinol',  
     cpd00022 => 'Acetyl-CoA',  
121      cpd00018 => 'AMP',      cpd00018 => 'AMP',
122        cpd00020 => 'Pyruvic Acid',
123        cpd00022 => 'Acetyl-CoA',
124        cpd00025 => 'Hydrogen peroxide',
125        cpd00067 => 'H+',
126      cpd00971 => 'Sodium',      cpd00971 => 'Sodium',
127      cpd15352 => '2-Demethylmenaquinone',      cpd15352 => '2-Demethylmenaquinone',
128      cpd15353 => '2-Demethylmenaquinol'      cpd15353 => '2-Demethylmenaquinol',
129        cpd15499 => 'Menaquinol',
130        cpd15500 => 'Menaquinone',
131        cpd15560 => 'Ubiquinone-8',
132        cpd15561 => 'Ubiquinol-8',
133  };  };
134    
135  sub LoadModelFiles {  sub LoadModelFiles {
136      # Get the parameters.      # Get the parameters.
137      my ($self) = @_;      my ($self) = @_;
138        # Get the sapling database.
139        my $erdb = $self->db();
140      # Get the model dump file directory.      # Get the model dump file directory.
141      my $dir = $self->db()->LoadDirectory() . "/models";      my $dir = $erdb->LoadDirectory() . "/models";
142      # First we read the compounds.      # First we read the compounds.
143      my $ih = $self->CheckFile("$dir/CompoundName.txt", qw(CompoundID Name));      my $ih = $self->CheckFile("$dir/CompoundName.txt", qw(CompoundID Name));
144      while (! eof $ih) {      while (! eof $ih) {
# Line 168  Line 179 
179          $self->PutR(IsTriggeredBy => $reaction, $role);          $self->PutR(IsTriggeredBy => $reaction, $role);
180      }      }
181      # Now we create the models.      # Now we create the models.
182      $ih = $self->CheckFile("$dir/ModelGenome.txt", qw(ModelID GenomeID));      $ih = $self->CheckFile("$dir/ModelGenome.txt", qw(ModelID Name GenomeID));
183      while (! eof $ih) {      while (! eof $ih) {
184          # Get the next model.          # Get the next model.
185          my ($model, $genome) = $self->ReadLine($ih);          my ($model, $name, $genome) = $self->ReadLine($ih);
186          # Create the model.          # Create the model.
187          $self->PutE(Model => $model);          $self->PutE(Model => $model);
188          # Connect it to the genome. Again, the genomes are created elsewhere.          # Connect it to the genome. Again, the genomes are created elsewhere.
# Line 190  Line 201 
201              $self->PutR(IsRequiredBy => $reaction, $model);              $self->PutR(IsRequiredBy => $reaction, $model);
202          }          }
203      }      }
204        # Finally, the exemplars are stored in the coupling directory.
205        my $couplingDir = $erdb->LoadDirectory() . '/FamilyData';
206        $self->LoadFromFile(IsExemplarOf => "$couplingDir/IsExemplarOf.dtx",
207                            qw(from_link to_link));
208  }  }
209    
210  =head3 StartFile  =head3 CheckFile
211    
212      my $ih = $sl->CheckFile($fileName, @fieldNames);      my $ih = $sl->CheckFile($fileName, @fieldNames);
213    

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.19

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3