This is the class representing an event. Event objects usually are generated by the getEventsAtSite.*
methods based on the state of attached Site object and the properties of the generating Process object.
The Perform method will refuse to modify target objects if the position field is not set. The Perform method can be called only once for any Event object.
Package: Class Event
Object
~~|
~~+--
PSRoot
~~~~~~~|
~~~~~~~+--
Event
Directly known subclasses:
public static class Event extends PSRoot
Event(name=NA, rate=NA, site=NA, position=NA, process=NA, handler=NA, ...)
The name of the Event object. Often stores useful information.
The rate of the event.
The associated Site object.
The position of associated Site object in the enclosing Sequence object (if any).
The generator Process object.
The handler function for the Event object. It will be called by Perform.Event
with the Event object as an argument to make the changes corresponding to the event.
Not used.
Methods:
Perform |
- | |
as.character |
- | |
checkConsistency |
- | |
getHandler |
- | |
getName |
- | |
getPosition |
- | |
getProcess |
- | |
getRate |
- | |
getSite |
- | |
getWriteProtected |
- | |
is |
- | |
setHandler |
- | |
setName |
- | |
setPosition |
- | |
setProcess |
- | |
setRate |
- | |
setSite |
- | |
setWriteProtected |
- | |
summary |
- |
Methods inherited from PSRoot: checkConsistency, enableVirtual, getComments, getMethodsList, globalConsistencyCheck, intersect.list, is, is.na, ll, my.all.equal, plot, setComments, setMethodsList, summary, virtualAssignmentForbidden
Methods inherited from Object: $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save
Site Process Sequence getEventsAtSite.GeneralSubstitution
# NOT RUN {
# Note: the following examples are not very useful
# unless you want to implement your own process.
# create a Sequence object and a Process object
seq<-NucleotideSequence(string="A");
p<-Process(alphabet=NucleotideAlphabet())
# get the Site object from the Sequence object
s<-seq$sites[[1]]
# attach p to s
attachProcess(s,p)
# create an Event object
e<-Event(name="A->G",rate=0.1,site=s,process=p,position=1)
# get object summary
summary(e)
# get event name
e$name
# set/get event rate
e$rate<-0.2
e$rate
# get site
e$site
# set/get event handler
e$.handler<-function(this){this$.site$state<-"G"}
e$handler
# perform the event
Perform(e)
# check the state of the target site
s$state
# }
Run the code above in your browser using DataLab