This function builds a clone tree using the medicc2 tool. The function takes care of input file preparation from CONGAS* results, running medicc2, cleaning up input files after execution, and plotting the tree using the ggtree package.

build_clone_tree(
  x,
  medicc_path = NULL,
  result_dir = "./medicc_results",
  input_dir = "./medicc_input",
  clean_inputs = TRUE,
  plot = TRUE
)

Arguments

x

A CONGAS+ object with a valid fit.

medicc_path

The file path of the medicc2 executable. If not supplied, the function will attempt to find it in the system path.

result_dir

The directory to save the results of medicc2. Defaults to "./medicc_results".

input_dir

The directory where input files for medicc2 will be saved. Defaults to "./medicc_input".

clean_inputs

Logical, should the function delete the input files after the execution of medicc2? Defaults to TRUE.

plot

Logical, should the function plot the resulting tree? Defaults to TRUE.

Value

A list containing the newick tree (tree) and the plot (plot) if plot is set to TRUE.

Examples

if (FALSE) {
build_clone_tree(x, medicc_path = "/path/to/medicc2")
}