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

Add Total mutations as clinical variable in Plots tab #1275

Merged

Conversation

oplantalech
Copy link
Contributor

What? Why?

Fix cBioPortal/cbioportal#4291 .

Changes proposed in this pull request:

  • a
  • b

Checks

  • Is this PR adding logic based on one or more clinical attributes? If yes, please make sure validation for this attribute is also present in the data validation / data loading layers (in backend repo) and documented in File-Formats Clinical data section!
  • 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?

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

Notify reviewers

Read our Pull request merging
policy
. If you are part of the
cBioPortal organization, notify the approprate 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:

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.

just one small change, but looks good

@@ -403,21 +403,44 @@ export default class PlotsTab extends React.Component<IPlotsTabProps,{}> {

@computed get clinicalAttributeIdToClinicalAttribute():{[clinicalAttributeId:string]:ClinicalAttribute} {
if (this.props.store.clinicalAttributes.isComplete) {
return this.props.store.clinicalAttributes.result.reduce((map:{[clinicalAttributeId:string]:ClinicalAttribute}, next)=>{
let _map: {[clinicalAttributeId: string]: ClinicalAttribute} = this.props.store.clinicalAttributes.result.reduce((map:{[clinicalAttributeId:string]:ClinicalAttribute}, next)=>{
Copy link
Contributor

Choose a reason for hiding this comment

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

you can shorten this as _.keyBy(this.props.store.clinicalAttributes.result, c=>c.clinicalAttributeId)

map[next.clinicalAttributeId] = next;
return map;
}, {});
if (this.props.store.studyIds.isComplete) {
_map["total_mutations"] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

its better to make this an enum value or something (look at the enum SpecialAttribute), at least a constant in this file const TOTAL_MUTATIONS_CLIN_ATTR_ID = "total_mutations", then reference that elsewhere below

@jjgao
Copy link
Member

jjgao commented Jul 6, 2018

@adamabeshouse @oplantalech the interface improvement discussed here (cBioPortal/cbioportal#4432) may impact this PR.

@oplantalech
Copy link
Contributor Author

oplantalech commented Jul 6, 2018

@adamabeshouse I've implemented your suggestions and I've also rebased to rc. Is it possible to include that in the release-1.15.0 branch?

@jjgao If the changes you mention are implemented, I think they will affect very little the code I've written. In any case, though, I believe this PR will be merged before those changes are implemented.

@jjgao
Copy link
Member

jjgao commented Jul 13, 2018

@oplantalech ok to point to release-1.5.0 assuming the current rc (and this pull request) does not contain other new code.

I was also asking in issue #4291 whether you would be able to add Fraction of Genome Altered as well?

@jjgao
Copy link
Member

jjgao commented Jul 13, 2018

I would also like to test it before merging.

@oplantalech
Copy link
Contributor Author

@jjgao Ok, I'll move it into release-1.15.0. Regarding the fraction of genome altered, it's almost ready, once this PR is merged I'm going to open a new one implementing this feature.

@oplantalech oplantalech changed the base branch from rc to release-1.15.0 July 13, 2018 07:43
@jjgao jjgao temporarily deployed to cbioportal-frontend-pr-1275 July 16, 2018 14:51 Inactive
@jjgao
Copy link
Member

jjgao commented Jul 16, 2018

Tested the feature. It looks great 👍

@jjgao
Copy link
Member

jjgao commented Jul 16, 2018

Why are the e2e tests failing?

@inodb
Copy link
Member

inodb commented Jul 16, 2018

@jjgao Seems like Total Mutations is now shown in plots tab instead of Diagnosis Age attribute: https://10779-66571349-gh.circle-artifacts.com/0/imageCompare.html. Also, seems like it might be better to log scale total mutations there. Prolly outside of the scope of this pr tho

@adamabeshouse
Copy link
Contributor

adamabeshouse commented Jul 16, 2018

@inodb it wouldnt be very hard but yeah probably out of scope of this PR. ill log an issue: cBioPortal/cbioportal#4456

@jjgao
Copy link
Member

jjgao commented Jul 16, 2018

I think we should update the screenshot and merge this pr. Log scale can be addressed in another pr.

@inodb
Copy link
Member

inodb commented Jul 16, 2018

@adamabeshouse do u know how the default clinical attribute on plots can be adjusted? Maybe better to keep using Diagnosis Age such that the plots look good. I guess it has to do with the order of clinical attributes in the dropdown menu of oncoprint?

@adamabeshouse
Copy link
Contributor

adamabeshouse commented Jul 16, 2018

@inodb its about the order of the clinical attributes list, not related to oncoprint

@inodb
Copy link
Member

inodb commented Jul 18, 2018

ideally test there is adjusted to select Diagnosis Age in the plots tab instead of just the first clinical attribute in the list. The total mutation count plots don't really show the whiskers very well, so kinda hard to spot regressions in that part of the code

@adamabeshouse
Copy link
Contributor

adamabeshouse commented Jul 18, 2018

@oplantalech you can use this command in screenshot.spec.js, in it("plots tab clinical vs molecular" between broser.click(..) and waitForAndCheckPlotsTab:

browser.execute(function() { resultsViewPlotsTab.onHorizontalAxisClinicalAttributeSelect({ value: "AGE" }); });

that should fix all the failing tests

@jjgao jjgao temporarily deployed to cbioportal-frontend-pr-1275 July 19, 2018 07:39 Inactive
@oplantalech
Copy link
Contributor Author

@adamabeshouse I've add your command in screenshot.spec.js but the screenshots still fail

@adamabeshouse
Copy link
Contributor

@oplantalech ah, okay so do the exact same thing in it("plots tab clinical vs clinical boxplot" and that should fix it

@jjgao jjgao temporarily deployed to cbioportal-frontend-pr-1275 July 19, 2018 20:51 Inactive
@adamabeshouse adamabeshouse merged commit 2a3cdd1 into cBioPortal:release-1.15.0 Jul 19, 2018
@oplantalech oplantalech deleted the total_mutations_in_plot branch July 20, 2018 08:14
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.

4 participants