Converts clustered cytoband annotations into genomic segments by identifying the spanning regions for each cluster. Creates segments for both maternal and paternal haplotypes with additional metadata for downstream analysis.

sub_seg_from_cytoband_anno(cluster_anno)

Arguments

cluster_anno

A nested list containing cytoband annotations organized by haplotype (maternal/paternal), chromosome, and cluster. Each cluster contains a data frame of cytoband information including chromStart and chromEnd positions.

Value

A list with two elements (maternal and paternal), each containing a data frame of genomic segments with the following columns:

  • chrom: Chromosome name

  • start: Starting position of the segment

  • end: Ending position of the segment

  • region_name: Unique identifier (format: "sub_haplotype_chrom_clusterIndex")

  • haplotype: Maternal or paternal

  • ref_start: Reference start position

  • ref_end: Reference end position

  • ori_start: Original start position

  • ori_end: Original end position

  • copy_index: Copy number index (initialized to 0)

  • seg_id: Segment identifier (initialized to 0)

  • CN_change: Copy number change (initialized to 0)

  • seg_source_edge: Source edge info (initialized to "root")

  • seg_source_event: Source event info (initialized to "base")

Details

For each cluster in the input annotations, the function:

  1. Identifies the minimum start and maximum end positions of all cytobands

  2. Creates a unique region name using haplotype, chromosome, and cluster index

  3. Initializes metadata fields for downstream analysis

  4. Combines all segments into haplotype-specific data frames

The resulting segments serve as a baseline for further genomic analyses, with fields prepared for tracking copy number changes and segment evolution.

See also

Related functions for genomic segment analysis and manipulation

Examples

if (FALSE) { # \dontrun{
# Assuming cluster_anno is already defined:
segments <- sub_seg_from_cytoband_anno(cluster_anno)

# Access maternal segments:
maternal_segs <- segments[["maternal"]]
} # }