Skip to content

Commit e0c3866

Browse files
committed
testing parameter distance reproducibility
1 parent 4834466 commit e0c3866

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/+edu/+stanford/+covert/+cell/+sim/+util/DreamScoring.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
end
205205

206206
%helper methods
207-
methods (Static = true, Access = protected)
207+
methods (Static = true)
208208
%Get struct of parameter values
209209
function parameterVals = loadParameterVals(parameterVals, parameterValsPath)
210210
import edu.stanford.covert.cell.sim.util.CachedSimulationObjectUtil;

src_test/+edu/+stanford/+covert/+cell/+sim/DreamCompetitionTest.m

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,32 @@ function test_averageHighthroughputExperimentsAndCalcErrors(~)
390390
assertEqual(0, dists.prediction);
391391
end
392392

393+
function test_calcAvgSumSquaredLogRatioReproducible(~)
394+
import edu.stanford.covert.cell.sim.util.CachedSimulationObjectUtil;
395+
import edu.stanford.covert.cell.sim.util.DreamScoring;
396+
397+
sim = CachedSimulationObjectUtil.load();
398+
refParameterVals = sim.getAllParameters();
399+
400+
met = sim.process('Metabolism');
401+
rxnId = met.reactionWholeCellModelIDs{1};
402+
kinetics.(rxnId).for = 1;
403+
sim.applyMetabolicReactionKinetics(kinetics);
404+
sim.applyRnaHalfLives(struct('TU_001', 1));
405+
sim.applyRnaPolTuBindingProbs(struct('TU_290', 1e-3));
406+
paramVals = sim.getAllParameters();
407+
408+
distsA = DreamScoring.calcAvgSumSquaredLogRatio(...
409+
DreamScoring.getParameterVector(paramVals), ...
410+
DreamScoring.getParameterVector(refParameterVals));
411+
412+
distsB = DreamScoring.calcAvgSumSquaredLogRatio(...
413+
DreamScoring.getParameterVector(paramVals), ...
414+
DreamScoring.getParameterVector(refParameterVals));
415+
416+
assertEqual(distsA, distsB)
417+
end
418+
393419
function test_calcParameterAndPredictionScoring(~)
394420
refParameterValsPath = 'output/1_1.parameters.mat';
395421
refAvgValsPath = 'output/1_1.predictions.mat';

0 commit comments

Comments
 (0)