@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); }
public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException{ VCDataJobID vcDataJobID = null; try{ if(dataOperation instanceof DataOperation.DataProcessingOutputTimeSeriesOP){ vcDataJobID = ((DataOperation.DataProcessingOutputTimeSeriesOP)dataOperation).getTimeSeriesJobSpec().getVcDataJobID(); } if(!(getVCData(dataOperation.getVCDataIdentifier()) instanceof SimulationData)){ return null; } File dataProcessingOutputFileHDF5 = ((SimulationData)getVCData(dataOperation.getVCDataIdentifier())).getDataProcessingOutputSourceFileHDF5(); DataOperationResults dataOperationResults = getDataProcessingOutput(dataOperation,dataProcessingOutputFileHDF5); if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_COMPLETE, dataOperation.getVCDataIdentifier(), new Double(0), ((DataOperationResults.DataProcessingOutputTimeSeriesValues)dataOperationResults).getTimeSeriesJobResults(),null); } return dataOperationResults; }catch(Exception e){ if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_FAILURE, dataOperation.getVCDataIdentifier(), new Double(0), null,e); } if(e instanceof DataAccessException){ throw (DataAccessException)e; }else{ throw new DataAccessException("Datasetcontrollerimpl.doDataOperation error: "+e.getMessage(),e); } } }
DataSetControllerImpl implements SimDataConstants,DataJobListenerHolder { public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException{ VCDataJobID vcDataJobID = null; try{ if(dataOperation instanceof DataOperation.DataProcessingOutputTimeSeriesOP){ vcDataJobID = ((DataOperation.DataProcessingOutputTimeSeriesOP)dataOperation).getTimeSeriesJobSpec().getVcDataJobID(); } if(!(getVCData(dataOperation.getVCDataIdentifier()) instanceof SimulationData)){ return null; } File dataProcessingOutputFileHDF5 = ((SimulationData)getVCData(dataOperation.getVCDataIdentifier())).getDataProcessingOutputSourceFileHDF5(); DataOperationResults dataOperationResults = getDataProcessingOutput(dataOperation,dataProcessingOutputFileHDF5); if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_COMPLETE, dataOperation.getVCDataIdentifier(), new Double(0), ((DataOperationResults.DataProcessingOutputTimeSeriesValues)dataOperationResults).getTimeSeriesJobResults(),null); } return dataOperationResults; }catch(Exception e){ if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_FAILURE, dataOperation.getVCDataIdentifier(), new Double(0), null,e); } if(e instanceof DataAccessException){ throw (DataAccessException)e; }else{ throw new DataAccessException("Datasetcontrollerimpl.doDataOperation error: "+e.getMessage(),e); } } } }
DataSetControllerImpl implements SimDataConstants,DataJobListenerHolder { public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException{ VCDataJobID vcDataJobID = null; try{ if(dataOperation instanceof DataOperation.DataProcessingOutputTimeSeriesOP){ vcDataJobID = ((DataOperation.DataProcessingOutputTimeSeriesOP)dataOperation).getTimeSeriesJobSpec().getVcDataJobID(); } if(!(getVCData(dataOperation.getVCDataIdentifier()) instanceof SimulationData)){ return null; } File dataProcessingOutputFileHDF5 = ((SimulationData)getVCData(dataOperation.getVCDataIdentifier())).getDataProcessingOutputSourceFileHDF5(); DataOperationResults dataOperationResults = getDataProcessingOutput(dataOperation,dataProcessingOutputFileHDF5); if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_COMPLETE, dataOperation.getVCDataIdentifier(), new Double(0), ((DataOperationResults.DataProcessingOutputTimeSeriesValues)dataOperationResults).getTimeSeriesJobResults(),null); } return dataOperationResults; }catch(Exception e){ if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_FAILURE, dataOperation.getVCDataIdentifier(), new Double(0), null,e); } if(e instanceof DataAccessException){ throw (DataAccessException)e; }else{ throw new DataAccessException("Datasetcontrollerimpl.doDataOperation error: "+e.getMessage(),e); } } } DataSetControllerImpl(Cachetable aCacheTable, File primaryDir, File secondDir); }
DataSetControllerImpl implements SimDataConstants,DataJobListenerHolder { public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException{ VCDataJobID vcDataJobID = null; try{ if(dataOperation instanceof DataOperation.DataProcessingOutputTimeSeriesOP){ vcDataJobID = ((DataOperation.DataProcessingOutputTimeSeriesOP)dataOperation).getTimeSeriesJobSpec().getVcDataJobID(); } if(!(getVCData(dataOperation.getVCDataIdentifier()) instanceof SimulationData)){ return null; } File dataProcessingOutputFileHDF5 = ((SimulationData)getVCData(dataOperation.getVCDataIdentifier())).getDataProcessingOutputSourceFileHDF5(); DataOperationResults dataOperationResults = getDataProcessingOutput(dataOperation,dataProcessingOutputFileHDF5); if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_COMPLETE, dataOperation.getVCDataIdentifier(), new Double(0), ((DataOperationResults.DataProcessingOutputTimeSeriesValues)dataOperationResults).getTimeSeriesJobResults(),null); } return dataOperationResults; }catch(Exception e){ if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_FAILURE, dataOperation.getVCDataIdentifier(), new Double(0), null,e); } if(e instanceof DataAccessException){ throw (DataAccessException)e; }else{ throw new DataAccessException("Datasetcontrollerimpl.doDataOperation error: "+e.getMessage(),e); } } } DataSetControllerImpl(Cachetable aCacheTable, File primaryDir, File secondDir); void addDataJobListener(DataJobListener newListener); DataOperationResults doDataOperation(DataOperation dataOperation); static DataOperationResults getDataProcessingOutput(DataOperation dataOperation,File dataProcessingOutputFileHDF5); FieldDataFileOperationResults fieldDataFileOperation(FieldDataFileOperationSpec fieldDataFileOperationSpec); DataIdentifier[] getDataIdentifiers(OutputContext outputContext, VCDataIdentifier vcdID); double[] getDataSetTimes(VCDataIdentifier vcdID); AnnotatedFunction getFunction(OutputContext outputContext,VCDataIdentifier vcdID,String variableName); AnnotatedFunction[] getFunctions(OutputContext outputContext,VCDataIdentifier vcdID); PlotData getLineScan(OutputContext outputContext, VCDataIdentifier vcdID, String varName, double time, SpatialSelection spatialSelection); CartesianMesh getMesh(VCDataIdentifier vcdID); ODEDataBlock getODEDataBlock(VCDataIdentifier vcdID); ParticleDataBlock getParticleDataBlock(VCDataIdentifier vcdID, double time); boolean getParticleDataExists(VCDataIdentifier vcdID); SimDataBlock getSimDataBlock(OutputContext outputContext, VCDataIdentifier vcdID, String varName, double time); TimeSeriesJobResults getTimeSeriesValues(OutputContext outputContext,final VCDataIdentifier vcdID,final TimeSeriesJobSpec timeSeriesJobSpec); VCData getVCData(VCDataIdentifier vcdID); void removeDataJobListener(DataJobListener djListener); void setAllowOptimizedTimeDataRetrieval(boolean bAllowOptimizedTimeDataRetrieval); boolean isAllowOptimizedTimeDataRetrieval(); void writeFieldFunctionData(
		OutputContext outputContext,
		FieldDataIdentifierSpec[] argFieldDataIDSpecs,
		boolean[] bResampleFlags,
		CartesianMesh newMesh,
		SimResampleInfoProvider simResampleInfoProvider,
		int simResampleMembraneDataLength,
		int handleExistingResampleMode); DataSetMetadata getDataSetMetadata(VCDataIdentifier vcdataID); DataSetTimeSeries getDataSetTimeSeries(VCDataIdentifier vcdataID, String[] variableNames); boolean getIsChombo(VCDataIdentifier vcdataID); boolean getIsMovingBoundary(VCDataIdentifier vcdataID); boolean getIsComsol(VCDataIdentifier vcdataID); ChomboFiles getChomboFiles(VCDataIdentifier vcdataID); VCellSimFiles getVCellSimFiles(VCDataIdentifier vcdataID); MovingBoundarySimFiles getMovingBoundarySimFiles(VCDataIdentifier vcdataID); ComsolSimFiles getComsolSimFiles(VCDataIdentifier vcdataID); VtuFileContainer getEmptyVtuMeshFiles(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID, int timeIndex); VtuFileContainer getEmptyVtuMeshFiles(ChomboFiles chomboFiles, VCDataIdentifier vcdataID, int timeIndex); VtuFileContainer getEmptyVtuMeshFiles(VCellSimFiles vcellSimFiles, VCDataIdentifier vcdataID, int timeIndex); VtuFileContainer getEmptyVtuMeshFiles(MovingBoundarySimFiles movingBoundarySimFiles, VCDataIdentifier vcdataID, int timeIndex); double[] getVtuTimes(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID); double[] getVtuMeshData(ComsolSimFiles comsolSimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time); double[] getVtuMeshData(ChomboFiles chomboFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time); double[] getVtuMeshData(MovingBoundarySimFiles movingBoundarySimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time); double[] getVtuMeshData(VCellSimFiles vcellFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time); VtuVarInfo[] getVtuVarInfos(VCellSimFiles vcellFiles, OutputContext outputContext, VCDataIdentifier vcdataID); VtuVarInfo[] getVtuVarInfos(ChomboFiles chomboFiles, OutputContext outputContext, VCDataIdentifier vcdataID); VtuVarInfo[] getVtuVarInfos(MovingBoundarySimFiles movingBoundaryFiles, OutputContext outputContext, VCDataIdentifier vcdataID); VtuVarInfo[] getVtuVarInfos(ComsolSimFiles comsolFiles, OutputContext outputContext, VCDataIdentifier vcdataID); NFSimMolecularConfigurations getNFSimMolecularConfigurations(VCDataIdentifier vcdID); }
