53 Commits

Author SHA1 Message Date
b3ef8086ec coxph: Add uni and multivariate analysis 2021-01-17 11:22:06 +01:00
a3c816ad64 coxph: Adjust coxph summary output
Split HR and CI, print logrank values.
2021-01-17 11:21:05 +01:00
351b26368d uitils: Remove global data object before reinitializing
It seems that just overriding the object may not be enough to pure it.
Before loading the data, the variable "secmal" is removed.
2020-12-21 16:39:24 +01:00
9a331a2091 Merge branch 'data-update' into coxph
Update data.
2020-12-21 11:20:36 +01:00
2db6a44fad data: Use new dataset
Update link to new dataset.
2020-12-18 15:38:47 +01:00
79ccaec8fc data: Update to latest dataset 2020-12-18 15:37:32 +01:00
aa0024256b data: Reformat data
Sort data descendig at value uuid
2020-12-18 15:36:30 +01:00
8f07c45f63 coxph: First commit of coxph models
First univariate with covariates coxph models.
2020-11-25 17:28:13 +01:00
dbfcca9716 Merge branch 'visualize'
* visualize:
  Visualize asct per diagnosis per age
  Visualize asct per diagnosis per year
  Add basic histograms
  Remove unused factor levels from data after limiting
2020-11-19 19:46:44 +01:00
3c517431f6 Merge branch 'fix-library-load'
* fix-library-load:
  utils: Move library() calls to beginning of file
2020-11-19 19:46:39 +01:00
70ed15c2b8 Merge branch 'change-plot'
* change-plot:
  Change default aspect ratio for graphs
  Add optional width and height arguments save plots
2020-11-19 19:46:34 +01:00
0be00652e1 Visualize asct per diagnosis per age
This adds ggplots to visualize the number of ascts per diagnosis per
age in various methods:

* Histogram
* Density plot
* Frequency plot
* Scatter plot
2020-11-19 19:44:33 +01:00
066d6cedf4 Visualize asct per diagnosis per year
This adds ggplots to visualize the number of ascts per diagnosis per
year in various methods:

* Histogram
* Density plot
* Frequency plot
* Scatter plot
2020-11-19 19:23:29 +01:00
e0faa24f40 Add basic histograms
This adds some basic histograms to show the distribution of age at
transplatation and year of transplatation.
2020-11-19 19:21:52 +01:00
2175d46379 Change default aspect ratio for graphs
This adds a 4:3 default aspect ratio.
2020-11-19 16:20:20 +01:00
4762523c20 Add optional width and height arguments save plots
Sometimes the graphs must have a special size. This adds optional
arguments for width and height.
2020-11-19 16:14:21 +01:00
30c03f01d0 Remove unused factor levels from data after limiting
After limiting the data there may be factors with empty levels. This can
be confusing and should be avoided.
2020-11-19 13:16:34 +01:00
d96e3c5ed8 utils: Move library() calls to beginning of file
It seems that calling library() within a function may fail silently.
Moving them out of the function at the beginning of utils.R fixes this.
One particular place, where all necessary libraries are loaded, seem to
be a much easier way than inside a function.
2020-11-18 10:26:45 +01:00
792b42373e Merge branch 'data'
* data:
  Use data from repository
  Add data to repository
2020-11-17 19:50:01 +01:00
2a67cecf0a Use data from repository
Starting with this commit, all calculation will base on data/data.csv.
2020-11-17 19:49:22 +01:00
6d99d0a825 Add data to repository
Add the study data into repository.
2020-11-17 19:49:08 +01:00
27942f784a secmal: Fix median survival line warning
Median survival lines are not allowed with "cumhaz" function in
ggsurvplot().
2020-11-17 19:45:18 +01:00
6c4f717793 Merge branch 'secmal'
* secmal:
  Rename plot_survival.R
  Add secondary malignancy plots
  Introduce initialization function
2020-11-17 18:22:18 +01:00
08f9ddfc23 Rename plot_survival.R
This scripts is now used to create all plots in this project.
2020-11-17 18:21:54 +01:00
fcd2d330aa Add secondary malignancy plots
This adds some plots to show data for the secondary malignacies.
2020-11-17 18:21:54 +01:00
5e7b6007f1 Introduce initialization function
sma_init() can now be used to load all libraries and the data.
It is safe to call sma_init() multiple times. To forcefully reload the
data call sma_init_force().
2020-11-17 18:17:40 +01:00
a6b5292890 Update README.md
Add a much more precise description how this repo can be used.
2020-11-17 18:16:57 +01:00
57165dd6d1 Merge branch 'limit-data'
* limit-data:
  utils: Filter all hematologic patients
  utils: Filter patient by age
