-
Notifications
You must be signed in to change notification settings - Fork 572
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
Fixing for Genie fusion issue 5613 #6093
Conversation
a3c2edf
to
ebafefa
Compare
@khzhu wondering why there are 103 commits? would you rebase/squash it? |
@JJ, sorry, I guess I only did merge. Rebased and will push back shortly. |
ebafefa
to
cd73c3e
Compare
@khzhu thanks! |
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.
Looks good to me
cd73c3e
to
17123dd
Compare
e732e91
to
ff0d69a
Compare
@zhx828 , I've added a new Gene filter for fusions. Please have your final review and let me know if anything else need to be done. Thanks! |
def3bdd
to
8e021e5
Compare
2f00e22
to
84444ac
Compare
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.
Hi @khzhu, I put together a PR that affects many of these files (#6523). In summary, the changes affect the persistence and service layer classes related to sql statements in MutationMapper.xml
that reference the sql id whereInMultipleMolecularProfiles
.
If you look at PR #6523 I added a new param called excludeFusions
to calls for fetching mutations from multiple molecular profiles. Only the study view controller actually needs to set this value to true since we want to exclude fusion events from affecting the calculated alteration frequencies by gene in the mutated genes
study view table.
Since the new method you introduced (getMutationsInMultipleMolecularProfilesByMutationType)[https://github.com//pull/6093/files#diff-9693fa0f2b985bb13b798a1d19d0c2ccR26] also references the sql id whereInMultipleMolecularProfiles
in MutationMapper.xml
, you will see an exception thrown regarding an unknown parameter excludeFusions
coming from the parsing of MutationMapper.xml
. To resolve this just add Boolean excludeFusions
to the methods you introduced and set the value to false in any controllers/tests/classes that actually use this (with the exception of the StudyViewController).
84444ac
to
8b586e7
Compare
0bd4aae
to
b3d95a0
Compare
f5fa996
to
3b6c40e
Compare
275dfdb
to
ba3742f
Compare
Signed-off-by: Hongxin Zhang <hongxin@cbio.mskcc.org>
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.
I am approving, but I recommend 2 things -- some whitespace fixes (indentation and reversed comments), and also to please consider removing the data transformation steps in the controller handler into a service class. I see that we already are using studyViewFilterUtil, mutationService, and significantlyMutatedGeneService ... but we are doing additional filtering and sorting here in the controller --- can we wrap all of this into another service class so that the controller just passes the extracted study and sampleIds to a simple service layer function call here? (we can create a FusionGenesFetchService class if needed for example)
public ResponseEntity<List<MutationCountByGene>> fetchFusionGenes( | ||
@ApiParam(required = true, value = "Study view filter") | ||
@Valid @RequestBody(required = false) StudyViewFilter studyViewFilter, | ||
@ApiIgnore // prevent reference to this attribute in the swagger-ui interface |
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.
these @ApiIgnore comments are reversed ... the first attribute is the one needed for @PreAuthorize .. the second is not
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.
@sheridancbio , thank you for the review. I will make corrections.
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.
corrected @ApiIgnore comments.
if (!filteredSampleIdentifiers.isEmpty()) { | ||
List<String> studyIds = new ArrayList<>(); | ||
List<String> sampleIds = new ArrayList<>(); | ||
studyViewFilterUtil.extractStudyAndSampleIds(filteredSampleIdentifiers, studyIds, sampleIds); |
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.
The logic below seems to go beyond simple argument checking and service selection. I think this qualifies as business logic which should be encapsulated and tested in the service layer. I see that a util class is employed here ... but even still, I think this qualifies as business logic (data transformations). I would not insist on relocation, but I guess I strongly recommend keeping data transformations out of the controller handler.
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.
total agree and very good points! It is not just here but the whole class should be refactored to pull those data transformations out and put into respective service layer. How about we have a follow up PR instead do correction here. What do you think @sheridancbio, @zhx828?
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.
will keep this principle in mind when switching to the new SV table and reimplementing fetch-fusion-gene endpoint.
private Boolean withCNAData; | ||
private RectangleBounds mutationCountVsCNASelection; | ||
private List<MutationGeneFilter> mutatedGenes; | ||
private List<FusionGeneFilter> fusionGenes; |
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.
standardize indentation to uniform 4-space indents (no tabs)
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.
corrected indents.
@@ -81,8 +82,14 @@ public void setClinicalDataIntervalFilters(List<ClinicalDataIntervalFilter> clin | |||
return mutatedGenes; | |||
} | |||
|
|||
public void setMutatedGenes(List<MutationGeneFilter> mutatedGenes) { | |||
this.mutatedGenes = mutatedGenes; | |||
public void setMutatedGenes(List<MutationGeneFilter> mutatedGenes) { this.mutatedGenes = mutatedGenes; } |
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.
standardize indentation to 4-space indentation (no tabs)
The connections to the involvedCancerStudyExtractorInterceptor class look good. |
…NIE-fusion-issue-5613 # Conflicts: # web/src/main/java/org/cbioportal/web/StudyViewController.java # web/src/main/java/org/cbioportal/web/parameter/StudyViewFilter.java
Signed-off-by: Hongxin Zhang <hongxin@cbio.mskcc.org>
What? Why?
Fix #5613
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. GifGrabber.