R/snv_relevant_functions.R
process_recurrent_mutation.RdUpdates a tracker structure that organizes and monitors recurrent mutations across different lineages, categorizing them as identical, inclusive, or branching.
process_recurrent_mutation(mutation, mutation_key, tracker)Data frame containing information about a specific set of recurrent mutations at the same genomic location
Character string uniquely identifying the genomic location of the mutation (typically in format "haplotype_chromosome_position")
List structure that tracks recurrent mutations by organizing them into sets based on their occurrence patterns
Updated tracker list with the mutation properly categorized and stored
This function processes recurrent mutations by comparing them to existing mutation sets in a tracker. It handles three scenarios:
If the mutation set already exists and is identical, it returns the tracker unchanged.
If the mutation set is a superset of an existing set, it updates the existing set with new mutations.
If the mutation set is distinct from existing sets, it creates a new branch in the tracker.
The function prints the relationship category for debugging and monitoring purposes.