Creates a table of chromosome segments dividing each chromosome into p (short arm), c (centromere), and q (long arm) regions. Each segment is initialized with base state properties including positions, copy numbers, and source information.

initiate_seg_table(chr_lengths, chr_names, centromere_length, haplotype)

Arguments

chr_lengths

A list containing chromosome lengths for a specific haplotype

chr_names

A vector of chromosome names (e.g., c("chr1", "chr2", "chr3"))

centromere_length

The length of the centromere region

haplotype

Character string specifying the haplotype ("maternal" or "paternal")

Value

A data frame containing segment information with columns:

  • haplotype: Origin of the segment (maternal/paternal)

  • chrom: Chromosome identifier

  • ref_start, ref_end: Reference coordinates

  • ori_start, ori_end: Original coordinates

  • start, end: Current coordinates

  • region_name: Region identifier (e.g., chr1p, chr1c, chr1q)

  • copy_index: Copy number index

  • seg_id: Unique segment identifier

  • CN_change: Copy number change status

  • seg_source_edge: Source edge information

  • seg_source_event: Source event information

Examples

chr_lengths <- list(maternal = c(100, 200, 300))
chr_names <- c("chr1", "chr2", "chr3")
centromere_length <- 10
seg_table <- initiate_seg_table(chr_lengths, chr_names, centromere_length, "maternal")
#> Warning: restarting interrupted promise evaluation
#> Warning: internal error -3 in R_decompress1
#> Error: lazy-load database '/Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/library/cancerSimCraft/R/cancerSimCraft.rdb' is corrupt