[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.5, Wed Jul 15 23:39:58 2009 UTC revision 1.7, Wed Dec 16 01:45:19 2009 UTC
# Line 59  Line 59 
59      # Get the parameters.      # Get the parameters.
60      my ($class, $erdb, $options) = @_;      my ($class, $erdb, $options) = @_;
61      # Create the table list.      # Create the table list.
62      my @tables = sort qw(StructuralCue IsFoundIn Compound HasAliasOf AliasType HasReactionAliasOf Reaction Involves IsTriggeredBy RoleSet IsCombinationOf IsCategorizedInto EcNumber IsConsistentWith IsStimulatedBy  FeatureSet IsSetOf IsRequiredBy Model Encompasses IsModeledBy);      my @tables = sort qw(StructuralCue IsFoundIn Compound HasAliasOf AliasType HasReactionAliasOf Reaction Involves IsTriggeredBy RoleSet IsCombinationOf IsCategorizedInto EcNumber IsConsistentWith IsStimulatedBy  FeatureSet IsSetOf IsRequiredBy Model IsModeledBy); # Encompasses);
63      # Create the BaseSaplingLoader object.      # Create the BaseSaplingLoader object.
64      my $retVal = BaseSaplingLoader::new($class, $erdb, $options, @tables);      my $retVal = BaseSaplingLoader::new($class, $erdb, $options, @tables);
65      # Return it.      # Return it.
# Line 299  Line 299 
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                       if ($Enzyme =~ /,/) {
303                        #TODO:Invalid enzyme
304                       } else {
305                        $Enzyme =~ s/\s//g;
306                     $self->PutE(EcNumber => $Enzyme, obsolete => 0, replacedby => "NONE");                     $self->PutE(EcNumber => $Enzyme, obsolete => 0, replacedby => "NONE");
307                     $self->PutR(IsCategorizedInto => $LoadingArray[0],$Enzyme,source => "KEGG");                     $self->PutR(IsCategorizedInto => $LoadingArray[0],$Enzyme,source => "KEGG");
308                  }                  }
309              }              }
310                }
311              #Adding the relationship between reaction and alias type              #Adding the relationship between reaction and alias type
312              if (defined($Object->{"NAME"})) {              if (defined($Object->{"NAME"})) {
313                  foreach my $Name (@{$Object->{"NAME"}}) {                  foreach my $Name (@{$Object->{"NAME"}}) {
# Line 495  Line 500 
500                  if ($LoadingArray[25] == 0) {                  if ($LoadingArray[25] == 0) {
501                      #Loading the model from file                      #Loading the model from file
502                      my $ModelTable = $model->GetDBModel($LoadingArray[0]);                      my $ModelTable = $model->GetDBModel($LoadingArray[0]);
503                        if (! defined $ModelTable) {
504                            $self->Add(missingModelTable => 1);
505                        } else {
506                      for (my $j=0; $j < $ModelTable->size(); $j++) {                      for (my $j=0; $j < $ModelTable->size(); $j++) {
507                          my $RxnRow = $ModelTable->get_row($j);                          my $RxnRow = $ModelTable->get_row($j);
508                          if (defined($RxnRow) && defined($RxnRow->{"LOAD"}->[0])) {                          if (defined($RxnRow) && defined($RxnRow->{"LOAD"}->[0])) {
# Line 533  Line 541 
541                                          #Adding the relationship between the reaction and roleset                                          #Adding the relationship between the reaction and roleset
542                                          $self->PutR(IsStimulatedBy => $RxnRow->{"LOAD"}->[0],$DigestedKey);                                          $self->PutR(IsStimulatedBy => $RxnRow->{"LOAD"}->[0],$DigestedKey);
543                                          #Adding the relationship between the model and featureset                                          #Adding the relationship between the model and featureset
544                                          $self->PutR(Encompasses => $LoadingArray[0],$DigestedKey);                                              #$self->PutR(Encompasses => $LoadingArray[0],$DigestedKey);
545                                          #Adding the relationship between FeatureSet and feature                                          #Adding the relationship between FeatureSet and feature
546                                          my @PegArray = split(/\+/,$FeatureSet);                                          my @PegArray = split(/\+/,$FeatureSet);
547                                          foreach my $Feature (@PegArray) {                                          foreach my $Feature (@PegArray) {
# Line 548  Line 556 
556                              $self->PutR(IsRequiredBy => $RxnRow->{"LOAD"}->[0],$LoadingArray[0], direction => $SubLoadingArray[0], compartment => $SubLoadingArray[1], confidence => $SubLoadingArray[3], class => $SubLoadingArray[4], notes => $SubLoadingArray[5], dependency => $SubLoadingArray[6]);                              $self->PutR(IsRequiredBy => $RxnRow->{"LOAD"}->[0],$LoadingArray[0], direction => $SubLoadingArray[0], compartment => $SubLoadingArray[1], confidence => $SubLoadingArray[3], class => $SubLoadingArray[4], notes => $SubLoadingArray[5], dependency => $SubLoadingArray[6]);
557                          }                          }
558                      }                      }
559                        }
560                      #Clearing the model data from memmory                      #Clearing the model data from memmory
561                      undef $ModelTable;                      undef $ModelTable;
562                      $model->ClearDBModel($LoadingArray[0],"DELETE");                      $model->ClearDBModel($LoadingArray[0],"DELETE");

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3