Description Usage Arguments Value Author(s) Examples
This function generates a synthetic nucleosome map using the parameters given by the user and returns the coverage (like NGS experiments) or a pseudo-hybdridization ratio (like Tiling Arrays) toghether with the perfect information about the well positioned and fuzzy nucleosome positions.
1 2 3 4 5 6 7 8 9 10 11 12 13 | syntheticNucMap(
wp.num = 100,
wp.del = 10,
wp.var = 20,
fuz.num = 50,
fuz.var = 50,
max.cover = 20,
nuc.len = 147,
lin.len = 20,
rnd.seed = NULL,
as.ratio = FALSE,
show.plot = FALSE
)
|
wp.num |
Number of well-positioned (non overlapped) nucleosomes. They
are placed uniformly every |
wp.del |
Number of well-positioned nucleosomes (the ones generated by
|
wp.var |
Maximum variance in basepairs of the well-positioned nucleosomes. This will create some variation in the position of the reads describing the same nucleosome. |
fuz.num |
Number of fuzzy nucleosomes. They are distributed randomly over all the region. They could be overlapped with other well-positioned or fuzzy nucleosomes. |
fuz.var |
Maximum variance of the fuzzy nucleosomes. This allow to set
different variance in well-positioned and fuzzy nucleosome reads (using
|
max.cover |
Maximum coverage of a nucleosome, i.e., how many times a nucleosome read can be repeated. The final coverage probably will be higher by the addition of overlapping nucleosomes. |
nuc.len |
Nucleosome length. It's not recomended change the default 147bp value. |
lin.len |
Linker DNA length. Usually around 20 bp. |
rnd.seed |
As this model uses random distributions for the placement, by setting the rnd.seed to a known value allows to reproduce maps in different executions or computers. If you don't need this, just left it in default value. |
as.ratio |
If |
show.plot |
If |
A list with the following elements:
wp.starts Start points of well-positioned nucleosomes
wp.nreads Number of repetitions of each well positioned read
wp.reads Well positioned nucleosome reads (IRanges
format),
containing the repetitions
fuz.starts Start points of the fuzzy nucleosomes
fuz.nreads Number of repetitions of each fuzzy nucleosome read
fuz.reads Fuzzy nucleosome reads (IRanges
format), containing all
the repetitions
syn.reads All synthetic nucleosome reads togheter (IRanges
format)
The following elements will be only returned if as.ratio=TRUE
:
ctr.reads The pseudo-naked DNA (control) reads (IRanges
format)
syn.ratio The calculated ratio nucleosomal/control (Rle
format)
Oscar Flores oflores@mmb.pcb.ub.es
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # Generate a synthetic map with 50wp + 20fuzzy nucleosomes using fixed
# random seed=1
res <- syntheticNucMap(wp.num=50, fuz.num=20, show.plot=TRUE, rnd.seed=1)
# Increase the fuzzyness
res <- syntheticNucMap(
wp.num=50, fuz.num=20, wp.var=70, fuz.var=150, show.plot=TRUE,
rnd.seed=1
)
# Calculate also a random map and get the ratio between random and
# nucleosomal
res <- syntheticNucMap(
wp.num=50, wp.del=0, fuz.num=20, as.ratio=TRUE, show.plot=TRUE,
rnd.seed=1
)
print(res)
# Different reads can be accessed separately from results
# Let's use this to plot the nucleosomal + the random map
library(ggplot2)
as <- as.vector(coverage.rpm(res$syn.reads))
bs <- as.vector(coverage.rpm(res$ctr.reads))
cs <- as.vector(res$syn.ratio)
plot_data <- rbind(
data.frame(x=seq_along(as), y=as, lab="nucleosomal"),
data.frame(x=seq_along(bs), y=bs, lab="random"),
data.frame(x=seq_along(cs), y=cs, lab="ratio")
)
qplot(x=x, y=y, data=plot_data, geom="area", xlab="position", ylab="") +
facet_grid(lab~., scales="free_y")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.