Perform.Event: Perform an event

Description Usage Arguments Value Author(s) See Also Examples

Description

Performing an event means that the modifications described by the Event object are actually made by calling the event handler function as returned by getHandler with the Event object as the first argument.

The event won't be performed if the handler function is invalid, if there is no associated Site object, if the site position is undefined, if the rate is undefined, or if the generator process is invalid.

The handler function will be overwritten after performing an event, so the Perform method should be called only once for every Event object.

Usage

1
2
## S3 method for class 'Event'
Perform(this, ...)

Arguments

this

An Event object.

...

Not used.

Value

The value returned by the handler function.

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see Event.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
	# create a sequence and attach a process
	s<-NucleotideSequence(string="ATGC",processes=list(list(JC69())))
	# get the first active event from the first site
   #only Sequence methods set .position,
   #so s$sites[[1]]$events[[1]] wouldn't work.
	e<-getEvents(s,1)[[1]]
	# perform e
	Perform(e)
	# check the effect of the event on s
	s
 

phylosim documentation built on Nov. 22, 2019, 1:07 a.m.