R/pattern_extraction.R
create_cluster_cytoband_anno.RdMaps clustered genomic regions to their corresponding cytoband annotations for both maternal and paternal haplotypes. For each cluster of regions, the function collects and combines the cytoband annotations of all regions within that cluster.
create_cluster_cytoband_anno(region_clusters, cytoband_mapping)A nested list structure containing clustered genomic regions. The list is organized by haplotype ("maternal"/"paternal"), then by chromosome, then by cluster number, containing region IDs as the innermost elements.
A list containing cytoband annotations for each genomic region. Each element should be named with a region ID corresponding to those in region_clusters.
A nested list with the same structure as region_clusters, where each cluster contains a data frame of unique cytoband annotations. The structure is: list[haplotype][chromosome][cluster] -> data frame of cytoband annotations
The function processes clusters by:
Iterating through haplotypes (maternal/paternal)
For each chromosome in each haplotype
For each cluster in each chromosome
Retrieving and combining cytoband annotations for all regions in the cluster
Removing duplicate annotations using unique()
Related functions for genomic region analysis and cytoband mapping
if (FALSE) { # \dontrun{
# Assuming region_clusters and cytoband_mapping are already defined:
cluster_annotations <- create_cluster_cytoband_anno(
region_clusters = region_clusters,
cytoband_mapping = cytoband_mapping
)
# Access annotations for a specific cluster:
maternal_chr1_cluster1 <- cluster_annotations[["maternal"]][["chr1"]][[1]]
} # }