Skip to contents

Calculate centroids

Usage

calculate_centroids(
  newick_df,
  coordinates_df_scaled,
  n_repeats,
  origin_coord,
  origin_name
)

Arguments

newick_df

A `data.frame` containing the reformatted Newick phylogenetic tree information.

coordinates_df_scaled

A `data.frame` containing scaled spot coordinates and the barcodes that they correspond to.

n_repeats

Roughly, how many layers of internal nodes there are in the phylogenetic tree. Defaults to `10`. Consider increasing if you notice missing connections, otherwise leave as is.

origin_coord

xy coordinates at which to plot the "origin" of the phylogenetic tree. Defaults to `NA`. Example: `c(0,1)` for top left corner.

origin_name

Name of the origin clone in the phylogenetic tree. Defaults to `"diploid"` in line with MEDICC2 output.

Value

A `data.frame` with centroids calculated for each clone in the phylogenetic tree.