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 property to define custom sample type colors in patient view #4704

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

BasLee
Copy link

@BasLee BasLee commented Aug 21, 2023

Extend the legend colors of sample types in the patient view by configuring custom sample types with a backend property.
Depends on: cBioPortal/cbioportal#10336.

image
Example of a patient view timeline with a sample of type ctDNA

Configure custom sample types and their colors in the patient view using a new property skin_patient_view_custom_sample_types like:

{
   "plasma": "gold",
   "ctdna": "lightblue",
   "urine": "yellow",
   "biopsy 3": "#00c040ff"
}

Copy link

@SRodenburg SRodenburg left a comment

Choose a reason for hiding this comment

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

is there a way to generate these hex codes and types instead of hard-coding a fixed amount?

@BasLee
Copy link
Author

BasLee commented Aug 21, 2023

is there a way to generate these hex codes and types instead of hard-coding a fixed amount?

scss has methods to merge and alter colors, we could use those to create a scale

or we could create a js function that creates the colors based on the number of custom sample types there are?

@BasLee
Copy link
Author

BasLee commented Aug 22, 2023

As discussed in the standup yesterday, the colors can now be configured along with the custom sample types in a backend. See example in PR description

@BasLee BasLee force-pushed the patient-view-sample-colors-scale branch from 2fde18f to 3890eeb Compare August 22, 2023 08:22
@BasLee BasLee changed the title Introduce color scale in patient view for custom sample types Add property to define custom sample type colors in patient view Aug 22, 2023
@BasLee BasLee requested review from SRodenburg, alisman and inodb August 22, 2023 11:22
@BasLee BasLee force-pushed the patient-view-sample-colors-scale branch from 5faae30 to b546134 Compare August 28, 2023 15:13
@alisman
Copy link
Collaborator

alisman commented Aug 28, 2023

@BasLee @pvannierop into and I think that the costum color configuration should always win out for any sample type, whether existing or custom. E.g. if I configure primary:yellow, it should override the default for that type (it doesn't now).

The name of the configuration property skin_patient_view_custom_sample_types is misleading. We're assigning custom colors to types. skin.patient.view.sample_type_colors ?

@BasLee
Copy link
Author

BasLee commented Aug 30, 2023

I think that the costum color configuration should always win out for any sample type, whether existing or custom. E.g. if I configure primary:yellow, it should override the default for that type (it doesn't now).

The name of the configuration property skin_patient_view_custom_sample_types is misleading. We're assigning custom colors to types. skin.patient.view.sample_type_colors ?

@alisman FIxed in dc75512 and c9da654

@alisman
Copy link
Collaborator

alisman commented Aug 30, 2023

https://www.cbioportal.org/patient?studyId=msk_impact_2017&caseId=P-0000015

Doesn't respect default for type=met here (should be red)

@BasLee BasLee force-pushed the patient-view-sample-colors-scale branch from 230f222 to a247933 Compare August 30, 2023 15:33
@BasLee
Copy link
Author

BasLee commented Aug 31, 2023

Doesn't respect default for type=met here (should be red)

Fixed in a247933

@alisman alisman force-pushed the patient-view-sample-colors-scale branch from a247933 to 8be8177 Compare August 31, 2023 14:20
@alisman alisman merged commit 45cd9ac into cBioPortal:master Aug 31, 2023
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.

3 participants