diff --git a/src/main/java/org/cbioportal/service/impl/StudyViewServiceImpl.java b/src/main/java/org/cbioportal/service/impl/StudyViewServiceImpl.java index 05ea4056aee..67276a42b38 100644 --- a/src/main/java/org/cbioportal/service/impl/StudyViewServiceImpl.java +++ b/src/main/java/org/cbioportal/service/impl/StudyViewServiceImpl.java @@ -161,12 +161,15 @@ public List getMutationCountsByGeneSpecific(List s .map(Gene::getEntrezGeneId) .toList(); - List alterationCountByGenes = alterationCountService.getSampleMutationGeneCounts( + Pair, Long> alterationCountsWithProfiledTotal = alterationCountService.getSampleMutationGeneCounts( caseIdentifiers, Select.byValues(entrezGeneIds), true, false, - alterationFilter).getFirst(); + alterationFilter); + + List alterationCountByGenes = alterationCountsWithProfiledTotal.getFirst(); + Long totalProfiledCases = alterationCountsWithProfiledTotal.getSecond(); return genomicDataFilters .stream() @@ -184,7 +187,7 @@ public List getMutationCountsByGeneSpecific(List s int totalCount = sampleIds.size(); int mutatedCount = 0; - int profiledCount = 0; + int profiledCount = Math.toIntExact(totalProfiledCases); if(filteredAlterationCount.isPresent()) { mutatedCount = filteredAlterationCount.get().getNumberOfAlteredCases();