View source: R/nucleoSimFunctions.R
syntheticNucReadsFromDist | R Documentation |
Generate a synthetic nucleosome map, a map with forward and reverses reads (paired-end reads) covering the nucleosome regions, using the distribution selected by the user. The distribution is used to assign the start position to the forward reads associated with the nucleosomes. The user has choice between three different distributions: Normal, Student and Uniform. The final map is composed of paired-end reads.
#' The synthetic nucleosome map creation is separated into 3 steps :
1. Adding well-positioned nucleosomes following specified parameters. The nucleosomes are all positioned at equidistance. Assigning the starting positions of forward reads using the specified distribution and parameters. The distance between starting positions of paired-end reads is assigned using a normal distribution and specified variance.
2. Deleting some well-positioned nucleosomes following specified parameters. Each nucleosome has an equal probability to be selected.
3. Adding fuzzy nucleosomes following an uniform distribution and specified parameters. Assigning the starting positions of forward reads using the specified distribution and parameters. The distance between starting positions of paired-end reads is assigned using a normal distribution and specified variance.
This function has been largely inspired by the Generating synthetic maps section of the nucleR package (Flores et Orozco, 2011).
syntheticNucReadsFromDist( wp.num, wp.del, wp.var, fuz.num, fuz.var, max.cover = 100, nuc.len = 147, len.var = 10, lin.len = 20, read.len = 40, rnd.seed = NULL, distr = c("Uniform", "Normal", "Student"), offset )
wp.num |
a non-negative |
wp.del |
a non-negative |
wp.var |
a non-negative |
fuz.num |
a non-negative |
fuz.var |
a non-negative |
max.cover |
a positive |
nuc.len |
a positive |
len.var |
a positive |
lin.len |
a non-negative |
read.len |
a positive |
rnd.seed |
a single value, interpreted as an |
distr |
the name of the distribution used to generate the nucleosome
map. The choices are : |
offset |
a non-negative |
an list
of class
"syntheticNucReads" containing the
following elements:
call
the matched call.
dataIP
a data.frame
with the chromosome name, the
starting and ending positions and the direction of all forward
and reverse reads for all well-positioned and fuzzy nucleosomes.
Paired-end reads are identified with an unique id.
wp
a data.frame
with the positions of all the
well-positioned nucleosomes, as well as the number of paired-reads
associated to each one.
fuz
a data.frame
with the positions of all the fuzzy
nucleosomes, as well as the number of paired-reads associated to each one.
paired
a data.frame
with the starting and ending
positions of the reads used to generate the paired-end reads. Paired-end
reads are identified with an unique id.
Pascal Belleau, Rawane Samb, Astrid Deschenes
## Generate a synthetic map with 20 well-positioned + 10 fuzzy nucleosomes ## using a Normal distribution with a variance of 30 for the well-positioned ## nucleosomes, a variance of 40 for the fuzzy nucleosomes and a seed of 15. ## Because of the fixed seed, each time is going to be run, the results ## are going to be the seed. res <- syntheticNucReadsFromDist(wp.num = 20, wp.del = 0, wp.var = 30, fuz.num = 10, fuz.var = 40, rnd.seed = 15, distr = "Normal", offset = 1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.