Import annotation from ROADMAP, filter to only those within the range
of dat, and then plot the peaks.
If the annotation has already been downloaded previously, it will be reused.
ROADMAP_plot(
dat,
roadmap_query,
lib_name = "Roadmap.ChromatinMarks_CellTypes",
locus_dir = tempdir(),
limit_files = NULL,
n_top = 5,
adjust = 0.2,
force_new = FALSE,
show_plot = FALSE,
conda_env = "echoR_mini",
nThread = 1,
verbose = TRUE
)data.table with at least the following columns:
SNP RSID
chromosome
position
Search all columns in the Roadmap annotations metadata
and only query annotations that contain your keywords.
Can provide multiple keywords in list form:
c("placenta","liver","monocytes")
Name of the data library to use.
Locus-specific directory.
Limit the number of annotation files queried (for faster testing).
Number of top annotations to be plotted (passed to ROADMAP_query).
The granularity of the peaks.
Download and prepare a new query
even if the file already exists locally (Default: FALSE).
Print the plot.
Conda environment to search for tabix in.
Number of threads to parallelise downloading annotations over.
Print messages.
A named list containing:
"data"GRanges object within the queried coordinates.
"plot"ggbio plot.
dat <- echodata::BST1[seq_len(1000),]
roadmap_out <- echoplot::ROADMAP_plot(
dat = dat,
roadmap_query = "monocyte")
#> echoannot:: Plotting ROADMAP annotations.
#> Converting dat to GRanges object.
#> + ROADMAP:: 2 annotation(s) identified that match: monocyte
#> Constructing GRanges query using min/max ranges across one or more chromosomes.
#> + as_blocks=TRUE: Will query a single range per chromosome that covers all regions requested (plus anything in between).
#> Downloading Roadmap Chromatin Marks: E124
#> Converting dat to GRanges object.
#> Saving query ==> /tmp/Rtmp6PJhbO/roadmap_query--monocyte.n_top--5.limit_files--./ROADMAP_query.E124.rds
#> Converting 1 GRanges object to separate BED files.
#> Saving BED file ==> /tmp/Rtmp6PJhbO/roadmap_query--monocyte.n_top--5.limit_files--./E124.bed.txt.gz
#> BED subset downloaded in 11.075 seconds
#> Constructing GRanges query using min/max ranges across one or more chromosomes.
#> + as_blocks=TRUE: Will query a single range per chromosome that covers all regions requested (plus anything in between).
#> Downloading Roadmap Chromatin Marks: E029
#> Converting dat to GRanges object.
#> Saving query ==> /tmp/Rtmp6PJhbO/roadmap_query--monocyte.n_top--5.limit_files--./ROADMAP_query.E029.rds
#> Converting 1 GRanges object to separate BED files.
#> Saving BED file ==> /tmp/Rtmp6PJhbO/roadmap_query--monocyte.n_top--5.limit_files--./E029.bed.txt.gz
#> BED subset downloaded in 8.809 seconds
#> ROADMAP:: Annotating GRangesList.
#> Annotating chromatin states.
#> Merging and processing ROADMAP annotations.
#> ROADMAP:: Done in 0.43 min.
#> Generating ROADMAP track plot.
#> Warning: Ignoring unknown parameters: `facets`
#> Warning: no non-missing arguments to max; returning -Inf