dot-plot_survival: Fit/Plot survival

fit_survivalR Documentation

Fit/Plot survival

Description

Fit/Plot survival

Usage

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
)

Arguments

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

Value

ggsurvplot

Examples

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, ])
}

bhagwataditya/importomics documentation built on April 20, 2024, 11:19 p.m.