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

Fixing for Genie fusion issue 5613 #6093

Merged
merged 8 commits into from
Oct 10, 2019

Conversation

khzhu
Copy link
Contributor

@khzhu khzhu commented May 13, 2019

What? Why?

Fix #5613

Changes proposed in this pull request:

  1. backend:
  • add a new myBatis query getSampleCountInMultipleMolecularProfilesForMutationOrFusion to retrieve Mutations or Fusions from the mutation table.
  • add a new web service getSampleCountInMultipleMolecularProfilesForFusion
  • modify the existing web service getSampleCountInMultipleMolecularProfiles to use the new myBastis query created.
  • add a new API endpoint /fusion-genes/fetch
  1. frontend:
  • add a new Fusion table without Frequency column in the study view

Checks

  • Runs on Heroku.
  • Follows 7 rules of great commit messages. For most PRs a single commit should suffice, in some cases multiple topical commits can be useful. During review it is ok to see tiny commits (e.g. Fix reviewer comments), but right before the code gets merged to master or rc branch, any such commits should be squashed since they are useless to the other developers. Definitely avoid merge commits, use rebase instead.
  • Follows the Google Style Guide.
  • If this is a feature, the PR is to rc. If this is a bug fix, the PR is to master.

Any screenshots or GIFs?

If this is a new visual feature please add a before/after screenshot or gif
here with e.g. GifGrabber.

@khzhu khzhu requested review from jjgao, onursumer and zhx828 and removed request for jjgao May 13, 2019 18:03
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from a3c2edf to ebafefa Compare May 14, 2019 18:08
@jjgao
Copy link
Member

jjgao commented May 14, 2019

@khzhu wondering why there are 103 commits? would you rebase/squash it?

@khzhu
Copy link
Contributor Author

khzhu commented May 14, 2019

@JJ, sorry, I guess I only did merge. Rebased and will push back shortly.

@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from ebafefa to cd73c3e Compare May 14, 2019 20:55
@jjgao
Copy link
Member

jjgao commented May 14, 2019

@khzhu thanks!

Copy link
Member

@zhx828 zhx828 left a 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

@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from cd73c3e to 17123dd Compare July 5, 2019 20:01
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch 2 times, most recently from e732e91 to ff0d69a Compare July 22, 2019 19:30
@khzhu
Copy link
Contributor Author

khzhu commented Jul 22, 2019

@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!

@zhx828 zhx828 self-requested a review July 24, 2019 15:28
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from def3bdd to 8e021e5 Compare July 24, 2019 21:42
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch 2 times, most recently from 2f00e22 to 84444ac Compare August 19, 2019 16:19
Copy link
Contributor

@ao508 ao508 left a 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).

@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from 84444ac to 8b586e7 Compare August 27, 2019 19:33
@zhx828 zhx828 requested review from n1zea144 and removed request for onursumer August 27, 2019 19:39
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from 0bd4aae to b3d95a0 Compare August 28, 2019 07:17
@jjgao jjgao temporarily deployed to cbioportal-pr-6093 September 13, 2019 19:02 Inactive
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from f5fa996 to 3b6c40e Compare September 30, 2019 21:28
@jjgao jjgao temporarily deployed to cbioportal-pr-6093 September 30, 2019 21:28 Inactive
@zhx828 zhx828 requested a review from sheridancbio October 1, 2019 15:04
@jjgao jjgao temporarily deployed to cbioportal-pr-6093 October 1, 2019 18:36 Inactive
@zhx828 zhx828 force-pushed the GENIE-fusion-issue-5613 branch from 275dfdb to ba3742f Compare October 2, 2019 14:45
@jjgao jjgao temporarily deployed to cbioportal-pr-6093 October 2, 2019 14:45 Inactive
Signed-off-by: Hongxin Zhang <hongxin@cbio.mskcc.org>
@jjgao jjgao temporarily deployed to cbioportal-pr-6093 October 2, 2019 15:57 Inactive
Copy link
Contributor

@sheridancbio sheridancbio left a 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
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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)

Copy link
Contributor Author

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; }
Copy link
Contributor

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)

@sheridancbio
Copy link
Contributor

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
@jjgao jjgao temporarily deployed to cbioportal-pr-6093 October 4, 2019 15:34 Inactive
@jjgao jjgao temporarily deployed to cbioportal-pr-6093 October 4, 2019 15:53 Inactive
@jjgao jjgao had a problem deploying to cbioportal-pr-6093 October 10, 2019 16:50 Failure
Signed-off-by: Hongxin Zhang <hongxin@cbio.mskcc.org>
@zhx828 zhx828 merged commit d219080 into cBioPortal:master Oct 10, 2019
@jagnathan jagnathan deleted the GENIE-fusion-issue-5613 branch June 2, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mutated Genes table does not calculate frequencies correctly
6 participants