R/snv_relevant_functions.R
get_segment_info.RdIdentifies and returns the genomic segment that contains a specific mutation, handling both regular segments and segments that have been lost through deletions.
get_segment_info(seg_list, mutation, in_loss_segment)List structure containing segment information for different clones and haplotypes
Data frame row containing information about a single mutation, with columns: clone, haplotype, chrom, pos
Logical indicating whether the mutation is in a segment that has been lost through deletion
A data frame row containing the segment information for the mutation, or NULL if no matching segment is found
This function locates the appropriate genomic segment for a mutation by:
Extracting relevant information (haplotype, chromosome, clone, position) from the mutation
Using different search criteria based on whether the segment is lost:
For lost segments: Matches chromosome and original coordinates (ori_start/ori_end) where CN_change is -1 and current coordinates (start/end) are NA
For normal segments: Matches chromosome and current coordinates (start/end)
Returns NULL if no matching segment is found
This function is primarily used by simulate_single_nt_change() to map mutations to their genomic context before simulating nucleotide changes.