Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rfc80/fix alteration counts total profiled counts #10858

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.cbioportal.web.parameter.StudyViewFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
Expand Down Expand Up @@ -286,7 +285,7 @@ private < T extends AlterationCountByGene> List<T> populateAlterationCounts(@Non
Set<String> matchingGenePanelIds = matchingGenePanelIdsMap.get(hugoGeneSymbol) != null ?
matchingGenePanelIdsMap.get(hugoGeneSymbol) : Collections.emptySet();

int totalProfiledCount = getTotalProfiledCount(alterationCountByGene.getHugoGeneSymbol(),
int totalProfiledCount = getTotalProfiledCount(hugoGeneSymbol,
profiledCountsMap, profiledCountWithoutGenePanelData, matchingGenePanelIds);

alterationCountByGene.setNumberOfProfiledCases(totalProfiledCount);
Expand All @@ -297,7 +296,7 @@ private < T extends AlterationCountByGene> List<T> populateAlterationCounts(@Non
}

private int getTotalProfiledCount(@NonNull String hugoGeneSymbol, @NonNull Map<String, AlterationCountByGene> profiledCountsMap,
int profiledCountWithoutGenePanelData, @Nullable Set<String> matchingGenePanelIds) {
int profiledCountWithoutGenePanelData, @NonNull Set<String> matchingGenePanelIds) {
int totalProfiledCount = profiledCountWithoutGenePanelData;

if (hasGenePanelData(matchingGenePanelIds) && profiledCountsMap.containsKey(hugoGeneSymbol)) {
Expand All @@ -306,9 +305,9 @@ private int getTotalProfiledCount(@NonNull String hugoGeneSymbol, @NonNull Map<S
return totalProfiledCount;
}

private boolean hasGenePanelData(@Nullable Set<String> matchingGenePanelIds) {
return matchingGenePanelIds != null && matchingGenePanelIds.contains(WHOLE_EXOME_SEQUENCING)
&& matchingGenePanelIds.size() > 1;
private boolean hasGenePanelData(@NonNull Set<String> matchingGenePanelIds) {
return matchingGenePanelIds.contains(WHOLE_EXOME_SEQUENCING)
&& matchingGenePanelIds.size() > 1 || !matchingGenePanelIds.contains(WHOLE_EXOME_SEQUENCING) && !matchingGenePanelIds.isEmpty();
}

private <S extends AlterationCountBase> Pair<List<S>, Long> getAlterationGeneCounts(
Expand Down
Loading