public List<Gene> getRelatedGenesByScore() throws ApplicationException, DataStoreException, NoRelatedGenesInfoException { options = runGeneManiaAlgorithm(); final Map<Gene, Double> scores = options.getScores(); ArrayList<Gene> relatedGenes = new ArrayList<Gene>(scores.keySet()); Collections.sort( relatedGenes, new Comparator<Gene>() { public int compare(Gene gene1, Gene gene2) { return -Double.compare(scores.get(gene1), scores.get(gene2)); } }); return relatedGenes; }