#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
par(mfrow=c(3,1), mar=c(3,4,1,1))
plot(as.vector(coverage(res$syn.reads)), type="h", col="red", ylab="nucleosomal", ylim=c(0,35))
plot(as.vector(coverage(res$ctr.reads)), type="h", col="blue", ylab="random", ylim=c(0,35))
plot(as.vector(res$syn.ratio), type="h", col="orange", ylab="ratio")
Run the code above in your browser using DataLab