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

Display germline mutation as white stripe in oncoprint view #913

Merged
merged 2 commits into from
Mar 30, 2018

Conversation

rnugraha
Copy link
Member

@rnugraha rnugraha commented Jan 23, 2018

What? Why?

  • Display germline mutation as white stripe in the oncoprint track
  • Add background to the oncoprint rule legends

Dependency

cBioPortal/oncoprintjs#55

Checks

  • 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 Airbnb React/JSX Style guide.
  • Make sure your commit messages end with a Signed-off-by string (this line
    can be automatically added by git if you run the git-commit command with
    the -s option)

Any screenshots or GIFs?

Before

schermafbeelding 2018-02-08 om 13 00 25

After

after1

In zoom-out

schermafbeelding 2018-02-08 om 11 26 37

Notify reviewers

Read our Pull request merging
policy
. If you are part of the
cBioPortal organization, notify the appropriate team (remove inappropriate):

@cBioPortal/frontend

If you are not part of the cBioPortal organization look at who worked on the
file before you. Please use git blame <filename> to determine that
and notify them here:

@pieterlukasse
Copy link
Member

perhaps remove all white-space changes in src/shared/components/oncoprint/geneticrules.ts...?

@jjgao
Copy link
Member

jjgao commented Jan 26, 2018

@rnugraha Can we still color based on mutation types (missense, truncating, inframe) for germline mutations?

@inodb
Copy link
Member

inodb commented Jan 26, 2018

Hey thanks for submitting @rnugraha ! I don't think the white line can convey all the information. For instance: I can't see the difference between truncating germline mutation and a patient that has both a somatic truncating mutation and a germline mutatation. I think it would make more sense to make a different track for germline mutations. So in the example four tracks, two for somatic BRCA1/2 and two for germline BRCA 1/2 mutation (if there are any). That would also be useful in showing which patients had germline+somatic profiling. Thoughts @adamabeshouse @schultzn ?

@adamabeshouse
Copy link
Contributor

just from a design perspective also, I find white is a little confusing because the other time we use white in the oncoprint is when whitespace means not sequenced, so it seems like it indicates the mutation is not as valid or important somehow (also because it makes the color of the mutation behind it quite difficult to spot)

@jjgao
Copy link
Member

jjgao commented Jan 26, 2018

cc'ing @schultzn on this discussion.

@Sjoerd-van-Hagen
Copy link

@inodb Currently, we have one gene per track and using the OQL it can be split up into multiple. We now also hide mutations in the oncoprint if there is a mutation that 'trumps' it. I think it would be good to keep it consistent. Your suggestion is good, but would be for a different feature in my opinion: 'germline in OQL'.

@pieterlukasse
Copy link
Member

pieterlukasse commented Jan 29, 2018

@jjgao the mutation type color will be there. It is missing in the screenshot because @rnugraha disabled it from the menu when making the screenshot.

@inodb thanks for the ideas. We discussed with @schultzn in a call and I collected some of his feedback regarding the issue you raised. See last page of RFC 40.

@adamabeshouse good point. We could try a light pink color instead of white. #FFC0CB perhaps?

@adamabeshouse
Copy link
Contributor

adamabeshouse commented Jan 29, 2018

@pieterlukasse how about a slightly different shape? that could be another way to indicate that its still a mutation of the same type, but with an additional modifier. it might be less confusing than stacking shapes on top of each other.

What about making it a diamond instead of a square? or a square with triangles on the top and bottom to make it some kind of elongated diamond.

@Sjoerd-van-Hagen
Copy link

@adamabeshouse I think the problem with using a different shape is that it will not be visible when you zoom uit.

@adamabeshouse
Copy link
Contributor

@Sjoerd-van-Hagen that's a good point, that would be a reason to favor the elongated diamond instead of a similar-sized diamond - the elongation would still be visible zoomed out

@Sjoerd-van-Hagen
Copy link

@adamabeshouse I am not sure what you mean or how it would remain visible when zooming out?

@adamabeshouse
Copy link
Contributor

@Sjoerd-van-Hagen heres a mockup:
germline-diamond

germline-diamond-zoomed

I actually agree its not that clear zoomed out. But I also don't think putting a shape in front of the square is good, because it seems to modify the graphic in a way that detracts from it, when the message should be that theres just an EXTRA piece of info about the mutation.

Maybe something like this, a little cap on top of the mutation square?
In this image is also a possibility of having a cap on top and bottom of the square
image

