getEventRateAtSite.ToleranceSubstitution: Get the site spcific rate of an event from a...

Description Usage Arguments Value Author(s) See Also Examples

Description

Get the site spcific rate of an event from a ToleranceSubstitution object.

This method return the element from the associated QMatrix object corresponding to a given event multiplied by the "rate.multiplier" site-process specific parameter stored in the specified site object. The event can be specified by the inital and target states ("from" and "to" arguments), or by the event name ("from->to"). The event name takes precedence over the "from" and "to" arguments.

Usage

1
2
## S3 method for class 'ToleranceSubstitution'
getEventRateAtSite(this, site, name=NA, from=NA, to=NA, ...)

Arguments

this

A ToleranceSubstitution object. It must be attached to the provided Site object.

site

A Site object.

name

The name of the event.

from

The initial state.

to

Target state.

...

Not used.

Value

A Numeric vector of length one.

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see ToleranceSubstitution.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
	# create a ToleranceSubstitution object
	# provide an Alphabet object and the rates
	p<-ToleranceSubstitution(alphabet=BinaryAlphabet(), rate.list=list("1->0"=1,"0->1"=1))
	# create a Site object
	s<-Site(alphabet=BinaryAlphabet())
	# attach process p to site s
	s$processes<-list(p)
	# set the rate multiplier for s and p
       setParameterAtSite(p,s,id="rate.multiplier",value=2)
	# get the site specific rate of "0->1" by name
	getEventRateAtSite(p,s,"0->1")
	# get the site specific rate of "0->1" by states
	getEventRateAtSite(p,s,from="0",to="1")
 

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