From 811a7e8cd689f465160102e976f3049c2a2c5d9d Mon Sep 17 00:00:00 2001 From: "Zhaoyuan (Ryan) Fu" Date: Fri, 17 Jan 2025 15:31:15 -0500 Subject: [PATCH] Fix not using correct profiled count --- .../cbioportal/service/impl/StudyViewServiceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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();