[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.1, Wed Mar 4 00:08:30 2009 UTC revision 1.3, Thu May 28 18:08:56 2009 UTC
# 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"}}) {
# Line 388  Line 398 
398  sub LoadModels {  sub LoadModels {
399      my ($self,$model) = @_;      my ($self,$model) = @_;
400      my $sapling = $self->db();      my $sapling = $self->db();
401        ## TRS: Get hash of valid genome IDs.
402        my $genomeHash = $sapling->GenomeHash();
403      my $ModelList = $model->GetDBTable("MODEL LIST");      my $ModelList = $model->GetDBTable("MODEL LIST");
404      my $ModelStats = $model->GetDBTable("MODEL STATS");      my $ModelStats = $model->GetDBTable("MODEL STATS");
405      for (my $i=0; $i < $ModelStats->size(); $i++) {      for (my $i=0; $i < $ModelStats->size(); $i++) {
406          my $Row = $ModelStats->get_row($i);          my $Row = $ModelStats->get_row($i);
407          if (defined($Row) && defined($Row->{"Model ID"}->[0])) {          if (defined($Row) && defined($Row->{"Model ID"}->[0])) {
408              my @LoadingArray = ($Row->{"Model ID"}->[0],"","",0,0,0,"",0,0,0,0,0,0,0,0,0,0,0,0,"","",0,0,"",0,0);              my @LoadingArray = ($Row->{"Model ID"}->[0],"","",0,0,0,"",0,0,0,0,0,0,0,0,0,0,0,0,"","",0,0,"",0,0);
409                if (defined($Row->{"Genome ID"}->[0]) && $genomeHash->{$Row->{"Genome ID"}->[0]}) {
410              if (defined($Row->{"Organism name"}->[0])) {              if (defined($Row->{"Organism name"}->[0])) {
411                  $LoadingArray[1] = $Row->{"Organism name"}->[0];                  $LoadingArray[1] = $Row->{"Organism name"}->[0];
412              }              }
# Line 542  Line 555 
555          }          }
556      }      }
557  }  }
558    }
559    
560  1;  1;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3