fit_survival | R Documentation |
Fit/Plot survival
fit_survival(
object,
assay = assayNames(object)[1],
percentile = 25,
sep = FITSEP,
samples = if (ncol(object) < 50) TRUE else FALSE,
verbose = TRUE
)
.plot_survival(
object,
assay = assayNames(object)[1],
percentile = 25,
title = paste0(assay, " ", percentile, "%"),
subtitle = NULL,
palette = c("#009999", "#ff5050")
)
plot_survival(
object,
assay = assayNames(object)[1],
percentile = percentiles(object),
title = paste0(assay, " ", percentile, "%"),
subtitle = NULL,
palette = c("#009999", "#ff5050"),
n = 4,
ncol = 4,
nrow = length(percentile),
file = NULL,
width = 7 * ncol,
height = 7 * nrow
)
object |
SummarizedExperiment |
assay |
string |
percentile |
percentage (not greater than 50) |
sep |
fvar string separator : e.g. '~' gives p~surv~LR50 |
samples |
TRUE or FALSE : record which samples in which stratum ? |
verbose |
TRUE or FALSE |
title |
string |
subtitle |
string |
palette |
color vector |
n |
number |
ncol |
number |
nrow |
number |
file |
filepath |
width |
number |
height |
number |
ggsurvplot
file <- download_tcga_example()
if (!is.null(file) & requireNamespace('survminer')){
# Read
object <- readRDS(file)
object %<>% extract(, .$sample_type == 'T')
object %<>% extract(c('UGT3A2', 'NSUN3', 'XRCC4', 'WNT10A'), )
# Fit
fdt(object)
fdt(fit_survival(object))
fdt(fit_survival(object, percentile = 50))
fdt(fit_survival(object, percentile = 50, sep = '.'))
# Plot
object %<>% fit_survival()
plot_survival(object)
p1 <- .plot_survival(object[1, ])
p2 <- .plot_survival(object[2, ])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.