20 Commits

Author SHA1 Message Date
c012fc65fe plots: Change color palette
Change color palette to "lancet".
2021-01-18 01:58:03 +01:00
48be520bb0 secmal: Plot competing risk for SM
Plot competing risk plot for probability of SM and death as competing
risk.
2021-01-17 18:52:06 +01:00
3e263bb400 utils: Condense Ewing sarcoma
Condense Ewing Sarcoma with Ewing Sarcoma / PNET due to a inconsistency
in data mining.
2021-01-17 11:33:41 +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
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
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
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
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
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
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
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
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
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
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
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