Skip to contents

Selects a small set of informative genomic windows from the input DMRs and forwards them to plotDMRsCircos(). The default blocks mode prefers localized high-scoring DMR blocks when block_id is available, while quick mode falls back to top-scoring individual DMR windows. Both selectors are greedy and avoid exhaustive optimization to keep region finding inexpensive.

Usage

plotAutoDMRsCircos(
  dmrs,
  beta,
  pheno,
  method = c("blocks", "components", "hybrid", "quick"),
  n_regions = 6,
  region_flank_bp = 1e+06,
  max_regions_per_chr = 2,
  min_inter_region_bp = 5e+06,
  genome = "hg38",
  array = "450K",
  sorted_locs = NULL,
  components = NULL,
  interactions = NULL,
  min_similarity = 0.8,
  motif_site_flank_size = 5,
  min_component_size = 2,
  chromosomes = NULL,
  query_components_with_jaspar = TRUE,
  ...
)

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).

method

Character. Automatic region selection mode: "blocks" (default), "components", "hybrid", or "quick".

n_regions

Integer. Target maximum number of regions to show (default: 6).

region_flank_bp

Numeric. Flank in base pairs added around each selected block or DMR before plotting (default: 1e6).

max_regions_per_chr

Integer or NULL. Per-chromosome cap on automatically selected regions (default: 2).

min_inter_region_bp

Numeric. Nearby candidate windows within this gap are merged instead of being shown as separate Circos sectors (default: 5e6).

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).

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).

min_component_size

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

chromosomes

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

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.

...

Additional arguments passed to plotDMRsCircos(). This is where plot-only settings such as max_dmrs_per_chr, max_sites_per_dmr, max_num_samples_per_group, max_components, unmatched_interaction_color, legend_width_ratio, degenerate_resolution, output_file, and verbose can be supplied. Arguments managed by automatic selection, including region, should not be passed through ....

Value

Invisibly returns the selected region data frame with columns chr, start, and end.

Examples

dmrs <- readRDS(system.file(
    "extdata", "example_outputChr5And11.rds", package = "CMEnt"
))
# \donttest{
if (interactive()) {
    plotAutoDMRsCircos(dmrs, beta = "beta.txt", pheno = pheno_df)
    plotAutoDMRsCircos(dmrs, beta = "beta.txt", pheno = pheno_df, method = "blocks")
    plotAutoDMRsCircos(dmrs, beta = "beta.txt", pheno = pheno_df, method = "components")
    plotAutoDMRsCircos(dmrs, beta = "beta.txt", pheno = pheno_df, method = "hybrid")
    plotAutoDMRsCircos(dmrs, beta = "beta.txt", pheno = pheno_df, method = "quick", n_regions = 4)
}
# }