use of org.baderlab.csplugins.enrichmentmap.view.heatmap.table.RankOptionErrorHeader in project EnrichmentMapApp by BaderLab.
the class HeatMapMainPanel method updateSetting_RankOption.
public void updateSetting_RankOption(RankingOption rankOption) {
selectedRankOption = rankOption;
List<String> genes = getGenes(getOperator());
HeatMapTableModel tableModel = (HeatMapTableModel) table.getModel();
EnrichmentMap map = tableModel.getEnrichmentMap();
List<Integer> geneIds = genes.stream().map(map::getHashFromGene).collect(Collectors.toList());
CompletableFuture<Optional<Map<Integer, RankValue>>> rankingFuture = rankOption.computeRanking(geneIds);
if (rankingFuture != null) {
rankingFuture.whenComplete((ranking, ex) -> {
if (ranking.isPresent()) {
tableModel.setRanking(rankOption.getName(), ranking.get());
table.getColumnModel().getColumn(HeatMapTableModel.RANK_COL).setHeaderValue(rankOption);
} else {
tableModel.setRanking(rankOption.getName(), null);
table.getColumnModel().getColumn(HeatMapTableModel.RANK_COL).setHeaderValue(new RankOptionErrorHeader(rankOption));
}
table.getTableHeader().repaint();
});
}
settingChanged();
}
Aggregations