The package annotator3D r packageVersion("mclust")
is an R package to classify DNA motifs or features into chromatin loops. There are four public or private functions in annotator3D:
Public functions:
classify
which acts as a master function to classify the motifs/features; and
* visualize_annotation
which returns an ggbio annotation track.
Private functions:
* bin_motifs
, a helper function to classify
. It calculates the frequencies of the feature in different loops.
calculate_overflow
, a helper function to bin_motifs
. It calculates how much of a feature overlaps with the loop region.
To give you an idea of how to use the functions, follow along with this tutorial.
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(annotator3D) sessionInfo()
First let's load the chromatin loops dataset from ENCODE. It contains predicted loops in the A549 cell line's chromosome 18 (Salameh, et al., 2019).
data("A549ChromLoops") head(A549ChromLoops)
Now to load a matched feature:
data("matchedMotifs") head(matchedMotifs)
matchedMotifs
contains motifs observed to predict methylation of H3 histones' lysine 9 (Ngo et al., 2019).
For motif classification, simply call the classify
function in annotator3D
classify(matchedMotifs, A549ChromLoops)
It creates a local file directory called BEDs where it stores classified motifs as BED files. Each motif will have its own BED file. If you would like to treat all motifs equally, you can simply run concatenate the files contents into a BED master file. For this example, we are working with one motif, however, so we will continue with the output H3K9me3.bed file.
To get the classified annotation track, simply call antrack <- classifiedAnnotationTrack("<path to>/H3K9me3.bed", gen=gen)
where
gen <- c("mm10") names(gen) <- "chr18"
Here thresh
refers to a lower bound for loop membership score. You can see the distribution of this score from BED file.
Now, you can layer this track with other Gviz tracks as follows
data("antrack") library(Gviz) plotTracks(antrack)
or for the layered Gviz figure
{r layer_gviz}
plot_layered_gviz(antrack, gen=gen, from = 1, to = 10000000)
Ngo V, Chen Z, Zhang K, Whitaker J, Wang M, Wang W. (2019) Epigenomic analysis reveals DNA motifs regulating histone modifications in human and mouse. PNAS 116(9): 3668--3677.
Salameh TJ, Wang X, Song F, Zhang B, Wright SM, Khunsriraksakul C, Yue F. A supervised learning framework for chromatin loop detection in genome-wide contact maps. biorXiv. doi: https://doi.org/10.1101/739698.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.