plot_penalty: Plot the fit penalty.

View source: R/plot_penalty.R

plot_penaltyR Documentation

Plot the fit penalty.

Description

Plot the fit penalty as a barplot, for each one of a set of desired driver events, where the bar represents the counts of each trajectory in the data. This function allows also to filter out entries that have been seen below a predetermined cutoff, and tests for significance in the association A -> B via a one-sided Fisher 2x2 test adjusted for the number of comparison (marginal count of B-ended trajectories). The tests are carried out by function revolver:::enrichment_test_incoming_edge, which can be used to obtain a tidy representation of the tests' results.

Usage

plot_penalty(
  x,
  drivers = x$variantIDs.driver,
  min.occurrences = 0,
  alpha_level = 0.05,
  drivers_palette = distinct_palette_many
)

Arguments

x

A REVOLVER object with fits.

drivers

The list of drivers to use; by default all of them. If the entry is a subset of the actual list of all drivers, all the entries in the penalty data structure x$fit$penalty will be used if they involve at least one event from drivers.

min.occurrences

The penalty data structure will be filtered for count values above this threshold.

alpha_level

The significance level for the enrichment Fisher test.

drivers_palette

A function that can return, for an input number, a number of colours.

Value

A ggplot object for this plot.

Examples

# Data released in the 'evoverse.datasets'
data('TRACERx_NEJM_2017_REVOLVER', package = 'evoverse.datasets')
 
plot_penalty(TRACERx_NEJM_2017_REVOLVER)

plot_penalty(TRACERx_NEJM_2017_REVOLVER, min.occurrences = 5)

plot_penalty(TRACERx_NEJM_2017_REVOLVER, min.occurrences = 5, alpha_level = 0.001)

caravagn/revolver documentation built on May 21, 2022, 5:48 p.m.