Skip to content

Commit

Permalink
testing parameter distance reproducibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Aug 27, 2013
1 parent 4834466 commit e0c3866
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/+edu/+stanford/+covert/+cell/+sim/+util/DreamScoring.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
end

%helper methods
methods (Static = true, Access = protected)
methods (Static = true)
%Get struct of parameter values
function parameterVals = loadParameterVals(parameterVals, parameterValsPath)
import edu.stanford.covert.cell.sim.util.CachedSimulationObjectUtil;
Expand Down
26 changes: 26 additions & 0 deletions src_test/+edu/+stanford/+covert/+cell/+sim/DreamCompetitionTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,32 @@ function test_averageHighthroughputExperimentsAndCalcErrors(~)
assertEqual(0, dists.prediction);
end

function test_calcAvgSumSquaredLogRatioReproducible(~)
import edu.stanford.covert.cell.sim.util.CachedSimulationObjectUtil;
import edu.stanford.covert.cell.sim.util.DreamScoring;

sim = CachedSimulationObjectUtil.load();
refParameterVals = sim.getAllParameters();

met = sim.process('Metabolism');
rxnId = met.reactionWholeCellModelIDs{1};
kinetics.(rxnId).for = 1;
sim.applyMetabolicReactionKinetics(kinetics);
sim.applyRnaHalfLives(struct('TU_001', 1));
sim.applyRnaPolTuBindingProbs(struct('TU_290', 1e-3));
paramVals = sim.getAllParameters();

distsA = DreamScoring.calcAvgSumSquaredLogRatio(...
DreamScoring.getParameterVector(paramVals), ...
DreamScoring.getParameterVector(refParameterVals));

distsB = DreamScoring.calcAvgSumSquaredLogRatio(...
DreamScoring.getParameterVector(paramVals), ...
DreamScoring.getParameterVector(refParameterVals));

assertEqual(distsA, distsB)
end

function test_calcParameterAndPredictionScoring(~)
refParameterValsPath = 'output/1_1.parameters.mat';
refAvgValsPath = 'output/1_1.predictions.mat';
Expand Down

0 comments on commit e0c3866

Please sign in to comment.