R/genome_relevant_functions.R
synth_sc_tree_founder_genomes.RdSynthesizes founder genomes for each clone in a cell lineage tree by traversing the tree from root to leaves, incorporating appropriate mutations and structural variants at each step.
synth_sc_tree_founder_genomes(
tree,
root_genome,
seg_list,
mutation_info,
cell_info
)An igraph object representing the cell lineage tree with vertices as clone types
List containing the genome sequences for the root clone
List structure containing segment information for all clones
Data frame containing mutation details for all cells
Data frame containing cell lineage information
A list containing four elements:
all_node_genomes: List of genome sequences for each clone in the tree
child_node_founders_df: Data frame containing information about the founder cells for each clone
child_node_founder_mutations: List of all mutations in founder cells, organized by clone
child_node_founder_mutations_filtered: List of mutations that occurred between parent and child nodes
The function builds genomes sequentially following the evolutionary relationships defined in the tree structure, ensuring that each clone's genome properly inherits all modifications from its ancestors plus its unique changes.
if (FALSE) { # \dontrun{
# Assuming you have a cell lineage tree and other required objects
founder_genomes <- synth_sc_tree_founder_genomes(
tree = clone_tree,
root_genome = reference_genome,
seg_list = all_segments,
mutation_info = mutations,
cell_info = cell_lineage
)} # }