/** * @param orConditions StatisticsQueryOrConditions<StatisticsQueryCondition> * @param statisticsStorage * @param scoringExps Set of experiments that have at least one non-zero score for * statisticsQuery. This is used retrieving efos to be displayed in heatmap when no query efvs * exist (c.f. atlasStatisticsQueryService.getScoringAttributesForGenes()) * @return Multiset<Integer> containing experiment counts corresponding to all attributes in each * StatisticsQueryCondition in orConditions */ private static Multiset<Integer> getScoresForOrConditions( final StatisticsQueryOrConditions<StatisticsQueryCondition> orConditions, StatisticsStorage statisticsStorage, Set<ExperimentInfo> scoringExps) { Multiset<Integer> scores = HashMultiset.create(); for (StatisticsQueryCondition orCondition : orConditions.getConditions()) { orCondition.setBioEntityIdRestrictionSet(orConditions.getBioEntityIdRestrictionSet()); scores.addAll(scoreQuery(orCondition, statisticsStorage, scoringExps)); } // Now apply orConditions' min experiments restriction to scores Multiset<Integer> qualifyingScores = HashMultiset.create(); for (Multiset.Entry<Integer> entry : scores.entrySet()) { if (entry.getCount() >= orConditions.getMinExperiments()) { qualifyingScores.setCount(entry.getElement(), entry.getCount()); } } return qualifyingScores; }