@Test public void testAnalysisProcessor() throws IOException { CombinationAnalysis analysis = getAnalysis(); IMatrix resultsOk = analysis.getResults().get(); analysis.setResults(null); try { AnalysisProcessor processor = new CombinationProcessor(analysis); processor.run(getProgressMonitor()); } catch (AnalysisException e) { e.printStackTrace(); } IMatrix results = storeAndLoadMatrix(analysis.getResults().get()); AssertMatrix.assertEquals(resultsOk, results); }
@Override public void run(IProgressMonitor monitor) { Date startTime = new Date(); IMatrix data = analysis.getData().get(); MatrixDimensionKey combineDimension = (analysis.isTransposeData() ? ROWS : COLUMNS); MatrixDimensionKey iterateDimension = (analysis.isTransposeData() ? COLUMNS : ROWS); IModuleMap moduleMap; if (analysis.getGroupsMap() == null) { moduleMap = new HashModuleMap().addMapping("All data " + combineDimension.getLabel(), data.getDimension(combineDimension)); } else { moduleMap = ModuleMapUtils.filterByItems(analysis.getGroupsMap().get(), data.getDimension(combineDimension)); } analysis.setGroupsMap(new ResourceReference<>("modules", moduleMap)); String sizeLayer = analysis.getSizeLayer(); String pvalueLayer = analysis.getValueLayer(); if (pvalueLayer == null) { for (IMatrixLayer layer : data.getLayers()) { pvalueLayer = layer.getId(); } } analysis.setResults(new ResourceReference<>("results", combine( monitor, data, combineDimension, iterateDimension, moduleMap, sizeLayer, pvalueLayer) )); analysis.setStartTime(startTime); analysis.setElapsedTime(new Date().getTime() - startTime.getTime()); }
CombinationProcessor implements AnalysisProcessor { @Override public void run(IProgressMonitor monitor) { Date startTime = new Date(); IMatrix data = analysis.getData().get(); MatrixDimensionKey combineDimension = (analysis.isTransposeData() ? ROWS : COLUMNS); MatrixDimensionKey iterateDimension = (analysis.isTransposeData() ? COLUMNS : ROWS); IModuleMap moduleMap; if (analysis.getGroupsMap() == null) { moduleMap = new HashModuleMap().addMapping("All data " + combineDimension.getLabel(), data.getDimension(combineDimension)); } else { moduleMap = ModuleMapUtils.filterByItems(analysis.getGroupsMap().get(), data.getDimension(combineDimension)); } analysis.setGroupsMap(new ResourceReference<>("modules", moduleMap)); String sizeLayer = analysis.getSizeLayer(); String pvalueLayer = analysis.getValueLayer(); if (pvalueLayer == null) { for (IMatrixLayer layer : data.getLayers()) { pvalueLayer = layer.getId(); } } analysis.setResults(new ResourceReference<>("results", combine( monitor, data, combineDimension, iterateDimension, moduleMap, sizeLayer, pvalueLayer) )); analysis.setStartTime(startTime); analysis.setElapsedTime(new Date().getTime() - startTime.getTime()); } }
CombinationProcessor implements AnalysisProcessor { @Override public void run(IProgressMonitor monitor) { Date startTime = new Date(); IMatrix data = analysis.getData().get(); MatrixDimensionKey combineDimension = (analysis.isTransposeData() ? ROWS : COLUMNS); MatrixDimensionKey iterateDimension = (analysis.isTransposeData() ? COLUMNS : ROWS); IModuleMap moduleMap; if (analysis.getGroupsMap() == null) { moduleMap = new HashModuleMap().addMapping("All data " + combineDimension.getLabel(), data.getDimension(combineDimension)); } else { moduleMap = ModuleMapUtils.filterByItems(analysis.getGroupsMap().get(), data.getDimension(combineDimension)); } analysis.setGroupsMap(new ResourceReference<>("modules", moduleMap)); String sizeLayer = analysis.getSizeLayer(); String pvalueLayer = analysis.getValueLayer(); if (pvalueLayer == null) { for (IMatrixLayer layer : data.getLayers()) { pvalueLayer = layer.getId(); } } analysis.setResults(new ResourceReference<>("results", combine( monitor, data, combineDimension, iterateDimension, moduleMap, sizeLayer, pvalueLayer) )); analysis.setStartTime(startTime); analysis.setElapsedTime(new Date().getTime() - startTime.getTime()); } CombinationProcessor(CombinationAnalysis analysis); }
CombinationProcessor implements AnalysisProcessor { @Override public void run(IProgressMonitor monitor) { Date startTime = new Date(); IMatrix data = analysis.getData().get(); MatrixDimensionKey combineDimension = (analysis.isTransposeData() ? ROWS : COLUMNS); MatrixDimensionKey iterateDimension = (analysis.isTransposeData() ? COLUMNS : ROWS); IModuleMap moduleMap; if (analysis.getGroupsMap() == null) { moduleMap = new HashModuleMap().addMapping("All data " + combineDimension.getLabel(), data.getDimension(combineDimension)); } else { moduleMap = ModuleMapUtils.filterByItems(analysis.getGroupsMap().get(), data.getDimension(combineDimension)); } analysis.setGroupsMap(new ResourceReference<>("modules", moduleMap)); String sizeLayer = analysis.getSizeLayer(); String pvalueLayer = analysis.getValueLayer(); if (pvalueLayer == null) { for (IMatrixLayer layer : data.getLayers()) { pvalueLayer = layer.getId(); } } analysis.setResults(new ResourceReference<>("results", combine( monitor, data, combineDimension, iterateDimension, moduleMap, sizeLayer, pvalueLayer) )); analysis.setStartTime(startTime); analysis.setElapsedTime(new Date().getTime() - startTime.getTime()); } CombinationProcessor(CombinationAnalysis analysis); @Override void run(IProgressMonitor monitor); }
CombinationProcessor implements AnalysisProcessor { @Override public void run(IProgressMonitor monitor) { Date startTime = new Date(); IMatrix data = analysis.getData().get(); MatrixDimensionKey combineDimension = (analysis.isTransposeData() ? ROWS : COLUMNS); MatrixDimensionKey iterateDimension = (analysis.isTransposeData() ? COLUMNS : ROWS); IModuleMap moduleMap; if (analysis.getGroupsMap() == null) { moduleMap = new HashModuleMap().addMapping("All data " + combineDimension.getLabel(), data.getDimension(combineDimension)); } else { moduleMap = ModuleMapUtils.filterByItems(analysis.getGroupsMap().get(), data.getDimension(combineDimension)); } analysis.setGroupsMap(new ResourceReference<>("modules", moduleMap)); String sizeLayer = analysis.getSizeLayer(); String pvalueLayer = analysis.getValueLayer(); if (pvalueLayer == null) { for (IMatrixLayer layer : data.getLayers()) { pvalueLayer = layer.getId(); } } analysis.setResults(new ResourceReference<>("results", combine( monitor, data, combineDimension, iterateDimension, moduleMap, sizeLayer, pvalueLayer) )); analysis.setStartTime(startTime); analysis.setElapsedTime(new Date().getTime() - startTime.getTime()); } CombinationProcessor(CombinationAnalysis analysis); @Override void run(IProgressMonitor monitor);  }