@Sjoerd-van-Hagen
Copy link

@adamabeshouse I would then go for a line at the top and the bottom of the square. It will still look good when zooming out and it is easier to implement.

@schultzn
Copy link

We won't be able to show all details. I still think the white line looks best - that could be used to indicate the presence of a germline mutation in that gene in that patient. If there are multiple mutations in the same gene and sample, the tooltip can reveal that.

@jjgao
Copy link
Member

jjgao commented Jan 29, 2018

@rnugraha could you please make the white line thinner and add another screenshot here? The current white color makes the green faded away -- maybe that's part of the confusion.

@Sjoerd-van-Hagen
Copy link

@jjgao Riza is out of the office this week. Perhaps @adamabeshouse can do this, if it is not too much trouble?

@jjgao jjgao had a problem deploying to cbioportal-frontend-pr-913 January 30, 2018 18:17 Failure
@jjgao
Copy link
Member

jjgao commented Jan 30, 2018

@Sjoerd-van-Hagen we can wait for @rnugraha.

@rnugraha
Copy link
Member Author

rnugraha commented Feb 5, 2018

Thanks all for the input and discussion. I would personally agree with the thinner white line. I shall update soon the screenshots.

@rnugraha
Copy link
Member Author

rnugraha commented Feb 8, 2018

Hi all, the PR's description and its screenshots are updated. Please beware that this PR has a dependency on cBioPortal/oncoprintjs#55.

One more thing was added:
We have a white-stripe marker on a white background. This makes the legend for germline-mutation becoming not visible. To accommodate this issue, a no-alteration rule (grey background) has been added to this marker as background. I also decided to apply it to the rest of the rule's legends to make them look more consistent.

We thought the grey background also will help other rule legends to make the positions of the markers clearer for the user.

@pieterlukasse
Copy link
Member

pieterlukasse commented Feb 8, 2018

Looks great @rnugraha , thanks for the changes! I like the grey background behind each legend item 👍

Copy link
Contributor

@adamabeshouse adamabeshouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need _germ in disp_mut if you're already tracking germline status with disp_germline? Looks good besides that.

@adamabeshouse
Copy link
Contributor

adamabeshouse commented Mar 6, 2018

@rnugraha I think there was a misunderstanding - changing disp_germline to isGermline doesn't make any difference, the issue is the redundancy between disp_germline and disp_mut. The solution I proposed was to replace every usage of disp_germline with a helper function, isGermline(d) which would check whether disp_mut contained the _germ suffix. In that case you'd have to add genetic rules for each of the disp_mut options.

@rnugraha
Copy link
Member Author

rnugraha commented Mar 6, 2018

Ok make sense. But on the second thought, I'm also going to revisit the other solution you've mentioned on eliminating _germ. Both have their own challenging tasks.

@rnugraha
Copy link
Member Author

rnugraha commented Mar 7, 2018

@adamabeshouse Okay, so different approach. Now only using disp_germ instead of adding more suffix '_germ' to the existing mutation types. Sorting and priorities are managed by the germline comparation metrix.

@adamabeshouse
Copy link
Contributor

@rnugraha that sounds good, thanks for doing that.

The last thing I need to ask is that you implement/adjust end to end tests having to do with the sort order. In home.spec.js, there is a section on oncoprint sorting. I'm not sure whether those tests will be affected by this change. If not, could you just add a simple test of a query that includes germline mutations, and validate the sort order using the method you can find in those tests ( checking the value of browser.execute(function() { frontendOnc.getIdOrder(); }).value)

@Sjoerd-van-Hagen
Copy link

@adamabeshouse could you re-review this PR and see if it is ready to be merged?

@rnugraha
Copy link
Member Author

@adamabeshouse Unit test & e2e have been provided. Could you pls have a look?

"patient id order correct"
);
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, please just add a check for sample order as well

@adamabeshouse
Copy link
Contributor

Looks good @rnugraha could you please squash to one commit?

Copy link
Contributor

@adamabeshouse adamabeshouse 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 besides comments

