| Title: | Query and Analyse the 'EWAS Atlas' Database |
| Version: | 0.2.0 |
| Description: | Provides a client for the 'EWAS Atlas' web services (https://ngdc.cncb.ac.cn/ewas/; Li et al. (2019) <doi:10.1093/nar/gky1027>), allowing users to query epigenome-wide association study (EWAS) data by CpG (cytosine-phosphate-guanine) probe identifier, gene symbol, or genomic region, and to run trait, Gene Ontology, KEGG (Kyoto Encyclopedia of Genes and Genomes) pathway, and genomic location enrichment analyses on a set of CpG probes. It also retrieves expression quantitative trait methylation (eQTM) associations, i.e. correlations between CpG methylation and gene expression in 'TCGA' (The Cancer Genome Atlas) tissue data. Query functions support concurrent, rate-limited requests to the remote service. Results are returned as tidy data frames with dedicated summary and customizable plotting methods, including word clouds of enriched 'EWAS Atlas' trait terms and eQTM heatmap, volcano, and scatter plots. |
| License: | MIT + file LICENSE |
| URL: | https://github.com/SAADAT-Abu/EWAScaller |
| BugReports: | https://github.com/SAADAT-Abu/EWAScaller/issues |
| Depends: | R (≥ 4.1.0) |
| Imports: | httr, jsonlite, digest, parallel, ggplot2, ggwordcloud, stats, utils |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown |
| Encoding: | UTF-8 |
| Config/testthat/edition: | 3 |
| VignetteBuilder: | knitr |
| LazyData: | true |
| Config/roxygen2/version: | 8.1.1 |
| NeedsCompilation: | no |
| Packaged: | 2026-11-24 10:32:54 UTC; saadat |
| Author: | Saadat Abu [aut, cre] |
| Maintainer: | Saadat Abu <saadatabu1996@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-11-24 16:00:22 UTC |
EWAScaller: Query and Analyse the EWAS Atlas Database
Description
Tools to query the EWAS Atlas (https://ngdc.cncb.ac.cn/ewas/) by CpG probe, gene symbol, or genomic region, and to run enrichment analyses on probe sets. Query functions dispatch requests concurrently across a small worker pool with configurable pacing to stay within reasonable request rates. Results are returned as tidy data frames with summary and plotting helpers, including trait-term word clouds.
Main functions
-
query_cpg(),query_gene(),query_region()– retrieve probe-trait associations from the EWAS Atlas. -
ewas_enrichment()– run trait, gene ontology, KEGG pathway, or genomic location enrichment on a probe set. -
ewas_eqtm(),eqtm_samples()– find CpG-gene expression quantitative trait methylation (eQTM) pairs and their per-sample data. -
plot_wordcloud(),autoplot.ewas_result(),autoplot.ewas_enrichment(),autoplot.ewas_eqtm()– visualise results.
Author(s)
Maintainer: Saadat Abu saadatabu1996@gmail.com
Authors:
Saadat Abu saadatabu1996@gmail.com
See Also
Useful links:
Report bugs at https://github.com/SAADAT-Abu/EWAScaller/issues
Plot an EWAS Atlas enrichment result
Description
Draws the top enriched terms of one analysis, either as a dot plot
(mirroring the EWAS Atlas toolkit chart: position given by -log10(p),
point size by the differentially-methylated CpG/gene count) or as a bar
chart of -log10(p).
Usage
## S3 method for class 'ewas_enrichment'
autoplot(
object,
type = "trait",
top_n = 20L,
style = c("dot", "bar"),
colors = NULL,
title = NULL,
subtitle = NULL,
base_size = 11,
theme = ggplot2::theme_minimal,
wrap = 40,
...
)
Arguments
object |
An ewas_enrichment object. |
type |
Which analysis result to plot (default |
top_n |
Number of top terms to display. |
style |
|
colors |
Colour of the points or bars (first element used). |
title, subtitle |
Plot title and subtitle. |
base_size |
Base font size passed to |
theme |
A ggplot2 theme function such as |
wrap |
Wrap long category labels at this many characters; |
... |
Unused. |
Value
A ggplot object.
Plot an EWAS Atlas eQTM result
Description
Visualises CpG-gene expression correlations from ewas_eqtm():
"heatmap"CpG probes against genes, coloured by correlation, one panel per tissue.
"volcano"Correlation against
-log10(p)for every pair, coloured by tissue, with the strongest pairs labelled."tissue"Number of pairs per tissue, split into negative and positive correlations.
"scatter"Per-sample methylation against expression for one pair (chosen with
probe,gene, andtissue). This downloads the sample data witheqtm_samples(), so it needs internet access.
Usage
## S3 method for class 'ewas_eqtm'
autoplot(
object,
type = c("heatmap", "volcano", "tissue", "scatter"),
tissue = NULL,
top_n = 30L,
label_top = 5L,
probe = NULL,
gene = NULL,
colors = NULL,
title = NULL,
subtitle = NULL,
base_size = 11,
theme = ggplot2::theme_minimal,
wrap = 40,
...
)
Arguments
object |
An ewas_eqtm object. |
type |
One of |
tissue |
Optional character vector of tissues to keep. Required for
|
top_n |
For |
label_top |
For |
probe, gene |
For |
colors |
Colours to use. |
title, subtitle |
Plot title and subtitle. |
base_size |
Base font size passed to |
theme |
A ggplot2 theme function such as |
wrap |
Wrap long category labels at this many characters; |
... |
Unused. |
Value
A ggplot object.
Examples
probes <- c(
"cg05575921", "cg00240195", "cg16419584", "cg11903855", "cg21566642",
"cg23771366", "cg19859270", "cg00382138", "cg25648203", "cg01940273",
"cg23576855", "cg00401753", "cg00300637", "cg12803068", "cg09935388",
"cg01899089", "cg04180046", "cg00050873", "cg02228185", "cg18147296"
)
eq <- ewas_eqtm(probes, background = "850K")
autoplot(eq, type = "heatmap")
autoplot(eq, type = "volcano", theme = ggplot2::theme_bw, base_size = 14)
autoplot(eq, type = "scatter", probe = "cg05575921", gene = "AHRR", tissue = "brain")
Plot summary statistics for an EWAS Atlas query result
Description
All EWAScaller plots return ordinary ggplot objects, so they can be
extended further with +. The arguments below cover the common
adjustments and are shared by every autoplot() method in the package.
Usage
## S3 method for class 'ewas_result'
autoplot(
object,
type = c("traits", "chromosome", "direction"),
top_n = 15L,
colors = NULL,
title = NULL,
subtitle = NULL,
base_size = 11,
theme = ggplot2::theme_minimal,
wrap = 40,
...
)
Arguments
object |
An ewas_result object. |
type |
One of |
top_n |
Number of categories to show for |
colors |
Colours to use. For single-colour plots the first colour
is used. For |
title, subtitle |
Plot title and subtitle. |
base_size |
Base font size passed to |
theme |
A ggplot2 theme function such as |
wrap |
Wrap long category labels at this many characters; |
... |
Unused. |
Value
A ggplot object.
Per-sample methylation and expression values for one eQTM pair
Description
Downloads the matched DNA methylation (beta value) and gene expression
(TPM) measurements behind one CpG-gene-tissue correlation reported by
ewas_eqtm().
Usage
eqtm_samples(probe, gene, tissue)
Arguments
probe |
CpG probe identifier, e.g. |
gene |
Ensembl gene identifier, e.g. |
tissue |
Tissue name as reported in the |
Value
A data frame with one row per sample and columns methylation
and expression.
Examples
s <- eqtm_samples("cg05575921", "ENSG00000063438", "brain")
head(s)
Run EWAS Atlas enrichment analysis on a set of CpG probes
Description
Submits a probe set to the EWAS Atlas toolkit and retrieves one or more enrichment analyses run against it: EWAS trait-term enrichment, genomic location enrichment, Gene Ontology enrichment, KEGG pathway enrichment, tissue-specificity enrichment, and gene-expression correlation.
Usage
ewas_enrichment(
probes,
background = c("450K", "850K"),
types = "trait",
poll_interval = 5,
timeout = 300,
progress = interactive()
)
Arguments
probes |
Character vector of probe identifiers (20-5000) from the
450K, EPIC (850K), or EPIC v2 array. EPIC v2 names such as
|
background |
The array the probes were selected from: EWAS Atlas has no EPIC v2 background, so |
types |
Character vector of analyses to run: any of |
poll_interval |
Seconds between job-status polls. |
timeout |
Maximum seconds to wait for each analysis to finish. |
progress |
Logical; print progress messages while polling. |
Details
The EWAS Atlas toolkit requires between 20 and 5000 probes per submission and computes results asynchronously; this function submits the job and polls for completion.
Value
An ewas_enrichment object.
Examples
probes <- c(
"cg05575921", "cg00240195", "cg16419584", "cg11903855", "cg21566642",
"cg23771366", "cg19859270", "cg00382138", "cg25648203", "cg01940273",
"cg23576855", "cg00401753", "cg00300637", "cg12803068", "cg09935388",
"cg01899089", "cg04180046", "cg00050873", "cg02228185", "cg18147296"
)
enr <- ewas_enrichment(probes, background = "850K", types = "trait")
top_traits(enr)
EWAS Atlas enrichment result
Description
An ewas_enrichment bundles the analyses run by ewas_enrichment().
Usage
## S3 method for class 'ewas_enrichment'
summary(object, top_n = 10L, ...)
## S3 method for class 'ewas_enrichment'
as.data.frame(x, row.names = NULL, optional = FALSE, type = "trait", ...)
Arguments
object |
An ewas_enrichment object. |
top_n |
Number of top rows to report per analysis type. |
... |
Unused. |
x |
An ewas_enrichment object. |
row.names, optional |
Unused; present for S3 consistency. |
type |
Which analysis result to extract (default |
Value
An object of class ewas_enrichment: a named list with the
results, job, probes, background, failed, and excluded elements
described above. summary.ewas_enrichment() invisibly returns the
object it was called on (after printing a summary), and
as.data.frame.ewas_enrichment() returns the requested analysis's
result data frame on its own.
Fields
- results
Named list of data frames, one per requested analysis type (e.g.
results$trait).- job
The EWAS Atlas toolkit job identifier.
- probes
The probe identifiers submitted.
- background
The background set used (
"450K","850K","EPICv2 (approximated by 850K)", or"other").- failed
Named list of analysis types that could not be retrieved, with an explanatory message.
- excluded
Input probes dropped because they are not in the background (see the
backgroundargument ofewas_enrichment()).
Find expression quantitative trait methylation (eQTM) pairs for CpG probes
Description
Runs the EWAS Atlas toolkit's "Expression Regulation" analysis, which reports CpG-gene pairs whose DNA methylation is correlated with gene expression (expression quantitative trait methylation, eQTM). The correlations were computed by EWAS Atlas from matched methylation and RNA-seq data from The Cancer Genome Atlas (TCGA) across several tissues.
Usage
ewas_eqtm(
probes,
background = c("450K", "850K"),
poll_interval = 5,
timeout = 300,
progress = interactive()
)
Arguments
probes |
Character vector of CpG probe identifiers (20-5000). |
background |
The array the probes were selected from: EWAS Atlas has no EPIC v2 background, so |
poll_interval |
Seconds between job-status polls. |
timeout |
Maximum seconds to wait for each analysis to finish. |
progress |
Logical; print progress messages while polling. |
Details
Like ewas_enrichment(), the analysis runs as an asynchronous toolkit
job and requires between 20 and 5000 probes. A probe set that has
already been submitted (for example by an earlier ewas_enrichment()
call with the same background) reuses the existing job.
Value
An ewas_eqtm object whose pairs element is a data frame
with one row per CpG-gene-tissue correlation and columns probeId,
gene_symbol, gene_id (Ensembl), location (position of the CpG
relative to the gene), cor (Pearson correlation), p, tissue, and
source (TCGA project(s)).
See Also
eqtm_samples() for the per-sample data behind one pair, and
autoplot.ewas_eqtm() for plots.
Examples
probes <- c(
"cg05575921", "cg00240195", "cg16419584", "cg11903855", "cg21566642",
"cg23771366", "cg19859270", "cg00382138", "cg25648203", "cg01940273",
"cg23576855", "cg00401753", "cg00300637", "cg12803068", "cg09935388",
"cg01899089", "cg04180046", "cg00050873", "cg02228185", "cg18147296"
)
eq <- ewas_eqtm(probes, background = "850K")
summary(eq)
head(as.data.frame(eq))
EWAS Atlas eQTM result
Description
An ewas_eqtm holds the CpG-gene expression correlations returned by
ewas_eqtm().
Usage
## S3 method for class 'ewas_eqtm'
summary(object, top_n = 10L, ...)
## S3 method for class 'ewas_eqtm'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
Arguments
object |
An ewas_eqtm object. |
top_n |
Number of strongest pairs to list. |
... |
Unused. |
x |
An ewas_eqtm object. |
row.names, optional |
Unused; present for S3 consistency. |
Value
An object of class ewas_eqtm: a named list with the pairs,
job, probes, background, and excluded elements described above.
summary.ewas_eqtm() invisibly returns a list of summary tables
(after printing them), and as.data.frame.ewas_eqtm() returns the
pairs data frame.
Fields
- pairs
Data frame of CpG-gene-tissue correlations, sorted by
p; seeewas_eqtm()for its columns.- job
The EWAS Atlas toolkit job identifier.
- probes
The probe identifiers submitted.
- background
The background set used (
"450K","850K","EPICv2 (approximated by 850K)", or"other").- excluded
Input probes dropped because they are not in the background (see the
backgroundargument ofewas_enrichment()).
EWAS Atlas query result
Description
An ewas_result bundles the tables returned by query_cpg(),
query_gene(), or query_region().
Usage
## S3 method for class 'ewas_result'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
Arguments
row.names, optional |
Passed on for S3 consistency; unused. |
Value
An object of class ewas_result: a named list with the
associations, probes, failed, query_type, and n_queries
elements described above. as.data.frame.ewas_result() returns the
associations data frame on its own.
Fields
- associations
One row per probe-trait association, with columns
probeId,studyId,trait,correlation,rank,pmid, andquery(the input term that returned this row).- probes
One row per unique probe, with columns
probeId,chrHg19,posHg19,cpgIsland,gene, andquery.- failed
Input terms that could not be resolved, with an error
messagecolumn.- query_type
One of
"cpg","gene","region".- n_queries
Number of input terms submitted.
Example CpG probe list
Description
A small example dataset of Illumina CpG probe identifiers, useful for
trying out query_cpg() without needing to supply your own probe list.
It contains only 3 distinct probes (with repeats), so it is too small
for ewas_enrichment(), which requires 20-5000 distinct probes.
Usage
example_cpgs
Format
A data frame with 30 rows and 1 variable:
- query_cpg
Character. CpG probe identifier.
Source
Illustrative subset of probes with known EWAS Atlas trait associations.
Examples
data(example_cpgs)
head(example_cpgs)
Word cloud of EWAS Atlas terms
Description
Draws a word cloud of trait terms sized by association frequency (for ewas_result objects) or by enrichment significance (for ewas_enrichment objects), or of eQTM genes sized by their strongest association (for ewas_eqtm objects).
Usage
plot_wordcloud(x, max_words = 75L, colors = NULL, ...)
## S3 method for class 'ewas_result'
plot_wordcloud(x, max_words = 75L, colors = NULL, ...)
## S3 method for class 'ewas_enrichment'
plot_wordcloud(
x,
max_words = 75L,
colors = NULL,
type = "trait",
weight = c("neglog10p", "count"),
...
)
## S3 method for class 'ewas_eqtm'
plot_wordcloud(x, max_words = 75L, colors = NULL, ...)
Arguments
x |
An ewas_result, ewas_enrichment, or ewas_eqtm object. |
max_words |
Maximum number of terms to display. |
colors |
A vector of colours to cycle through. |
... |
Passed to methods. All methods also accept |
type |
Which enrichment analysis to plot the word cloud for
(default |
weight |
Weighting statistic: |
Value
A ggplot object.
Query the EWAS Atlas by CpG probe identifier
Description
Retrieves trait associations and annotation for one or more Illumina CpG
probe identifiers (e.g. "cg05575921") from the EWAS Atlas.
Usage
query_cpg(cpgs, workers = 2L, delay = 1, progress = interactive())
Arguments
cpgs |
Character vector of probe identifiers from the 450K, EPIC
(850K), or EPIC v2 array. EPIC v2 names such as |
workers |
Integer; maximum number of concurrent requests. Defaults
to |
delay |
Numeric; seconds to pause between batches of |
progress |
Logical; print a simple progress message as batches complete. |
Value
An ewas_result object.
Examples
res <- query_cpg(c("cg05575921", "cg11903855"), workers = 1, delay = 1)
summary(res)
Query the EWAS Atlas by gene symbol
Description
Retrieves probes and trait associations linked to one or more gene
symbols (e.g. "AHRR") from the EWAS Atlas.
Usage
query_gene(genes, workers = 2L, delay = 1, progress = interactive())
Arguments
genes |
Character vector of gene symbols. |
workers |
Integer; maximum number of concurrent requests. Defaults
to |
delay |
Numeric; seconds to pause between batches of |
progress |
Logical; print a simple progress message as batches complete. |
Value
An ewas_result object.
Examples
res <- query_gene("AHRR", workers = 1, delay = 1)
summary(res)
Query the EWAS Atlas by genomic region
Description
Retrieves probes and trait associations located within one or more genomic intervals (hg19 coordinates) from the EWAS Atlas.
Usage
query_region(
chr,
start = NULL,
end = NULL,
workers = 2L,
delay = 1,
progress = interactive()
)
Arguments
chr |
Chromosome (e.g. |
start |
Start position (hg19, 1-based). |
end |
End position (hg19, 1-based). |
workers |
Integer; maximum number of concurrent requests. Defaults
to |
delay |
Numeric; seconds to pause between batches of |
progress |
Logical; print a simple progress message as batches complete. |
Value
An ewas_result object.
Examples
res <- query_region(chr = "5", start = 373000, end = 374000, workers = 1)
summary(res)
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- ggplot2
Summarise an EWAS Atlas query result
Description
Summarise an EWAS Atlas query result
Usage
## S3 method for class 'ewas_result'
summary(object, top_n = 10L, ...)
Arguments
object |
An ewas_result object. |
top_n |
Number of top traits to report. |
... |
Unused. |
Value
Invisibly, a list with summary statistics; also printed.
Rank traits by association frequency
Description
Rank traits by association frequency
Usage
## S3 method for class 'ewas_enrichment'
top_traits(x, n = 10L, ...)
top_traits(x, n = 10L, ...)
## S3 method for class 'ewas_result'
top_traits(x, n = 10L, ...)
Arguments
x |
An ewas_result or ewas_enrichment object. |
n |
Number of top traits to return. |
... |
Passed to methods. |
Value
A data frame with columns trait and n (or p/OR for
enrichment results), ordered from most to least significant/frequent.