setRate.ToleranceSubstitution: Set an unscaled rate for an event from a...

Description Usage Arguments Value Author(s) See Also Examples

Description

Set an unscaled rate for an event from a ToleranceSubstitution object.

This method sets the element corresponding to a given event in the unscaled Q matrix. 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.

Modifying any rate in the unscaled Q matrix will trigger the re-scaling of the whole matrix. The rescaled rates (used during simulations) are returned by the getEventRate method.

This method doesn't modify the site specific rate multipliers.

Usage

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

Arguments

this

A ToleranceSubstitution object.

name

The name of the event.

from

The initial state.

value

The new value of the rate.

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
	# create a ToleranceSubstitution object
	# provide an Alphabet object and the rates
	p<-ToleranceSubstitution(alphabet=BinaryAlphabet(), rate.list=list("1->0"=1,"0->1"=1))
	# set the unscaled rate by event name
	setRate(p,"0->1",2)
	# get the unscaled rate of "0->1" by name
	getRate(p,"0->1")
	# set the unscaled rate by states
	setRate(p,"0->1",0.5)
	# get the unscaled rate of "0->1" by states
	getRate(p,from="0",to="1")
 

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