### Example 1: a single digestion (RAD)
simseq <- sim.DNAseq(size=100000, GCfreq=0.51)
#Restriction Enzyme 1
#SbfI
cs_5p1 <- "CCTGCA"
cs_3p1 <- "GG"
simseq.dig <- insilico.digest(simseq, cs_5p1, cs_3p1, verbose=TRUE)
### Example 2: a single digestion (GBS)
simseq <- sim.DNAseq(size=100000, GCfreq=0.51)
#Restriction Enzyme 1
# ApeKI : G|CWGC which is equivalent of either G|CAGC or G|CTGC
cs_5p1 <- "G"
cs_3p1 <- "CAGC"
cs_5p2 <- "G"
cs_3p2 <- "CTGC"
simseq.dig <- insilico.digest(simseq, cs_5p1, cs_3p1, cs_5p1, cs_3p1, verbose=TRUE)
### Example3: a double digestion (ddRAD)
# simulating some sequence:
simseq <- sim.DNAseq(size=1000000, GCfreq=0.433)
#Restriction Enzyme 1
#TaqI
cs_5p1 <- "T"
cs_3p1 <- "CGA"
#Restriction Enzyme 2
#MseI #
cs_5p2 <- "T"
cs_3p2 <- "TAA"
simseq.dig <- insilico.digest(simseq, cs_5p1, cs_3p1, cs_5p2, cs_3p2, verbose=TRUE)
simseq.sel <- adapt.select(simseq.dig, type="AB+BA", cs_5p1, cs_3p1, cs_5p2, cs_3p2)
# wide size selection (200-270):
wid.simseq <- size.select(simseq.sel, min.size = 200, max.size = 270, graph=TRUE, verbose=TRUE)
# narrow size selection (210-260):
nar.simseq <- size.select(simseq.sel, min.size = 210, max.size = 260, graph=TRUE, verbose=TRUE)
#the resulting fragment characteristics can be further examined:
boxplot(list(width(simseq.sel), width(wid.simseq), width(nar.simseq)), names=c("All fragments",
"Wide size selection", "Narrow size selection"), ylab="Locus size (bp)")
Run the code above in your browser using DataLab