getEventsAtSite.GeneralSubstitution: Generate the list of active Event objects for a given...

Description Usage Arguments Value Author(s) See Also Examples

Description

Generate the list of active Event objects for a given attached Site object.

This is the single most important method in the GeneralSubstitution class. It generates a list of the active Event objects given the transition rate matrix (Q matrix) and the "rate.multiplier" Site-Process specific parameter. It returns an empty list if the state of the site is "NA".

Usage

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

Arguments

this

A GeneralSubstitution object.

target.site

A Site object. The GeneralSubstitution object must be attached to the Site object.

...

Not used.

Value

A list of the active Event objects.

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see GeneralSubstitution.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
	# create an Alphabet object
	a<-BinaryAlphabet()
	# create a Site object
	s<-Site(alphabet=a);
	# create a GeneralSubstitution object
	p<-GeneralSubstitution(alphabet=a,rate.list=list("0->1"=1,"1->0"=1))
	# attach process p to site object s
	attachProcess(s,p)
	# get the rate of active events
	getEventsAtSite(p,s)	# empty list
	# set the state of s
	s$state<-1;
	# get the rate of active events
	getEventsAtSite(p,s)
 

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