[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.3, Fri Dec 18 17:41:47 2009 UTC revision 1.4, Mon Dec 21 20:05:25 2009 UTC
# Line 1253  Line 1253 
1253          return undef;          return undef;
1254  }  }
1255    
1256    =head3 datagapgen
1257    Definition:
1258            $model->datagapgen($NumberOfProcessors,$ProcessorIndex,$Filename);
1259    =cut
1260    
1261    sub datagapgen {
1262            my ($self,$Media,$KOList,$NoKOList,$suffix) = @_;
1263            #Setting default values for inputs
1264            if (!defined($NoKOList)) {
1265                    $NoKOList = "none";
1266            }
1267            if (!defined($KOList)) {
1268                    $KOList = "none";
1269            }
1270            #Getting unique filename
1271            my $Filename = $self->figmodel()->filename();
1272            if (!defined($suffix)) {
1273                    $suffix = "-".$Media."-".$KOList."-S";
1274            }
1275            $KOList =~ s/,/;/g;
1276            $NoKOList =~ s/,/;/g;
1277            #Running the gap generation
1278            system($self->figmodel()->GenerateMFAToolkitCommandLineCall($Filename,$self->id().$self->selected_version(),$Media,["GapGeneration"],{"Reactions that should always be active" => $NoKOList,"Reactions to knockout" => $KOList,"Reactions that are always blocked" => "none"},"Gapgeneration-".$self->id().$self->selected_version()."-".$Filename.".log",undef,undef));
1279            my $ProblemReport = $self->figmodel()->LoadProblemReport($Filename);
1280            if (!defined($ProblemReport)) {
1281                    $self->figmodel()->error_message("FIGMODEL:GapGenerationAlgorithm;No problem report;".$Filename.";".$self->id().$self->selected_version().";".$Media.";".$KOList.";".$NoKOList);
1282                    return undef;
1283            }
1284            #Clearing the output folder and log file
1285            $self->figmodel()->clearing_output($Filename,$self->directory()."Gapgeneration-".$self->id().$self->selected_version()."-".$Filename.".log");
1286            #Scheduling the testing of this gap filling solution
1287            my $Tbl = FIGMODELTable->new(["Experiment","Solution index","Solution cost","Solution reactions"],$self->directory().$self->id().$self->selected_version()."-GG".$suffix.".txt",undef,";","|",undef);
1288            for (my $j=0; $j < $ProblemReport->size(); $j++) {
1289                    if ($ProblemReport->get_row($j)->{"Notes"}->[0] =~ m/^Recursive\sMILP\s([^)]+)/) {
1290                            my @SolutionList = split(/\|/,$1);
1291                            for (my $k=0; $k < @SolutionList; $k++) {
1292                                    if ($SolutionList[$k] =~ m/(\d+):(.+)/) {
1293                                            $Tbl->add_row({"Experiment"=>[$Media],"Solution index"=>[$k],"Solution cost"=>[$1],"Solution reactions"=>[$2]});
1294                                    }
1295                            }
1296                    }
1297            }
1298            return $Tbl;
1299    }
1300    
1301  =head3 TestSolutions  =head3 TestSolutions
1302  Definition:  Definition:
1303          $model->TestSolutions($ModelID,$NumProcessors,$ProcessorIndex,$GapFill);          $model->TestSolutions($ModelID,$NumProcessors,$ProcessorIndex,$GapFill);

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3