use of cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo in project vcell by virtualcell.
the class PDEDataViewer method calcVarStat.
private static ArrayList<VarStatistics> calcVarStat(PDEDataContext pdeDataContext, String[] stateVarNames) throws Exception {
ArrayList<VarStatistics> varStatsArr = new ArrayList<>();
DataProcessingOutputInfo dataProcessingOutputInfo = DataProcessingResultsPanel.getDataProcessingOutputInfo(pdeDataContext);
if (dataProcessingOutputInfo == null) {
return null;
}
String[] statisticVarNames = dataProcessingOutputInfo.getVariableNames();
for (String stateVarName : stateVarNames) {
double[] minValuesOvertime = null;
double[] maxValuesOverTime = null;
for (String statisticVarName : statisticVarNames) {
if (statisticVarName.startsWith(stateVarName + "_min")) {
minValuesOvertime = dataProcessingOutputInfo.getVariableStatValues().get(statisticVarName);
}
if (statisticVarName.startsWith(stateVarName + "_max")) {
maxValuesOverTime = dataProcessingOutputInfo.getVariableStatValues().get(statisticVarName);
}
}
if (minValuesOvertime != null && maxValuesOverTime != null) {
FunctionRangeGenerator.VarStatistics varstatistics = new VarStatistics(stateVarName, minValuesOvertime, maxValuesOverTime);
varStatsArr.add(varstatistics);
}
}
return varStatsArr;
}
use of cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo in project vcell by virtualcell.
the class DataSetControllerImplTest method testDoDataOperation.
@Test
public void testDoDataOperation() throws DataAccessException {
boolean bIncludeStartValuesInfo = true;
DataOperation dataOperation = new DataOperation.DataProcessingOutputInfoOP(vcDataIdentifier, bIncludeStartValuesInfo, outputContext);
DataProcessingOutputInfo results = (DataProcessingOutputInfo) dsc.doDataOperation(dataOperation);
String[] varNames = results.getVariableNames();
String[] expectedVarNames = { "C_cyt_average", "C_cyt_total", "C_cyt_min", "C_cyt_max", "Ran_cyt_average", "Ran_cyt_total", "Ran_cyt_min", "Ran_cyt_max", "RanC_cyt_average", "RanC_cyt_total", "RanC_cyt_min", "RanC_cyt_max", "RanC_nuc_average", "RanC_nuc_total", "RanC_nuc_min", "RanC_nuc_max", "s2_average", "s2_total", "s2_min", "s2_max" };
String[] expectedUnits = { "uM", "molecules", "uM", "uM", "uM", "molecules", "uM", "uM", "uM", "molecules", "uM", "uM", "uM", "molecules", "uM", "uM", "molecules.um-2", "molecules", "uM", "uM" };
double[] expectedTimePoints = { 0.0, 0.5, 1.0 };
double[] expectedStatistics_RanC_cyt_max = { 8.9, 3.5890337679723476, 3.057119332620108 };
Assert.assertArrayEquals(varNames, expectedVarNames);
Assert.assertArrayEquals(expectedTimePoints, results.getVariableTimePoints(), 1e-8);
for (int i = 0; i < expectedVarNames.length; i++) {
Assert.assertEquals(results.getVariableUnits(expectedVarNames[i]), expectedUnits[i]);
}
Assert.assertArrayEquals(expectedStatistics_RanC_cyt_max, results.getVariableStatValues().get("RanC_cyt_max"), 1e-8);
}
Aggregations