Skip to contents

Build, annotate and plot a Phylogenetic Tree from a seurat Object containing the CNV results from fastCNV()

Usage

CNVTree(
  seuratObj,
  healthyClusters = NULL,
  values = "scores",
  cnv_thresh = 0.15,
  tree_function = nj,
  dist_method = "euclidean",
  clone_cols = TRUE
)

Arguments

seuratObj

A Seurat object containing CNV data and metadata.

healthyClusters

A numeric vector or NULL. If provided, clusters specified in this vector will be labeled as "Benign" instead of "Clone". Default is NULL.

values

one of 'scores' or 'calls'. 'scores' returns the mean CNV score per cluster, while 'calls' uses cnv_thresh to establish a cut-off for gains and losses, returning a matrix of CNV calls (0=none, 1=gain, -1=loss).

cnv_thresh

A numeric threshold to filter significant CNV events. Default is 0.15.

tree_function

A function to construct the phylogenetic tree from a distance matrix. The default is nj (Neighbor-Joining). Other functions (e.g., upgma, wpgma) can also be used.

dist_method

The distance method to be used.

clone_cols

a color palette to color the clones. If NULL, points are not colored. If TRUE, clones are colored using default color palette. If a palette is given, clones are colored following the palette, with values passed to scale_color_manual.