Skip to content

Commit

Permalink
Update logic to add gistic to map
Browse files Browse the repository at this point in the history
  • Loading branch information
haynescd committed Oct 2, 2024
1 parent 7c1ba35 commit 632ed52
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,14 @@ private List<AlterationCountByGene> populateAlterationCountsWithMutSigQValue(Lis

private List<CopyNumberCountByGene> populateAlterationCountsWithCNASigQValue(List<CopyNumberCountByGene> alterationCountByGenes, StudyViewFilterContext studyViewFilterContext) throws StudyNotFoundException {
final var gisticMap = getGisticMap(studyViewFilterContext);
alterationCountByGenes.parallelStream()
.filter(alterationCount -> gisticMap.containsKey(Pair.create(alterationCount.getHugoGeneSymbol(), alterationCount.getAlteration())))
.forEach(alterationCount -> {

if(!gisticMap.isEmpty()) {
alterationCountByGenes.parallelStream()
.filter(alterationCount -> gisticMap.containsKey(Pair.create(alterationCount.getHugoGeneSymbol(), alterationCount.getAlteration())))
.forEach(alterationCount -> {
alterationCount.setqValue(gisticMap.get(Pair.create(alterationCount.getHugoGeneSymbol(), alterationCount.getAlteration())).getqValue());
});
});
}
return alterationCountByGenes;
}

Expand Down Expand Up @@ -421,9 +424,9 @@ private Map<Pair<String, Integer>, Gistic> getGisticMap(StudyViewFilterContext s
var amp = (gistic.getAmp()) ? 2 : -2;
for (GisticToGene gene : gistic.getGenes()) {
var key = Pair.create(gene.getHugoGeneSymbol(), amp);
Gistic g = gisticMap.get(key);
if (g == null || g.getqValue().compareTo(gistic.getqValue()) < 0) {
gisticMap.put(key, g);
Gistic currentGistic = gisticMap.get(key);
if (currentGistic == null || gistic.getqValue().compareTo(currentGistic.getqValue()) < 0) {
gisticMap.put(key, gistic);
}
}
}
Expand Down

0 comments on commit 632ed52

Please sign in to comment.