0001
0002
0003 function tests = tinitTests
0004 tests = functiontests(localfunctions);
0005 end
0006
0007 function testparsexpTask1List(testCase)
0008 sourceDir = fileparts(which(mfilename));
0009 taskStruct = parseTaskList(strcat(sourceDir, '/test_data/test_tasks.txt'));
0010 taskStructExcel = parseTaskList(strcat(sourceDir, '/test_data/test_tasks.xls'));
0011
0012
0013 expTask1.id='ER';
0014 expTask1.description='Aerobic rephosphorylation of ATP from glucose';
0015 expTask1.shouldFail=true;
0016 expTask1.printFluxes=true;
0017 expTask1.comments='Messed up reaction';
0018 expTask1.inputs={'O2[s]';'glucose[s]'};
0019 expTask1.LBin=[23.6;23.6];
0020 expTask1.UBin=[23.8;23.8];
0021 expTask1.outputs={'H2O[s]';'CO2[s]'};
0022 expTask1.LBout=[26.1;26.1];
0023 expTask1.UBout=[26.2;26.2];
0024 expTask1.equations={'ATP[c] + H2O[c] => ADP[c] + Pi[c] + H+[c]'};
0025 expTask1.LBequ=30.2;
0026 expTask1.UBequ=30.6;
0027 expTask1.changed={'ATP[a] + H2O[a] => ADP[a] + Pi[a] + H+[a]'};
0028 expTask1.LBrxn=56.2;
0029
0030 verifyNotEqual(testCase,taskStruct(1),expTask1)
0031 expTask1.UBrxn=60;
0032
0033
0034 verifyEqual(testCase,taskStruct(1),expTask1)
0035 verifyEqual(testCase,taskStructExcel(1),expTask1)
0036
0037
0038 verifyEqual(testCase,length(taskStruct),2)
0039 verifyEqual(testCase,length(taskStructExcel),2)
0040
0041 expTask2.id='BS';
0042 expTask2.description='ATP de novo synthesis';
0043 expTask2.shouldFail=false;
0044 expTask2.printFluxes=false;
0045 expTask2.comments='';
0046 expTask2.inputs={'O2[s]';'glucose[s]';'NH3[s]';'Pi[s]'};
0047 expTask2.LBin=[0;0;0;0];
0048 expTask2.UBin=[1000;1000;1000;1000];
0049 expTask2.outputs={'H2O[s]';'CO2[s]';'ATP[c]'};
0050 expTask2.LBout=[0;0;1];
0051 expTask2.UBout=[1.1;1.1;1.3];
0052 expTask2.equations={'ATP[c] + H2O[c] <=> ADP[c] + Pi[c] + H+[c]'};
0053 expTask2.LBequ=-1000;
0054 expTask2.UBequ=1000;
0055 expTask2.changed={};
0056 expTask2.LBrxn=[];
0057 expTask2.UBrxn=[];
0058
0059 verifyEqual(testCase,taskStruct(2),expTask2)
0060 verifyEqual(testCase,taskStructExcel(2),expTask2)
0061
0062
0063 verifyEqual(testCase,taskStruct,taskStructExcel)
0064 end
0065
0066
0067
0068
0069
0070
0071 function testModel = getTstModel()
0072 testModel = struct();
0073 testModel.id = 'testModel';
0074 testModel.rxns = {};
0075 testModel.S=[];
0076 testModel.rev=[];
0077 testModel.mets = {'as';'ac';'bc';'cc';'dc';'ec';'es';'fc'};
0078 testModel.metNames = {'a';'a';'b';'c';'d';'e';'e';'f'};
0079 testModel.comps = {'s';'c'};
0080 testModel.compNames = testModel.comps;
0081 testModel.metComps = [1;2;2;2;2;2;1;2];
0082 testModel.genes = {'G1';'G2';'G3';'G4';'G5';'G6';'G7';'G8';'G9';'G10'};
0083 testModel.grRules = {};
0084 testModel.rxnGeneMat = [];
0085
0086 rxnsToAdd = struct();
0087 rxnsToAdd.rxns = {'R1';'R2';'R3';'R4';'R5';'R6';'R7';'R8';'R9';'R10'};
0088 rxnsToAdd.equations = {'=> a[s]';...
0089 'a[s] <=> a[c]';...
0090 'a[c] <=> b[c] + c[c]';...
0091 'a[c] <=> 2 d[c]';...
0092 'b[c] + c[c] => e[c]';...
0093 '2 d[c] => e[c]';...
0094 'e[c] => e[s]';...
0095 'e[s] =>';...
0096 'a[c] <=> f[c]';...
0097 'f[c] <=> e[c]'};
0098 rxnsToAdd.grRules = {'';'';'G3';'G4';'G5';'G6';'G7';'';'G9';'G10'};
0099 testModel = addRxns(testModel,rxnsToAdd, 3);
0100 testModel.c = [0;0;0;0;0;0;0;1;0;0];
0101 testModel.ub = repmat(1000,10,1);
0102 testModel.lb = [0;-1000;-1000;-1000;0;0;0;0;-1000;-1000];
0103 testModel.rxnNames = testModel.rxns;
0104 testModel.b = repmat(0,8,1);
0105 end
0106
0107 function testModelRxnScores = getTstModelRxnScores()
0108 testModelRxnScores = [-2;-2;-1;7;0.5;0.5;-1;-2;-3;3.5];
0109 end
0110
0111 function testModelTasks = getTstModelTasks()
0112 testModelTasks = struct();
0113 testModelTasks.id = 'Gen e[s] from a[s]';
0114 testModelTasks.description = 'Gen e[s] from a[s]';
0115 testModelTasks.shouldFail = false;
0116 testModelTasks.printFluxes = false;
0117 testModelTasks.comments = '';
0118 testModelTasks.inputs = {'a[s]'};
0119 testModelTasks.LBin = 0;
0120 testModelTasks.UBin = inf;
0121 testModelTasks.outputs = {'e[s]'};
0122 testModelTasks.LBout = 1;
0123 testModelTasks.UBout = 1;
0124 testModelTasks.equations = {};
0125 testModelTasks.LBequ = [];
0126 testModelTasks.UBequ = [];
0127 testModelTasks.changed = {};
0128 testModelTasks.LBrxn = {};
0129 testModelTasks.UBrxn = {};
0130 end
0131
0132
0133
0134
0135
0136 function testModel2 = getTstModel2()
0137 testModel2 = struct();
0138 testModel2.id = 'testModel2';
0139 testModel2.rxns = {};
0140 testModel2.S=[];
0141 testModel2.rev=[];
0142 testModel2.mets = {'a';'b'};
0143 testModel2.metNames = {'a';'b'};
0144 testModel2.comps = {'s'};
0145 testModel2.compNames = testModel2.comps;
0146 testModel2.metComps = [1;1];
0147 testModel2.genes = {'G1';'G2';'G3';'G4'};
0148 testModel2.grRules = {};
0149 testModel2.rxnGeneMat = [];
0150
0151 rxnsToAdd = struct();
0152 rxnsToAdd.rxns = {'R1';'R2';'R3';'R4'};
0153 rxnsToAdd.equations = {'a[s] <=>';...
0154 'a[s] => b[s]';...
0155 'a[s] <=> b[s]';...
0156 'b[s] =>'};
0157 rxnsToAdd.grRules = testModel2.genes;
0158 testModel2 = addRxns(testModel2,rxnsToAdd,3,'',true,true);
0159 testModel2.c = [0;0;0;1];
0160 testModel2.ub = repmat(1000,4,1);
0161 testModel2.lb = [-1000;0;-1000;0];
0162 testModel2.rxnNames = testModel2.rxns;
0163 testModel2.b = zeros(2,1);
0164 end
0165
0166
0167
0168
0169
0170
0171
0172
0173 function testModel4 = getTstModel4()
0174 testModel2 = getTstModel2();
0175 testModel4 = testModel2;
0176
0177 rxnsToAdd = struct();
0178 rxnsToAdd.rxns = {'R5';'R6';'R7';'R8';'R9';'R10';'R11'};
0179 rxnsToAdd.equations = {'5 a[s] <=> 5 d[s]';...
0180 'e[s] <=> d[s]';
0181 'f[s] + g[s] <=> e[s]';
0182 'b[s] <=> f[s]';
0183 'h[s] <=> g[s]';
0184 'h[s] =>';
0185 'e[s] => g[s]'};
0186 rxnsToAdd.grRules = {'G5';'G6';'G7';'G8';'G9';'G10';'G11'};
0187 [~,testModel4] = evalc("addRxns(testModel4,rxnsToAdd, 3, [], true, true);");
0188 end
0189
0190 function testModel4RxnScores = getTstModel4RxnScores()
0191 testModel4RxnScores = [-1;-1;2;-1;0.5;-2;1;1.3;-0.5;-0.4;8];
0192 end
0193
0194
0195
0196
0197
0198 function testModel5 = getTstModel5()
0199 testModel = getTstModel();
0200
0201 rxnsToAdd = struct();
0202 rxnsToAdd.rxns = {'R11';'R12';'R13';'R14'};
0203 rxnsToAdd.equations = {'a[c] <=> g[c]';...
0204 'a[c] <=> g[c]';...
0205 'g[c] <=> e[c]';...
0206 'g[c] <=> e[c]'};
0207 rxnsToAdd.grRules = {'G11';'G12';'G13';'G14'};
0208 [~,testModel5] = evalc("addRxns(testModel,rxnsToAdd, 3, [], true, true);");
0209 end
0210
0211 function testModel5RxnScores = getTstModel5RxnScores()
0212 testModel5RxnScores = [getTstModelRxnScores();-1;-1.5;-1;-1.5];
0213 end
0214
0215
0216
0217
0218
0219 function testftINIT_T0001(testCase)
0220
0221 testParams = struct();
0222
0223
0224
0225 testModel = getTstModel();
0226 [~, prepDataTest1] = evalc('prepINITModel(testModel, {}, {}, false, {}, ''s'');');
0227
0228
0229 verifyTrue(testCase, all(strcmp(prepDataTest1.refModel.rxns(prepDataTest1.toIgnoreExch) , {'R1';'R8'})))
0230
0231
0232 arrayData1.genes = testModel.genes;
0233 arrayData1.tissues = {'a'};
0234 arrayData1.levels = getExprForRxnScore(getTstModelRxnScores());
0235 arrayData1.threshold = 1;
0236
0237 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest1,arrayData1.tissues{1},[],[],arrayData1,[],getINITSteps(),true,true,testParams,false);');
0238
0239
0240
0241
0242 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R4';'R6';'R8';'R9';'R10'})))
0243
0244
0245 [~, prepDataTest1] = evalc('prepINITModel(testModel, {}, {''R7'';''R10''}, false, {}, ''s'');');
0246 verifyTrue(testCase, all(strcmp(prepDataTest1.refModel.rxns(prepDataTest1.toIgnoreExch | prepDataTest1.toIgnoreSpont), {'R1';'R7';'R8';'R10'})))
0247 arrayData1.genes = testModel.genes;
0248 arrayData1.tissues = {'a'};
0249 arrayData1.levels = getExprForRxnScore(getTstModelRxnScores());
0250 arrayData1.threshold = 1;
0251 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest1,arrayData1.tissues{1},[],[],arrayData1,[],getINITSteps(),true,true,testParams,false);');
0252
0253
0254 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R2';'R4';'R6';'R7';'R8'})), 1)
0255 end
0256
0257
0258
0259
0260
0261 function testftINIT_T0002(testCase)
0262 testModel = getTstModel();
0263 testModelTasks = getTstModelTasks();
0264 testRxnScores = getTstModelRxnScores();
0265 testParams = struct();
0266 [~, prepDataTest1] = evalc('prepINITModel(testModel, testModelTasks, {}, false, {}, ''s'');');
0267
0268
0269
0270
0271 verifyTrue(testCase, all(strcmp(prepDataTest1.essentialRxns,{'R1';'R7'})))
0272
0273 arrayData1.genes = testModel.genes;
0274 arrayData1.tissues = {'a'};
0275 arrayData1.levels = getExprForRxnScore(testRxnScores);
0276 arrayData1.threshold = 1;
0277 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest1,arrayData1.tissues{1},[],[],arrayData1,[],getINITSteps(),true,true,testParams,false);');
0278
0279
0280 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R2';'R4';'R6';'R7';'R8';'R9';'R10'})))
0281 end
0282
0283
0284
0285
0286 function testftINIT_T0003(testCase)
0287
0288
0289
0290 testModel = getTstModel();
0291 testModelTasks = getTstModelTasks();
0292 testRxnScores = getTstModelRxnScores();
0293
0294 mTempRef = closeModel(testModel);
0295 mTempRef = removeReactions(mTempRef, {'R1';'R8'});
0296 mTemp = removeReactions(mTempRef, {'R7'});
0297 mTemp.id = 'tmp';
0298 tmpRxnScores = testRxnScores([2;3;4;5;6;7;9;10]);
0299
0300 [~,outModel,addedRxnMat] = evalc('ftINITFillGapsForAllTasks(mTemp,mTempRef,[],false,min(tmpRxnScores,-0.1),testModelTasks);');
0301 verifyTrue(testCase, all(strcmp(mTempRef.rxns(addedRxnMat),'R7')))
0302 end
0303
0304
0305
0306
0307 function testftINIT_T0004(testCase)
0308
0309 testModel = getTstModel();
0310 testRxnScores = getTstModelRxnScores();
0311 [reducedModel,origRxnIds,groupIds,reversedRxns]=mergeLinear(testModel, {});
0312
0313 verifyTrue(testCase, all(groupIds == [1;1;2;3;2;3;4;4;5;5]))
0314
0315 verifyTrue(testCase, all(reducedModel.rev == [0;0;0;0;1]))
0316 verifyTrue(testCase, all(reducedModel.lb == [0;0;0;0;-1000]))
0317
0318 newRxnScores=groupRxnScores(reducedModel, testRxnScores, origRxnIds, groupIds, ismember(origRxnIds, {'R1';'R2';'R8'}));
0319 verifyTrue(testCase, all(newRxnScores == [0;-0.5;7.5;-1;0.5]))
0320
0321
0322 testModel4 = getTstModel4();
0323 [reducedModel,origRxnIds,groupIds,reversedRxns]=mergeLinear(testModel4, {});
0324
0325 verifyTrue(testCase, all(groupIds == [0;0;0;0;1;1;2;2;3;3;0]))
0326
0327 verifyTrue(testCase, all(reducedModel.rev == [1;0;1;0;1;1;0;0]))
0328
0329 verifyTrue(testCase, strcmp(constructEquations(reducedModel, 'R9'),'g[s] => '))
0330 verifyTrue(testCase, all(find(reversedRxns) == [6;9]))
0331
0332
0333 end
0334
0335
0336
0337
0338
0339 function testftINIT_T0006(testCase)
0340
0341
0342 testModel = getTstModel();
0343
0344 tmpModel = reverseRxns(testModel, {'R1';'R3'});
0345 res = constructEquations(tmpModel, {'R1';'R3'});
0346 expRes = {'a[s] => ';'b[c] + c[c] <=> a[c]'};
0347 verifyTrue(testCase, all(strcmp(res,expRes)))
0348 end
0349
0350
0351
0352
0353 function testftINIT_T0007(testCase)
0354 miniModel = struct();
0355 miniModel.S = [1,1000;-1,-40];
0356 miniModel.rxns = {'1';'2'};
0357 miniModel.mets = {'1';'2'};
0358 res = rescaleModelForINIT(miniModel,10);
0359 verifyTrue(testCase, abs(res.S(1,2) - res.S(2,2)*-10) < 10^-6)
0360 verifyTrue(testCase, abs((abs(res.S(1,2)) + abs(res.S(2,2)))/2) - 1 < 10^-6)
0361 end
0362
0363
0364
0365
0366 function testftINIT_T0008(testCase)
0367 testParams = struct();
0368
0369 testModel = getTstModel();
0370 [~, prepDataTest1] = evalc('prepINITModel(testModel, {}, {}, false, {}, ''s'');');
0371
0372 arrayData1.genes = testModel.genes;
0373 arrayData1.tissues = {'a'};
0374 arrayData1.levels = getExprForRxnScore(getTstModelRxnScores());
0375 arrayData1.threshold = 1;
0376
0377 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest1,arrayData1.tissues{1},[],[],arrayData1,[],getINITSteps(),true,true,testParams,false);');
0378
0379
0380
0381
0382
0383 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R4';'R6';'R8';'R9';'R10'})))
0384
0385
0386 [~, prepDataTest1] = evalc('prepINITModel(testModel, {}, {''R7'';''R10''}, false, {}, ''s'');');
0387 verifyTrue(testCase, all(strcmp(prepDataTest1.refModel.rxns(prepDataTest1.toIgnoreExch | prepDataTest1.toIgnoreSpont), {'R1';'R7';'R8';'R10'})))
0388 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest1,arrayData1.tissues{1},[],[],arrayData1,[],getINITSteps(),true,true,testParams,false);');
0389
0390
0391 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R2';'R4';'R6';'R7';'R8'})))
0392
0393 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest1,arrayData1.tissues{1},[],[],arrayData1,{''f''},getINITSteps(),true,true,testParams,false);');
0394
0395 if length(tst1ResModel1.rxns) == 7
0396 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R4';'R6';'R7';'R8';'R9';'R10'})))
0397 else
0398 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R2';'R4';'R6';'R7';'R8';'R9';'R10'})))
0399 end
0400
0401 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest1,arrayData1.tissues{1},[],[],arrayData1,{''f'';''a'';''e''},getINITSteps(),true,true,testParams,false);');
0402
0403 if length(tst1ResModel1.rxns) == 7
0404 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R4';'R6';'R7';'R8';'R9';'R10'})))
0405 else
0406 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R2';'R4';'R6';'R7';'R8';'R9';'R10'})))
0407 end
0408
0409
0410 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest1,arrayData1.tissues{1},[],[],arrayData1,{''b''},getINITSteps(),true,true,testParams,false);');
0411 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R2';'R3';'R4';'R5';'R6';'R7';'R8'})))
0412
0413
0414 testModel5 = getTstModel5();
0415 arrayData1.genes = testModel5.genes;
0416 arrayData1.tissues = {'a'};
0417 arrayData1.levels = getExprForRxnScore(getTstModel5RxnScores());
0418 arrayData1.threshold = 1;
0419
0420 [~, prepDataTest5] = evalc('prepINITModel(testModel5, {}, {''R7'';''R10''}, false, {}, ''s'');');
0421 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest5,arrayData1.tissues{1},[],[],arrayData1,{},getINITSteps(),true,true,testParams,false);');
0422
0423 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R2';'R4';'R6';'R7';'R8'})), 1)
0424
0425
0426
0427 [~, prepDataTest5] = evalc('prepINITModel(testModel5, {}, {''R10''}, false, {}, ''s'');');
0428 arrayData1.levels(7) = getExprForRxnScore(-1.1);
0429 [~,tst1ResModel1] = evalc('ftINIT(prepDataTest5,arrayData1.tissues{1},[],[],arrayData1,{''g''},getINITSteps(),true,true,testParams,false);');
0430
0431 verifyTrue(testCase, all(strcmp(tst1ResModel1.rxns,{'R1';'R4';'R6';'R8';'R11';'R13'})), 1)
0432 end
0433
0434
0435
0436
0437 function testftINIT_T0009(testCase)
0438 testModel = getTstModel();
0439 [~, prepDataTest1] = evalc('prepINITModel(testModel, {}, {}, false, {}, ''s'');');
0440
0441 arrayData1.genes = testModel.genes;
0442 arrayData1.tissues = {'a'};
0443 arrayData1.levels = getExprForRxnScore(getTstModelRxnScores());
0444 arrayData1.threshold = 1;
0445
0446 rxnScores = scoreComplexModel(prepDataTest1.refModel,[],arrayData1,arrayData1.tissues{1},[]);
0447 expRes = getTstModelRxnScores();
0448 verifyTrue(testCase, all(abs(rxnScores - expRes) < 10^-10))
0449 end
0450
0451 function testModelL = getTstModelL()
0452
0453 testModelL = struct();
0454 testModelL.id = 'testModel';
0455 testModelL.rxns = {};
0456 testModelL.S=[];
0457 testModelL.rev=[];
0458 testModelL.metNames = {'e1';'e2';'e3';'e4';'e5';'e6';'e7';'e8';'e9';'e1';'e2';'e3';'e4';'e5';'e6';'e7';'e8';'e9';'x1';'x2';'x3';'x4';'x5';'x6';'x7';'x8';'x9';'x10';'x11'};
0459 testModelL.comps = {'s';'c'};
0460 testModelL.compNames = testModelL.comps;
0461 testModelL.metComps = [1;1;1;1;1;1;1;1;1;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2];
0462 testModelL.mets = strcat(testModelL.metNames, testModelL.comps(testModelL.metComps));
0463
0464
0465 testModelL.grRules = {};
0466 testModelL.rxnGeneMat = [];
0467
0468 testModelL.genes = {'Ge1';'Ge2';'Ge4';'Ge5';'Ge7';'Ge9'; 'Gr1';'Gr2';'Gr3';'Gr5';'Gr6';'Gr7';'Gr8';'Gr9';'Gr10';'Gr11';'Gr12';'Gr14';'Gr15'};
0469
0470
0471 testModelL.ub = [];
0472 testModelL.lb = [];
0473
0474 rxnsToAdd = struct();
0475 rxnsToAdd.rxns = { 'S1';'S2';'S3';'S4';'S5';'S6';'S7';'S8';'S9';'E1';'E2';'E2b';'E3';'E4';'E5';'E6';'E7';'E8';'E9';'R1';'R2';'R3';'R4';'R5';'R6';'R7';'R8';'R9';'R10';'R11';'R12';'R13';'R14';'R15'};
0476 rxnsToAdd.grRules = {''; ''; ''; ''; ''; ''; ''; ''; ''; 'Ge1';'Ge2';'';'';'Ge4';'Ge5';'';'Ge7';'';'Ge9'; 'Gr1';'Gr2';'Gr3';'';'Gr5';'Gr6';'Gr7';'Gr8';'Gr9';'Gr10';'Gr11';'Gr12';'';'Gr14';'Gr15'};
0477 rxnsToAdd.equations = {'e1[s] <=>';...
0478 'e2[s] <=>';...
0479 'e3[s] <=>';...
0480 'e4[s] <=>';...
0481 'e5[s] <=>';...
0482 'e6[s] <=>';...
0483 'e7[s] <=>';...
0484 'e8[s] <=>';...
0485 'e9[s] <=>';...
0486 'e1[s] <=> e1[c]';...
0487 'e2[s] <=> e2[c]';...
0488 'e2[s] <=> e2[c]';...
0489 'e3[s] <=> e3[c]';...
0490 'e4[s] <=> e4[c]';...
0491 'e5[s] <=> e5[c]';...
0492 'e6[s] <=> e6[c]';...
0493 'e7[s] <=> e7[c]';...
0494 'e8[s] <=> e8[c]';...
0495 'e9[s] <=> e9[c]';...
0496 'e1[c] + e2[c] <=> x1[c]';...
0497 'e1[c] + e3[c] => x2[c] + x3[c]';...
0498 'e4[c] + x3[c] => x4[c] + x5[c]';...
0499 'e5[c] + e6[c] + x4[c] => 2 x2[c] + x6[c]';...
0500 'x1[c] + x2[c] <=> x7[c] + 2 x8[c]';...
0501 'x2[c] + x8[c] => x3[c] + x9[c]';...
0502 'x4[c] <=> x9[c]';...
0503 'x5[c] <=> x9[c]';...
0504 'x6[c] <=> x10[c]';...
0505 'x6[c] <=> x11[c]';...
0506 'x10[c] + 2 x11[c] => e7[c]';...
0507 'x9[c] + x10[c] <=> e8[c]';...
0508 'x7[c] + x8[c] + x9[c] => e9[c]';...
0509 'x6[c] => x9[c]';...
0510 'x3[c] => x9[c]'...
0511 };
0512 testModelL = addRxns(testModelL,rxnsToAdd, 3);
0513 testModelL.c = [0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0];
0514 testModelL.rxnNames = testModelL.rxns;
0515 testModelL.b = repmat(0,length(testModelL.mets),1);
0516 end
0517
0518 function testModelLGeneScores = getTstModelLGeneScores()
0519
0520 testModelLGeneScores = [3; -1; 8; 6; -5; 5; 4; 5; 2; 3; 6; 1; 3; 1; -3; 1; 3; 1; 2];
0521 end
0522
0523
0524
0525
0526
0527
0528
0529 function testftINIT_T0050(testCase)
0530 testModelL = getTstModelL();
0531 testModelLGeneScores = getTstModelLGeneScores();
0532 testParams = struct();
0533
0534 arrayDataL = struct();
0535 arrayDataL.genes = testModelL.genes;
0536 arrayDataL.tissues = {'t1'};
0537 arrayDataL.levels = getExprForRxnScore(testModelLGeneScores,1);
0538 arrayDataL.threshold = 1;
0539
0540
0541 [~, prepDataL] = evalc('prepINITModel(testModelL, [], {}, false, {}, ''s'');');
0542
0543 [~,mres] = evalc('ftINIT(prepDataL,arrayDataL.tissues{1},[],[],arrayDataL,[],getINITSteps(),true,true,testParams,false);');
0544 [~,mres2] = evalc('ftINIT(prepDataL,arrayDataL.tissues{1},[],[],arrayDataL,[],getINITSteps([], ''full''),true,true,testParams,false);');
0545
0546 expResult = { 'S1';'S2';'S3';'S4';'S5';'S6';'S7';'S8';'S9';'E1';'E2';'E3';'E4';'E5';'E6';'E8';'E9';'R1';'R2';'R3';'R4';'R5';'R6';'R7';'R8';'R9';'R12';'R13';'R14';'R15'};
0547
0548 verifyTrue(testCase, all(strcmp(mres.rxns,expResult)))
0549 verifyTrue(testCase, all(strcmp(mres2.rxns,expResult)))
0550
0551
0552
0553
0554
0555
0556
0557
0558
0559
0560
0561
0562
0563
0564
0565
0566
0567
0568 end
0569
0570