input_tree_df: Process a dataframe of mutation trees and output a TreeMHN...

View source: R/input_output.R

input_tree_dfR Documentation

Process a dataframe of mutation trees and output a TreeMHN object

Description

This function processes a dataframe of mutation trees and output a TreeMHN object.

Usage

input_tree_df(
  n,
  tree_df,
  patients = NULL,
  tree_labels = NULL,
  mutations = NULL,
  weights = NULL
)

Arguments

n

Number of mutational events.

tree_df

A data frame with the following columns:

  • Patient_ID: IDs of patients, unique for each patient

  • Tree_ID: IDs of mutation trees, unique for each tree

  • Node_ID: IDs of each node in the tree, including the root node (with ID "1"), unique for each node

  • Mutation_ID: IDs of each mutational event, the root node has a mutation ID of "0", other mutation IDs can be duplicated in the tree to allow for parallel mutations

  • Parent_ID: IDs of the parent node ID. The root node has itself as parent (ID "1").

patients

A list of patient labels, which must be unique values. If no labels are given, then the patient IDs will be used.

tree_labels

A list of tree labels, which must be unique values. If no labels are given, then the tree IDs will be used.

mutations

A list of mutation names, which must be unique values. If no names are given, then the mutation IDs will be used.

weights

Weights of the trees. If no values are given, weights are assigned equally to the trees such that each patient has a weight of 1.

Value

A TreeMHN object

Author(s)

Xiang Ge Luo


cbg-ethz/TreeMHN documentation built on Jan. 29, 2024, 1:29 p.m.