Skip to contents

Generates an interactive plot (HTML) of clustered CNV models, showing copy number profiles for Tier 1 models. The y-axis represents model IDs (clustered by CNV profile similarity), the x-axis shows genomic coordinates, and color indicates copy number (CN). Tooltip text provides model summary statistics.

Usage

PlotModelcluster(models, refined_calls, out_dir, prefix)

Arguments

models

Data frame of model likelihood results. Must include columns mu, rho, Tier1, and summary statistics (total_likelihood_cluster, diploid_distance_cluster, nondiploid_distance_cluster).

refined_calls

Data frame of segment calls. Must include columns Chromosome, Start, End, CN, mu, and rho.

out_dir

Character. Output directory for the HTML plot.

prefix

Character. Prefix for output file name.

Value

Invisibly returns TRUE if the plot was successfully created and saved, otherwise returns FALSE.

Details

The function filters for Tier 1 models, clusters them by CNV profile similarity, and generates an interactive heatmap using ggplot2 and plotly. The plot is saved as an HTML file in out_dir.

Examples

if (FALSE) { # \dontrun{
PlotModelcluster(
  models = models_df,
  refined_calls = calls_df,
  out_dir = "results/",
  prefix = "sample1"
)
} # }