DataSetControllerImpl implements SimDataConstants,DataJobListenerHolder { public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException{ VCDataJobID vcDataJobID = null; try{ if(dataOperation instanceof DataOperation.DataProcessingOutputTimeSeriesOP){ vcDataJobID = ((DataOperation.DataProcessingOutputTimeSeriesOP)dataOperation).getTimeSeriesJobSpec().getVcDataJobID(); } if(!(getVCData(dataOperation.getVCDataIdentifier()) instanceof SimulationData)){ return null; } File dataProcessingOutputFileHDF5 = ((SimulationData)getVCData(dataOperation.getVCDataIdentifier())).getDataProcessingOutputSourceFileHDF5(); DataOperationResults dataOperationResults = getDataProcessingOutput(dataOperation,dataProcessingOutputFileHDF5); if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_COMPLETE, dataOperation.getVCDataIdentifier(), new Double(0), ((DataOperationResults.DataProcessingOutputTimeSeriesValues)dataOperationResults).getTimeSeriesJobResults(),null); } return dataOperationResults; }catch(Exception e){ if(vcDataJobID != null){ fireDataJobEventIfNecessary(vcDataJobID,MessageEvent.DATA_FAILURE, dataOperation.getVCDataIdentifier(), new Double(0), null,e); } if(e instanceof DataAccessException){ throw (DataAccessException)e; }else{ throw new DataAccessException("Datasetcontrollerimpl.doDataOperation error: "+e.getMessage(),e); } } } DataSetControllerImpl(Cachetable aCacheTable, File primaryDir, File secondDir); void addDataJobListener(DataJobListener newListener); DataOperationResults doDataOperation(DataOperation dataOperation); static DataOperationResults getDataProcessingOutput(DataOperation dataOperation,File dataProcessingOutputFileHDF5); FieldDataFileOperationResults fieldDataFileOperation(FieldDataFileOperationSpec fieldDataFileOperationSpec); DataIdentifier[] getDataIdentifiers(OutputContext outputContext, VCDataIdentifier vcdID); double[] getDataSetTimes(VCDataIdentifier vcdID); AnnotatedFunction getFunction(OutputContext outputContext,VCDataIdentifier vcdID,String variableName); AnnotatedFunction[] getFunctions(OutputContext outputContext,VCDataIdentifier vcdID); PlotData getLineScan(OutputContext outputContext, VCDataIdentifier vcdID, String varName, double time, SpatialSelection spatialSelection); CartesianMesh getMesh(VCDataIdentifier vcdID); ODEDataBlock getODEDataBlock(VCDataIdentifier vcdID); ParticleDataBlock getParticleDataBlock(VCDataIdentifier vcdID, double time); boolean getParticleDataExists(VCDataIdentifier vcdID); SimDataBlock getSimDataBlock(OutputContext outputContext, VCDataIdentifier vcdID, String varName, double time); TimeSeriesJobResults getTimeSeriesValues(OutputContext outputContext,final VCDataIdentifier vcdID,final TimeSeriesJobSpec timeSeriesJobSpec); VCData getVCData(VCDataIdentifier vcdID); void removeDataJobListener(DataJobListener djListener); void setAllowOptimizedTimeDataRetrieval(boolean bAllowOptimizedTimeDataRetrieval); boolean isAllowOptimizedTimeDataRetrieval(); void writeFieldFunctionData(
		OutputContext outputContext,
		FieldDataIdentifierSpec[] argFieldDataIDSpecs,
		boolean[] bResampleFlags,
		CartesianMesh newMesh,
		SimResampleInfoProvider simResampleInfoProvider,
		int simResampleMembraneDataLength,
		int handleExistingResampleMode); DataSetMetadata getDataSetMetadata(VCDataIdentifier vcdataID); DataSetTimeSeries getDataSetTimeSeries(VCDataIdentifier vcdataID, String[] variableNames); boolean getIsChombo(VCDataIdentifier vcdataID); boolean getIsMovingBoundary(VCDataIdentifier vcdataID); boolean getIsComsol(VCDataIdentifier vcdataID); ChomboFiles getChomboFiles(VCDataIdentifier vcdataID); VCellSimFiles getVCellSimFiles(VCDataIdentifier vcdataID); MovingBoundarySimFiles getMovingBoundarySimFiles(VCDataIdentifier vcdataID); ComsolSimFiles getComsolSimFiles(VCDataIdentifier vcdataID); VtuFileContainer getEmptyVtuMeshFiles(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID, int timeIndex); VtuFileContainer getEmptyVtuMeshFiles(ChomboFiles chomboFiles, VCDataIdentifier vcdataID, int timeIndex); VtuFileContainer getEmptyVtuMeshFiles(VCellSimFiles vcellSimFiles, VCDataIdentifier vcdataID, int timeIndex); VtuFileContainer getEmptyVtuMeshFiles(MovingBoundarySimFiles movingBoundarySimFiles, VCDataIdentifier vcdataID, int timeIndex); double[] getVtuTimes(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID); double[] getVtuMeshData(ComsolSimFiles comsolSimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time); double[] getVtuMeshData(ChomboFiles chomboFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time); double[] getVtuMeshData(MovingBoundarySimFiles movingBoundarySimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time); double[] getVtuMeshData(VCellSimFiles vcellFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time); VtuVarInfo[] getVtuVarInfos(VCellSimFiles vcellFiles, OutputContext outputContext, VCDataIdentifier vcdataID); VtuVarInfo[] getVtuVarInfos(ChomboFiles chomboFiles, OutputContext outputContext, VCDataIdentifier vcdataID); VtuVarInfo[] getVtuVarInfos(MovingBoundarySimFiles movingBoundaryFiles, OutputContext outputContext, VCDataIdentifier vcdataID); VtuVarInfo[] getVtuVarInfos(ComsolSimFiles comsolFiles, OutputContext outputContext, VCDataIdentifier vcdataID); NFSimMolecularConfigurations getNFSimMolecularConfigurations(VCDataIdentifier vcdID); static final Logger lg; }