Skip to content

Commit

Permalink
Rename and codument better method to updateCaseLists
Browse files Browse the repository at this point in the history
  • Loading branch information
forus committed Jun 26, 2024
1 parent 28dfa05 commit 347d318
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void run() {
this.caseListSampleIdToSampleIds.put(cancerStudyStableId + "_all", this.allSampleIds);
Map<String, Set<String>> readCaseListSampleIds = readCaseListFiles();
this.caseListSampleIdToSampleIds.putAll(readCaseListSampleIds);
updateCaseLists(this.caseListSampleIdToSampleIds);
updateCaseListsForTheStudy(this.caseListSampleIdToSampleIds);
}

private Map<String, Set<String>> readCaseListFiles() {
Expand All @@ -96,7 +96,17 @@ private Map<String, Set<String>> readCaseListFiles() {
return result;
}

private void updateCaseLists(Map<String, Set<String>> caseListSampleIdToSampleIds) {
/**
* Updates study case lists
* by adding new sample IDs to their designated case lists
* and ensuring these sample IDs are removed from any other case lists within the study.
*
* @param caseListSampleIdToSampleIds case list ID -> sample IDs map
* NOTE: The `caseListSampleIdToSampleIds` mapping is not a complete representation of all case lists in the study.
* We do not drop any existing case lists for the study. Instead, we only add or remove sample IDs
* that are specified in the provided mapping.
*/
private void updateCaseListsForTheStudy(Map<String, Set<String>> caseListSampleIdToSampleIds) {
DaoCancerStudy.reCacheAll();
try {
for (Map.Entry<String, Set<String>> caseListStableIdToSampleIds : caseListSampleIdToSampleIds.entrySet()) {
Expand Down

0 comments on commit 347d318

Please sign in to comment.