# NOT RUN {
# create the Sequence object
s<-NucleotideSequence(string="ATGCCCGGCGGATTTATTA");
# create a GeneralDeletor object
# proposed deletion length: 4, always accept
d<-GeneralDeletor(
name = "Del Bosque",
rate = 0.5,
propose.by=function(process, sequence, position){ 4 },
accept.by=function(process, sequence, range){ TRUE }
)
# attach process to site
attachProcess(s,d);
# set the rate multiplier
setRateMultipliers(s,d,2)
# get the list of active events at site 6
events<-getEventsAtSite(d,s$sites[[6]])
events;
# print sequence
s
# set the position for the event object
e<-events[[1]];
e$.position<-6;
# perform the deletion event
Perform(e)
# check the results
s
# }
Run the code above in your browser using DataLab