2020-11-17 15:20:21 +01:00
5c26e4100e Merge branch 'plots-per-dx'
* plots-per-dx:
  survival: Add plots per diagnosis
2020-11-17 15:20:15 +01:00
b81756310b utils: Filter all hematologic patients
At this time only solid tumors are important. This is a hard coded
switch, not very useful. But it get the job done and we can decide later
how this can be made better.
2020-11-17 15:12:58 +01:00
c68e536861 utils: Filter patient by age
The minimum age for this study is 16.0 years or older at time of
transplantation.
2020-11-17 15:05:31 +01:00
95be046985 survival: Add plots per diagnosis
This adds survival curves per diagnosis. They still look a bit
overloaded.
2020-11-17 14:33:56 +01:00
3c160c37bb Set global break.time.by value for ggsurvplot
Substitute manual "break.time.by" values with global which can be used
by all plots.
2020-11-17 14:32:59 +01:00
c087b40f5c Merge branch 'survminer'
* survminer:
  survival: Improve plots
  survival: Change plot function to ggsurvplot
2020-11-17 14:04:07 +01:00
c0c890c78c survival: Improve plots
Display a risk table, median survival line and adjust theme.
2020-11-17 13:28:06 +01:00
12ffcd4e38 survival: Change plot function to ggsurvplot
This will create the plot using the ggsurvplot from "survminer" package.
survminer user ggplot for plotting and comes with some powerful and nice
looking features.
2020-11-17 12:58:51 +01:00
b5634b7f8f survival: Remove excessive newlines 2020-11-16 22:52:14 +01:00
e1c6279119 Merge branch 'plot-functions'
* plot-functions:
  Add plot_survival.R
  survival: Create functions for plots
2020-11-16 22:49:52 +01:00
d6a77d6ebf Add plot_survival.R
This helper script can be run from commandline to create the survival
plots.
2020-11-16 22:40:28 +01:00
c3fecc1bf0 survival: Create functions for plots
Each plot has now its own function. This makes it easier to adjust the
creation and tweaking of a single plot. sma_plot_file() will now call
the individual plot function before saveing the plot.
2020-11-16 22:38:07 +01:00
3dce8a4ea6 Merge branch 'load-function'
* load-function:
  README: List tidyverse as used package
  survival: Use new data load function
  utils: Add sma_load_data()
2020-11-16 12:40:26 +01:00
d87d3143c2 README: List tidyverse as used package
Add 'tidyverse' to used package list in README.
2020-11-16 12:37:41 +01:00
27579452c3 survival: Use new data load function
Load the data with the new introduced function sma_load_data().
2020-11-16 12:27:35 +01:00
f919a31527 utils: Add sma_load_data()
This function loads the data and adjust some wrong column types. It
shoulb be used from all other scripts to load the data. It the same
source data for all following calculations.
The data is stored inside a 'tibble' from the 'tidyverse' package.
2020-11-16 12:24:20 +01:00
fdd17c0c71 Merge branch 'plot-function'
* plot-function:
  utils: Hide garbage output from dev.off()
  survival: Replace manual plotting with sma_plot_file
  Introduce plot to file function
2020-11-03 16:57:42 +01:00
815731cbcf utils: Hide garbage output from dev.off()
dev.off() prints not usefull messages like "null device 1" when
finishing. This supresses these messages.
2020-11-03 16:55:29 +01:00
439810a544 survival: Replace manual plotting with sma_plot_file
Replace the manual plotting definitions with the new function to reduce
repitition.
2020-10-22 18:46:30 +02:00
a8c4b327a0 Introduce plot to file function
sma_plot_file(fname, ftype, title_list, legend_list, fun, ...)
can be used to write plot to a file.
It supports all output filetypes R can handle. Title and legend
arguments can be passed as lists.
All available plotting functions can be used, arguments go into a
variable argument list.
2020-10-22 18:29:13 +02:00
fffd300955 .gitignore: Add csv files
Ignore all csv files.
2020-10-22 16:41:51 +02:00
42aec82e36 survival: Change scaling to days per year
The base data was changed from month to years for more precision.
Therefor the scaling of the graphs must be adjusted to days per year
instead of month per year.
2020-10-22 16:38:39 +02:00