-
Notifications
You must be signed in to change notification settings - Fork 513
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
Rfc85 dynamic virtual study #11040
Rfc85 dynamic virtual study #11040
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good to me. Thanks @forus !
I added two questions.
/** | ||
* This method populates the `virtualStudyData` object with a new set of sample IDs retrieved as the result of executing a query based on virtual study view filters. | ||
* It first applies the filters defined within the study view, runs the query to fetch the relevant sample IDs, and then updates the virtualStudyData to reflect these fresh results. | ||
* This ensures that the virtual study contains the latest sample IDs. | ||
* @param virtualStudyData | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Quick question: will this be cached? If yes, how?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pieterlukasse this method is not cached, but studyViewFilterApplier.apply(virtualStudyData.getStudyViewFilter());
is. I don't think we should cache this method as it'd be cheap transformation.
List<SampleIdentifier> sampleIdentifiers = studyViewFilterApplier.apply(virtualStudyData.getStudyViewFilter()); | ||
Map<String, Set<String>> sampleIdsByStudyId = sampleIdentifiers | ||
.stream() | ||
.collect( | ||
Collectors.groupingBy( | ||
SampleIdentifier::getStudyId, | ||
Collectors.mapping(SampleIdentifier::getSampleId, Collectors.toSet()))); | ||
Set<VirtualStudySamples> virtualStudySamples = sampleIdsByStudyId.entrySet().stream().map(entry -> { | ||
VirtualStudySamples vss = new VirtualStudySamples(); | ||
vss.setId(entry.getKey()); | ||
vss.setSamples(entry.getValue()); | ||
return vss; | ||
}).collect(Collectors.toSet()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opinion, but I would extract this into a function called extractVirtualStudySamples
or something similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eda7367
to
1adca8c
Compare
- Use the constructor dep. injection - return value withou assigning it to a variable
Quality Gate passedIssues Measures |
Fix # (see https://help.github.com/en/articles/closing-issues-using-keywords)
Describe changes proposed in this pull request:
Checks
Any screenshots or GIFs?
If this is a new visual feature please add a before/after screenshot or gif
here with e.g. Giphy CAPTURE or Peek
Notify reviewers
Read our Pull request merging
policy. It can help to figure out who worked on the
file before you. Please use
git blame <filename>
to determine thatand notify them either through slack or by assigning them as a reviewer on the PR