if (oncoprintMutationType === "fusion") {
dispFusion = true;
} else {
if (event.putativeDriver) {
oncoprintMutationType += "_rec";
}
dispGermline[oncoprintMutationType] = event.mutationStatus === 'Germline';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this be dispGermline[oncoprintMutationType] = dispGermline[oncoprintMutationType] || (event.mutationStatus === 'Germline');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a unit test like "fills a datum w one germline one non- " or something that could catch this

@rnugraha rnugraha force-pushed the germline-mutation branch from 98eac9e to 6530516 Compare March 26, 2018 13:22
@rnugraha
Copy link
Member Author

rnugraha commented Mar 26, 2018

@adamabeshouse https://github.com/cBioPortal/cbioportal-frontend/pull/913/files#diff-831da00dd128eebcf1b83908cb0fdd1cR84 should cover the unit test for germline flag. Let me know if you think it's not sufficient.

@adamabeshouse
Copy link
Contributor

@rnugraha thanks for making the fix. I think it's a good practice for us to make unit tests for any bugs we find, that's why I think it would be good to have a unit test where a datum is filled using two mutations - the first germline, the second not.

For testing in backend repo it should also be possible to run the tests without
loading frontend over http://localhost:3000. By setting
FRONTEND_TEST_DO_NOT_LOAD_EXTERNAL_FRONTEND=true one can disable this.

Also include study view and patient view tests, so we can get rid of old end to
end tests.

Furthermore remove browser version from the filename so the tests dont pass
when a different browser version is used.
@rnugraha rnugraha force-pushed the germline-mutation branch from 05c2847 to 32b3809 Compare March 27, 2018 09:53
@rnugraha
Copy link
Member Author

@adamabeshouse okay, pls check again

@adamabeshouse
Copy link
Contributor

adamabeshouse commented Mar 27, 2018

@rnugraha could you point me to the test, I don't see it? I see a test containing two separate tests w single mutations w germline. I think it would be good to have one test where a datum is filled with two mutations, one is germline and the second is not (thats the key), and the result should be that germline is true. This would catch the bug we're talking about

"fills a datum w two germline data correctly"

@adamabeshouse
Copy link
Contributor

@rnugraha it would be great to have a test where fillGeneticTrackDatum is called with data.length = 2, where the first element of data is Germline and the second is not

@rnugraha
Copy link
Member Author

ah that what you mean, ok pls check now

@adamabeshouse
Copy link
Contributor

adamabeshouse commented Mar 28, 2018

@rnugraha thanks! can you squash your commits and then Ill merge

can you also look into the failing end-to-end tests? i think almost all of them wont have to do with these changes but maybe the last failing test about oncoprint sample order?

@rnugraha rnugraha force-pushed the germline-mutation branch from 8bc40ee to 607915a Compare March 28, 2018 18:44
@rnugraha
Copy link
Member Author

rnugraha commented Mar 29, 2018

@adamabeshouse looks like all the failing tests have something to do with unable to reach certain amount of time to display something as well as the last failing test you mentioned. https://github.com/thehyve/cbioportal-frontend/blob/607915a7a919fa83f1bea77df57e382fdcb700f0/end-to-end-tests/specs/home.spec.js#L481

The e2e tests I created to test the germline seems to be fine.

@adamabeshouse
Copy link
Contributor

adamabeshouse commented Mar 29, 2018

@rnugraha so /index.do?cancer_study_id=acc_tcga&show_samples=true&Z_SCORE_THRESHOLD=2&RPPA_SCORE_THRESHOLD=2&data_priority=0&case_set_id=acc_tcga_cnaseq&gene_list=KRAS%2520NRAS%2520BRAF&geneset_list=+&tab_index=tab_visualize&Action=Submit&genetic_profile_ids_PROFILE_MUTATION_EXTENDED=acc_tcga_mutations&genetic_profile_ids_PROFILE_COPY_NUMBER_ALTERATION=acc_tcga_gistic&clinicallist=CANCER_TYPE,asodifjpaosidjfa,CANCER_TYPE_DETAILED,FRACTION_GENOME_ALTERED,aposdijfpoai,MUTATION_COUNT does not contain any germline mutations that may be modifying the order? if so, you just need to change the id order and commit the change to make the test pass again

@rnugraha
Copy link
Member Author

rnugraha commented Mar 30, 2018

@adamabeshouse The failed tests were not caused by my changes. The failed tests you saw are also in rc branch https://circleci.com/gh/cBioPortal/cbioportal-frontend/4458?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link.

This PR also does not affect the test with the URL you mentioned in your message. The URL you sent does not have germline mutations.

@adamabeshouse adamabeshouse merged commit c1a6d90 into cBioPortal:rc Mar 30, 2018
@rnugraha rnugraha deleted the germline-mutation branch July 25, 2018 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants