[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.2, Tue Apr 7 14:13:11 2009 UTC revision 1.5, Wed Jul 15 23:39:58 2009 UTC
# Line 41  Line 41 
41    
42  =item erdb  =item erdb
43    
44  [[SaplingPm]] object for the database being loaded.  L<Sapling> object for the database being loaded.
45    
46  =item options  =item options
47    
# Line 159  Line 159 
159          if (defined($Row) && defined($Row->{"DATABASE"}->[0]) && $Row->{"DATABASE"}->[0] =~ m/cpd\d\d\d\d\d/) {          if (defined($Row) && defined($Row->{"DATABASE"}->[0]) && $Row->{"DATABASE"}->[0] =~ m/cpd\d\d\d\d\d/) {
160              my $Object = FIGMODELObject->load($model->{"compound directory"}->[0].$Row->{"DATABASE"}->[0],"\t");              my $Object = FIGMODELObject->load($model->{"compound directory"}->[0].$Row->{"DATABASE"}->[0],"\t");
161              my @LoadingArray = ($Row->{"DATABASE"}->[0],$Row->{"DATABASE"}->[0],0,"",0,"",0,10000000,10000000,"");              my @LoadingArray = ($Row->{"DATABASE"}->[0],$Row->{"DATABASE"}->[0],0,"",0,"",0,10000000,10000000,"");
162                $self->Track(compoundRow => $LoadingArray[0], 1000);
163              if (defined($Row->{"NAME"}->[0])) {              if (defined($Row->{"NAME"}->[0])) {
164                  $LoadingArray[1] = $Row->{"NAME"}->[0];                  $LoadingArray[1] = $Row->{"NAME"}->[0];
165              }              }
# Line 238  Line 239 
239          if (defined($Row) && defined($Row->{"DATABASE"}->[0]) && $Row->{"DATABASE"}->[0] =~ m/rxn\d\d\d\d\d/) {          if (defined($Row) && defined($Row->{"DATABASE"}->[0]) && $Row->{"DATABASE"}->[0] =~ m/rxn\d\d\d\d\d/) {
240              my $Object = FIGMODELObject->load($model->{"reaction directory"}->[0].$Row->{"DATABASE"}->[0],"\t");              my $Object = FIGMODELObject->load($model->{"reaction directory"}->[0].$Row->{"DATABASE"}->[0],"\t");
241              my @LoadingArray = ($Row->{"DATABASE"}->[0],"","","","","",10000000,10000000,10000000,"R");              my @LoadingArray = ($Row->{"DATABASE"}->[0],"","","","","",10000000,10000000,10000000,"R");
242                $self->Track(reactionRow => $LoadingArray[0], 1000);
243              if (defined($Object->{"DEFINITION"}->[0])) {              if (defined($Object->{"DEFINITION"}->[0])) {
244                  $LoadingArray[1] = $Object->{"DEFINITION"}->[0];                  $LoadingArray[1] = $Object->{"DEFINITION"}->[0];
245              }              }
# Line 276  Line 278 
278              $self->PutE(Reaction => $LoadingArray[0], definition => $LoadingArray[1], code => $LoadingArray[2], operator => $LoadingArray[3], pathway => $LoadingArray[4],keggMap => $LoadingArray[5], deltaG => $LoadingArray[6], MMdeltaG => $LoadingArray[7], deltaGerr => $LoadingArray[8], predictedReversibility => $LoadingArray[9]);              $self->PutE(Reaction => $LoadingArray[0], definition => $LoadingArray[1], code => $LoadingArray[2], operator => $LoadingArray[3], pathway => $LoadingArray[4],keggMap => $LoadingArray[5], deltaG => $LoadingArray[6], MMdeltaG => $LoadingArray[7], deltaGerr => $LoadingArray[8], predictedReversibility => $LoadingArray[9]);
279              #Adding relationship between compounds and reactions              #Adding relationship between compounds and reactions
280              my ($Reactants,$Products) = $model->GetReactionSubstrateData($LoadingArray[0]);              my ($Reactants,$Products) = $model->GetReactionSubstrateData($LoadingArray[0]);
281                if (! defined $Reactants) {
282                    $self->Add(missingReactants => 1);
283                } else {
284              for (my $j=0; $j < @{$Reactants}; $j++) {              for (my $j=0; $j < @{$Reactants}; $j++) {
285                  $self->PutR(Involves => $LoadingArray[0],$Reactants->[$j]->{"DATABASE"}->[0],product => 0,stoichiometry => $Reactants->[$j]->{"COEFFICIENT"}->[0],main => 1,compartment => $Reactants->[$j]->{"COMPARTMENT"}->[0],discriminator => $Count);                  $self->PutR(Involves => $LoadingArray[0],$Reactants->[$j]->{"DATABASE"}->[0],product => 0,stoichiometry => $Reactants->[$j]->{"COEFFICIENT"}->[0],main => 1,compartment => $Reactants->[$j]->{"COMPARTMENT"}->[0],discriminator => $Count);
286                  #TODO:Properly identify main reactants in reactions                  #TODO:Properly identify main reactants in reactions
287                  $Count++;                  $Count++;
288              }              }
289                }
290                if (! defined $Products) {
291                    $self->Add(missingProducts => 1);
292                } else {
293              for (my $j=0; $j < @{$Products}; $j++) {              for (my $j=0; $j < @{$Products}; $j++) {
294                  $self->PutR(Involves => $LoadingArray[0],$Products->[$j]->{"DATABASE"}->[0],product => 1,stoichiometry => $Products->[$j]->{"COEFFICIENT"}->[0],main => 1,compartment => $Products->[$j]->{"COMPARTMENT"}->[0],discriminator => $Count);                  $self->PutR(Involves => $LoadingArray[0],$Products->[$j]->{"DATABASE"}->[0],product => 1,stoichiometry => $Products->[$j]->{"COEFFICIENT"}->[0],main => 1,compartment => $Products->[$j]->{"COMPARTMENT"}->[0],discriminator => $Count);
295                  #TODO:Properly identify main reactants in reactions                  #TODO:Properly identify main reactants in reactions
296                  $Count++;                  $Count++;
297              }              }
298                }
299              #Adding relationship between EC number and reactions              #Adding relationship between EC number and reactions
300              if (defined($Object->{"ENZYME"})) {              if (defined($Object->{"ENZYME"})) {
301                  foreach my $Enzyme (@{$Object->{"ENZYME"}}) {                  foreach my $Enzyme (@{$Object->{"ENZYME"}}) {
302                     $self->PutE(EcNumber => $Enzyme, obselete => 0, replacedby => "NONE");                     $self->PutE(EcNumber => $Enzyme, obsolete => 0, replacedby => "NONE");
303                     $self->PutR(IsCategorizedInto => $LoadingArray[0],$Enzyme,source => "KEGG");                     $self->PutR(IsCategorizedInto => $LoadingArray[0],$Enzyme,source => "KEGG");
304                  }                  }
305              }              }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3