Skip to contents

Creates a circular genome plot using circlize showing DMRs with multiple tracks: ideogram track with chromosome bands, DMR arcs colored by delta beta, beta value heatmaps for each sample, and motif-based interaction links between DMRs.

Usage

plotDMRsCircos(
  dmrs,
  beta = NULL,
  pheno = NULL,
  genome = "hg38",
  array = "450K",
  sorted_locs = NULL,
  components = NULL,
  interactions = NULL,
  sample_group_col = "Sample_Group",
  min_similarity = 0.8,
  motif_site_flank_size = 5,
  max_num_samples_per_group = 5,
  max_dmrs_per_chr = 10,
  max_sites_per_dmr = 5,
  min_component_size = 2,
  max_components = 30,
  chromosomes = NULL,
  region = NULL,
  query_components_with_jaspar = TRUE,
  unmatched_interaction_color = "#B3B3B3",
  group_colors = NULL,
  low_beta_color = "#2b83ba",
  mid_beta_color = "#f7f7f7",
  high_beta_color = "#d7191c",
  neg_delta_color = "#055709",
  zero_delta_color = "#f0ec10",
  pos_delta_color = "#801414",
  legend_width_ratio = 0.34,
  degenerate_resolution = 1e+06,
  output_file = NULL,
  verbose = NULL
)

Arguments

dmrs

GRanges object or data frame. DMR results from buildDMRs.

beta

BetaHandler object, character path to beta file, or beta values matrix. If not provided, beta heatmap track will be omitted.

pheno

Data frame or character path to phenotype file. Sample information with rownames matching beta column names (required for beta track, if not provided beta track will not be shown).

genome

Character. Genome version (e.g., "hg38").

array

Character. Array platform type (default: "450K"). Ignored if sorted_locs is provided.

sorted_locs

Data frame. Genomic locations sorted by position (optional). If NULL, will be fetched based on array and genome.

components

Data frame. Output from motif component detection (optional, will be computed if missing).

interactions

Data frame. Output from motif interaction detection (optional, will be computed if missing).

sample_group_col

Character. Column in pheno for sample grouping (default: "Sample_Group").

min_similarity

Numeric. Minimum motifs PWM similarity threshold for considering DMRs are related (default: 0.8).

motif_site_flank_size

Integer. Flanking region size for motif extraction in bp (default: 5).

max_num_samples_per_group

Integer. Maximum number of samples to show per group in heatmap (default: 5).

max_dmrs_per_chr

Integer. Maximum number of DMRs to use per chromosome (default: 10). The DMRs with highest absolute delta beta will be selected.

max_sites_per_dmr

Integer. Maximum number of sites to show per DMR in scatter/heatmap (default: 5).

min_component_size

Integer. Minimum motif component size to retain (default: 2).

max_components

Integer. Maximum number of interactions to plot (default: 30).

chromosomes

Character vector. Subset of chromosomes to display (default: NULL, show all available).

region

Genomic region to display. Can be NULL, a GRanges, a string in the form chr:start-end, or a data.frame/list with columns chr, start, end.

query_components_with_jaspar

Logical. Whether computed motif components should be queried against JASPAR before plotting (default: TRUE). Set to FALSE to keep link computation cheaper.

unmatched_interaction_color

Character. Color used for interaction components without JASPAR matches. These links are shown but omitted from the interaction legend (default: "#B3B3B3").

group_colors

Named character vector of colors for sample groups labels in the beta values track (names should match unique values in pheno[[sample_group_col]]). If not provided, default colors will be used.

low_beta_color

Character. Color for low beta values in the heatmap (default: "#2b83ba").

mid_beta_color

Character. Color for mid beta values in the heatmap (default: "#f7f7f7").

high_beta_color

Character. Color for high beta values in the heatmap (default: "#d7191c").

neg_delta_color

Character. Color for negative delta beta values in the DMR arcs (default: "#055709").

zero_delta_color

Character. Color for zero delta beta values in the DMR arcs (default: "#f7f7f7").

pos_delta_color

Character. Color for positive delta beta values in the DMR arcs (default: "#801414").

legend_width_ratio

Numeric. Fraction of horizontal canvas reserved for legends (default: 0.34).

degenerate_resolution

Integer. Resolution in base pairs for simplifying narrow glyphs: link ribbons are drawn as lines when both anchors are below this span, and DMR arcs are drawn as lines instead of rectangles below this span (default: 1e6).

output_file

Character or NULL. Optional PDF path for the plot.

verbose

Numeric. Optional verbosity override.

Value

NULL invisibly after drawing the plot.

Examples

dmrs <- readRDS(system.file(
    "extdata", "example_outputChr5And11.rds", package = "CMEnt"
))
# \donttest{
if (interactive()) {
    plotDMRsCircos(dmrs, beta = "beta.txt", pheno = pheno_df)
    plotDMRsCircos(dmrs, beta = "beta.txt", pheno = pheno_df, genome = "hg38")
}
# }