Plot the heatmaps of REVOLVER"s clusters, as tiles.

The top tile is patients vs trajectories, and bottom is patients vs drivers. For drivers colours reflect mean CCF/ binary values of a driver in every patient, and clonality status. For trajectories colours reflect if they are initiating or progressing, depending on the present of GL in the trajectory.

Patients are sorted by cluster to match the dendrogram that one can obtain with plot_dendrogram.

plot_clusters(
  x,
  cluster_palette = distinct_palette_few,
  cutoff_drivers = 5,
  cutoff_trajectories = 4,
  arrow.symbol = " → "
)

Arguments

x

A REVOLVER object with fits and clusters.

cutoff_drivers

Plot only drivers that occur in at least cutoff_drivers patients.

cutoff_trajectories

Plot only trajectories that occur in at least cutoff_trajectories patients.

arrow.symbol

UNICODE code to display arrows. Saving to PDF outputs with standard methods (ggsave, cairo, etc), often can lead to errors with UNICODE chars; therefore either print to PNG or change this variable to, e.g., " --> " to render arrows properly.

clusters_palette

A palette function that should return the colour of an arbitrary number of clusters.

Value

A ggplot plot.

See also

Examples

# Data released in the 'evoverse.datasets' data('TRACERx_NEJM_2017_REVOLVER', package = 'evoverse.datasets') plot_clusters(TRACERx_NEJM_2017_REVOLVER)
#> Warning: Vectorized input to `element_text()` is not officially supported. #> Results may be unexpected or may change in future versions of ggplot2.
plot_clusters(TRACERx_NEJM_2017_REVOLVER, cutoff_drivers = 10, cutoff_trajectories = 3)
#> Warning: Vectorized input to `element_text()` is not officially supported. #> Results may be unexpected or may change in future versions of ggplot2.