[Bio] / FigKernelPackages / FIGMODELmodel.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIGMODELmodel.pm

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

revision 1.14, Thu May 13 05:04:26 2010 UTC revision 1.15, Wed May 19 21:02:11 2010 UTC
# Line 409  Line 409 
409          return $self->{"_".$name};          return $self->{"_".$name};
410  }  }
411    
412    =head3 create_table_prototype
413    
414    Definition:
415            FIGMODELTable::table = FIGMODELmodel->create_table_prototype(string::table);
416    Description:
417            Returns a empty FIGMODELTable with all the metadata associated with the input table name
418    
419    =cut
420    sub create_table_prototype {
421            my ($self,$TableName) = @_;
422    
423            #Checking if the table definition exists in the FIGMODELconfig file
424            if (!defined($self->figmodel()->config($TableName))) {
425                    $self->figmodel()->error_message("FIGMODELdatabase:create_table_prototype:Definition not found for ".$TableName);
426                    return undef;
427            }
428            #Checking that this is a database table
429            if (!defined($self->config($TableName)->{tabletype}) || $self->config($TableName)->{tabletype}->[0] ne "ModelTable") {
430                    $self->figmodel()->error_message("FIGMODELdatabase:create_table_prototype:".$TableName." is not a model table!");
431                    return undef;
432            }
433            if (!defined($self->config($TableName)->{delimiter})) {
434                    $self->config($TableName)->{delimiter}->[0] = ";";
435            }
436            if (!defined($self->config($TableName)->{itemdelimiter})) {
437                    $self->config($TableName)->{itemdelimiter}->[0] = "|";
438            }
439            my $prefix;
440            if (defined($self->config($TableName)->{prefix})) {
441                    $prefix = join("\n",@{$self->config($TableName)->{prefix}});
442            }
443            my $tbl = FIGMODELTable->new($self->config($TableName)->{columns},$self->directory().$self->config($TableName)->{filename_prefix}->[0]."-".$self->id().$self->selected_version().".txt",$self->config($TableName)->{hashcolumns},$self->config($TableName)->{delimiter}->[0],$self->config($TableName)->{itemdelimiter}->[0],$prefix);
444            return $tbl;
445    }
446    
447  =head3 get_reaction_number  =head3 get_reaction_number
448  Definition:  Definition:
449          int = FIGMODELmodel->get_reaction_number();          int = FIGMODELmodel->get_reaction_number();
# Line 3971  Line 4006 
4006          close(SBMLOUTPUT);          close(SBMLOUTPUT);
4007  }  }
4008    
4009    =head3 PrintModelSimpleReactionTable
4010    Definition:
4011            success()/fail() FIGMODELmodel->PrintModelSimpleReactionTable();
4012    Description:
4013            Prints the table of model data
4014    =cut
4015    sub PrintModelSimpleReactionTable {
4016            my ($self) = @_;
4017    
4018            my $rxntbl = $self->reaction_table();
4019            my $tbl = $self->create_table_prototype("ModelSimpleReactionTable");
4020            for (my $i=0; $i < $rxntbl->size(); $i++) {
4021                    my $row = $rxntbl->get_row($i);
4022                    $row->{DATABASE} = $row->{LOAD};
4023                    $tbl->add_row($row);
4024            }
4025            $tbl->save();
4026            system("cp ".$tbl->filename()." ".$self->figmodel()->config("Model table download directory")->[0].$self->figmodel()->config("ModelSimpleReactionTable")->{filename_prefix}->[0]."-".$self->id().".txt");
4027    }
4028    
4029  =head3 PrintModelLPFile  =head3 PrintModelLPFile
4030  Definition:  Definition:
4031          success()/fail() FIGMODELmodel->PrintModelLPFile();          success()/fail() FIGMODELmodel->PrintModelLPFile();
# Line 4167  Line 4222 
4222          my ($self,$feature) = @_;          my ($self,$feature) = @_;
4223    
4224          #First checking if the feature is in the model          #First checking if the feature is in the model
4225            my $featureGenome = $feature->{GENOME}->[0];
4226            if ($feature->{GENOME}->[0] =~ m/\>(\d+\.\d+)\</) {
4227                    $featureGenome = $1;
4228            }
4229            if ($featureGenome ne $self->genome()) {
4230                    return "Not in model";
4231            }
4232          my $data = $self->get_feature_data($feature->{ID}->[0]);          my $data = $self->get_feature_data($feature->{ID}->[0]);
4233          if (!defined($data)) {          if (!defined($data)) {
4234                  return "Not in model";                  return "Not in model";

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3