Skip to contents

Create a scatter plot of PCoA coordinates from perform_pcoa(), with points sized by the number of non-zero comparisons and colored by Euclidean rewiring magnitude. The top n_label isodecoders are labeled with ggrepel::geom_text_repel().

Usage

plot_pcoa_rewiring(
  pcoa_result,
  rewiring_scores,
  title = "PCoA of tRNA rewiring",
  n_label = 10
)

Arguments

pcoa_result

A list from perform_pcoa() with elements coordinates and variance_explained.

rewiring_scores

A tibble from calculate_rewiring_scores() with at least isodecoder, euclidean_magnitude, and n_nonzero columns.

title

Plot title. Default "PCoA of tRNA rewiring".

n_label

Number of top isodecoders to label. Default 10.

Value

A ggplot object.

Examples

if (FALSE) { # \dontrun{
mat <- prepare_rewiring_matrix(ror_data)
scores <- calculate_rewiring_scores(mat)
pcoa <- perform_pcoa(mat)
plot_pcoa_rewiring(pcoa, scores)
} # }