-
Notifications
You must be signed in to change notification settings - Fork 316
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
RFC69 : survival chart with landmark events and hazard ratio #4740
Conversation
@@ -133,7 +133,7 @@ export default abstract class ComparisonStore extends AnalysisStore | |||
@observable public adjustForLeftTruncation = true; | |||
|
|||
constructor( | |||
protected appStore: AppStore, | |||
public appStore: AppStore, |
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.
This one should be made protected again and the featureFlag for the extended survival plot should be shared with in a better way.
@@ -317,6 +319,7 @@ export default class Survival extends React.Component<ISurvivalProps, {}> { | |||
style={{ paddingBottom: 0 }} | |||
> | |||
{getStatisticalCautionInfo()} | |||
{getHazardRatioCautionInfo()} |
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.
maybe do the same for getStatisticalCautionInfo while we're at it. (Function component)
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.
Also changed it for getStatisticalCautionInfo
and also updated /groupComparison/ClinicalData.tsx
since it also calls getStatisticalCautionInfo
return _.sortBy(curveData, d => d.months); | ||
}); | ||
|
||
const groupsTte = sortedCurves.map(curveData => { |
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.
can you improve this name? No idea what Tte means. Ir Ev.
controlGroup: string, | ||
...survivalCurves: SurvivalCurveItem[][] | ||
) { | ||
const allEvents = _.sortBy(_.flatten(survivalCurves), s => s.months); |
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.
this is important business logic here so comments about what we're doing would be helpful to devs trying to understand the basics
@computed get tableRowsHazardRatio() { | ||
if (this.hazardRatioGroups !== null) { | ||
return ( | ||
<React.Fragment> |
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 don't think you need Fragment here since you are just returning a single element (table)
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.
Removed the <React.Fragment>
const SURVIVAL_DOWN_SAMPLING_THRESHOLD = 1000; | ||
|
||
@observer | ||
export default class SurvivalChartExtended |
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.
we should discuss reason for doing this as extension rather than just a new component. the "Extension" kind of hides the true nature of this component. lets discuss.
@pvannierop I wanted to open a discussion about the practice here of copying an existing component in order to "extend it". Based on discussion with @TJMKuijpers, I now think I understand that |
987a847
to
ef59d55
Compare
Added the input field that reacts on user defined input Implemented multiple landmark lines Add the group information as label below chart landmark line functionality complete Dynamic calculation of groups for axis Implemented hazard ratio updated survival chart and tests show hazard ratio between every group Updated test Updated number at risk and legend Updated styling Updated statistics in survival chart updated CI calculations Updated SV plot Updated styling labels Added feature flag updated files fix behavior disable landmark input updated hazard ratio table style updated style table Updated screenshot tests for extended survival chart removed console.log getStatisticalCautionInfo and getHazardRatioCautionInfo changed to functional component Updated PR Updated legend style for hazard ratio legend Remove hazard ratio warning when feature flag is disabled Run Prettier Update the border chart for the default survival chart Removed feature flag for survival chart Updated screenshots Updated padding to fix screenshot Decreased whitespace between table and figure Update reference screenshot update localdb screenshots ref Updated font family landmark line labels Updated the test for survival chart localdb tests
afcbd50
to
a2f223e
Compare
@inodb updated the labels for the landmark line groups (had to change |
Add the group information as label below chart landmark line functionality Dynamic calculation of groups for axis Implement hazard ratio show hazard ratio between every group Remove hazard ratio warning when feature flag is disabled Removed feature flag for survival chart
RFC69: Add hazard ratio and landmarks in the survival plot
For clinical trials, it is customary to report hazard ratios and/or landmark values in survival plots. Currently, survival plots rendered by cBioPortal do not show hazard ratio or landmark information.
This PR is the implementation of RFC69. The new survival chart can be activated by setting
&featureFlag=SURVIVAL_PLOT_EXTENDED
.Implemented functions
Number at risk
Most scientific papers show a survival plot together with the number at risk table. We have added this option to the survival plot and show the number of risks below the figure (number at risk at every tick on the x-axis).
Landmark lines
The user activates the landmarks option via a checkbox (by default, the landmark input field is disabled). The user can add values (comma or space separated) that are translated into vertical lines (dashed) in the survival plot.
Underneath the number at risk table, we show a new table with the percentage of patients at that specific landmark point.
Hazard ratios
The user activates the hazard ratio option via a checkbox. The user selects the Control group to serve as a reference (denominator) in the hazard ratio by dragging the Control group to the leftmost position in the Groups menu section. The hazard ratios for each experimental group ( with a 95% confidence interval and p-value) appear below the respective entries in the plot legend.
Implemented tests
Unit test for the new functions
Implemented screenshot tests: