This PR remakes 3 csv exports for forest plots so that the model's underlying data, not the model itself, is what is exported. The figures are -
4F in figures/scripts/fig4-tp53-telomerase-panels.R. This panel was derived from the tp53_telomerase survival module notebook.
4G in figures/scripts/fig4-hgg-subtype-forest-plot.R. This panel was derived from the subtypes survival module notebook.
5D in figures/scripts/fig5-forest-plot.R. This panel was derived from the immune survival module notebook.
The exports themselves are fairly simple, but I had to update the survival module to be able to get the data written out for use in these figure scripts. That update was small, just a quick change to the function in analyses/survival-analysis/util/survival_models.R. Rather than only exporting the model object (which does not appear to still hold the input data) in RDS files, I updated the code to export a list of the model and the data that went into the model. This does not affect any survival notebooks beyond the need to re-run them, and the only scripts that consume survival model output are figure scripts (edit - and MS tables, so I also updated reading in models accordingly in https://github.com/AlexsLemonade/OpenPBTA-analysis/pull/1722/commits/0c8d64ae91dbf7f59ce4e6829911b000c65940e1). So, now we can read in data for export along with the model for plotting.
I therefore had to re-run the survival module, so all the RDS result files have changed as expected - they are slightly larger now since they contain the data too. Hence, the diffs.
I also ensured that the exported CSVs have LIVING and DECEASED statuses instead of 1/0 (this was already the case for one of the data frames, but had to be updated for the other two).
Part of #1718
This PR remakes 3 csv exports for forest plots so that the model's underlying data, not the model itself, is what is exported. The figures are -
figures/scripts/fig4-tp53-telomerase-panels.R
. This panel was derived from thetp53_telomerase
survival module notebook.figures/scripts/fig4-hgg-subtype-forest-plot.R
. This panel was derived from thesubtypes
survival module notebook.figures/scripts/fig5-forest-plot.R
. This panel was derived from theimmune
survival module notebook.The exports themselves are fairly simple, but I had to update the survival module to be able to get the data written out for use in these figure scripts. That update was small, just a quick change to the function in
analyses/survival-analysis/util/survival_models.R
. Rather than only exporting the model object (which does not appear to still hold the input data) in RDS files, I updated the code to export a list of the model and the data that went into the model. This does not affect any survival notebooks beyond the need to re-run them, and the only scripts that consume survival model output are figure scripts (edit - and MS tables, so I also updated reading in models accordingly in https://github.com/AlexsLemonade/OpenPBTA-analysis/pull/1722/commits/0c8d64ae91dbf7f59ce4e6829911b000c65940e1). So, now we can read in data for export along with the model for plotting.I therefore had to re-run the survival module, so all the
RDS
result files have changed as expected - they are slightly larger now since they contain the data too. Hence, the diffs.I also ensured that the exported CSVs have
LIVING
andDECEASED
statuses instead of 1/0 (this was already the case for one of the data frames, but had to be updated for the other two).