getEventsAtSite.GeneralInsertor: Generate insertion event object given the state of the target...

Description Usage Arguments Value Author(s) See Also Examples

Description

Generate insertion event object given the state of the target site.

This method generates a list with one insertion event. The rate of the event is calculated as the product of the general rate of the process and the "rate.multiplier" site-process specific parameter. An empty list is returned if the rate is zero or NA.

Usage

1
2
## S3 method for class 'GeneralInsertor'
getEventsAtSite(this, target.site, ...)

Arguments

this

A GeneralInsertor object.

target.site

A Site object.

...

Not used.

Value

A list of Event objects.

Author(s)

Botond Sipos, Gregory Jordan

See Also

GeneralInsertor GeneralInDel Process Event

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
	# create a sequence object
	s<-NucleotideSequence(string="AAAA")
	# create a GeneralInsertor process, provide template sequence.
	# propsed insert lengths:3, always accept.
	i<-GeneralInsertor(
		rate=0.5,
		template.seq=NucleotideSequence(string="GGG"),
		propose.by=function(process){3},
		accept.by=function(process,sequence,window){TRUE}
	)
	# attach process to site
	s$processes<-list(list(i));
	# set rate multiplier
	setRateMultipliers(s,i,2)
	# get the list of active events from site 2
	events<-getEventsAtSite(i,s$sites[[2]])
	events
	# set postition for event
	e<-events[[1]]
	e$.position<-2
	# print sequence
	s
	# perform event
	Perform(e)
	# check sequence again
	s
 

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