plot_umap: Plot a UMAP from a musica result

View source: R/umap.R

plot_umapR Documentation

Plot a UMAP from a musica result

Description

Plots samples on a UMAP scatterplot. Samples can be colored by the levels of mutational signatures or by a annotation variable.

Usage

plot_umap(
  result,
  color_by = c("signatures", "annotation", "cluster", "none"),
  proportional = TRUE,
  annotation = NULL,
  point_size = 0.7,
  same_scale = TRUE,
  add_annotation_labels = FALSE,
  annotation_label_size = 3,
  annotation_text_box = TRUE,
  plotly = FALSE,
  clust = NULL,
  legend = TRUE,
  strip_axes = FALSE
)

Arguments

result

A musica_result object generated by a mutational discovery or prediction tool.

color_by

One of "signatures", "annotation", or "none". If "signatures", then one UMAP scatterplot will be generated for each signature and points will be colored by the level of that signature in each sample. If annotation, a single UMAP will be generated colored by the annotation selected using the parameter annotation. If "none", a single UMAP scatterplot will be generated with no coloring. Default "signature".

proportional

If TRUE, then the exposures will be normalized to between 0 and 1 by dividing by the total number of counts for each sample. Default TRUE.

annotation

Sample annotation used to color the points. One used when color_by = "annotation". Default NULL.

point_size

Scatter plot point size. Default 0.7.

same_scale

If TRUE, then all points will share the same color scale in each signature subplot. If FALSE, then each signature subplot will be colored by a different scale with different maximum values. Only used when color_by = "signature". Setting to FALSE is most useful when the maximum value of various signatures are vastly different from one another. Default TRUE.

add_annotation_labels

If TRUE, labels for each group in the annotation variable will be displayed. Only used if color_by = "annotation". This not recommended if the annotation is a continuous variable. The label is plotting using the centriod of each group within the annotation variable. Default FALSE.

annotation_label_size

Size of annotation labels. Only used if color_by = "annotation" and add_annotation_labels = TRUE. Default 3.

annotation_text_box

Place a white box around the annotation labels to improve readability. Only used if color_by = "annotation" and add_annotation_labels = TRUE. Default TRUE.

plotly

If TRUE, the the plot will be made interactive using plotly. Not used if color_by = "signature" and same_scale = FALSE. Default FALSE.

clust

Add cluster labels as annotation

legend

Plot legend

strip_axes

Remove axes labels for cleaner looking plots

Value

Generates a ggplot or plotly object

See Also

See create_umap to generate a UMAP in a musica result.

Examples

data(res_annot)
create_umap(res_annot, "Tumor_Subtypes")
plot_umap(res_annot, "none")

campbio/musicatk documentation built on July 14, 2024, 8:28 a.m.