GeneralSubstitution: The GeneralSubstitution class

Description Usage Arguments Fields and Methods Author(s) See Also Examples

Description

This a class representing a continuous-time Markov process acting on the state space defined by the symbols stored in the Alphabet object passed to the object constructor.

The GeneralSubstitution objects generate Event objects corresponding to substitution events based on the state of the attached Site objects.

The GeneralSubstitution objects aggregate a QMatrix object, which stores the unscaled and scaled rate matrices. The scaled rate matrices, along with the site-process specific rate multiplier parameters define the rates of the generated Event objects.

Package:
Class GeneralSubstitution

Object
~~|
~~+--PSRoot
~~~~~~~|
~~~~~~~+--Process
~~~~~~~~~~~~|
~~~~~~~~~~~~+--GeneralSubstitution

Directly known subclasses:
AminoAcidSubst, BinarySubst, CodonSubst, CodonUNREST, ECMrest, ECMunrest, F81, F84, GTR, GY94, HKY, JC69, JTT, JTT.dcmut, K80, K81, LG, MtZoa, PAM, PAM.dcmut, T92, TN93, UNREST, WAG, cpREV, mtArt, mtMam, mtREV24

public static class GeneralSubstitution
extends Process

Usage

1
GeneralSubstitution(name="Anonymous", alphabet=NA, rate.list=NA, equ.dist=NA, ...)

Arguments

name

The name of the object.

alphabet

The alphabet on which the process acts (Alphabet object).

rate.list

A list with the substitution rates. It will be passed to setRateList method.

equ.dist

The equilibrium distribution (see setEquDist.GeneralSubstitution).

...

Not used.

Fields and Methods

Methods:

as.character -
checkConsistency -
clone -
getAlphabet -
getEquDist -
getEventRate -
getEventRateAtSite -
getEventsAtSite -
getQMatrix -
getRate -
getRateList -
hasUndefinedRate -
is -
plot -
rescaleQMatrix -
sampleState -
setAlphabet -
setEquDist -
setQMatrix -
setRate -
setRateList -
summary -

Methods inherited from Process:
!=, ==, as.character, checkConsistency, clone, getAlphabet, getEventsAtSite, getId, getName, getParameterAtSite, getSiteSpecificParamIds, getSiteSpecificParamList, getWriteProtected, hasSiteSpecificParameter, hasUndefinedRate, is, setAlphabet, setId, setName, setParameterAtSite, setSiteSpecificParamIds, setSiteSpecificParamList, setWriteProtected, summary

Methods inherited from PSRoot:
checkConsistency, enableVirtual, getComments, getMethodsList, globalConsistencyCheck, intersect.list, is, is.na, ll, my.all.equal, plot, setComments, setMethodsList, summary, virtualAssignmentForbidden

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Botond Sipos, Gregory Jordan

See Also

Process QMatrix Event Site GeneralIndel GTR WAG

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
	# Create a GeneralSubstitution object
	# also provide an Alphabet objects
	# and the list of unscaled rates
	a<-BinaryAlphabet()
	gs<-GeneralSubstitution(
			name="MyBinarySubst",
			alphabet=a,
			rate.list=list("0->1"=2,"1->0"=1)
		)
	# check if inherits from GeneralSubstitution
	is.GeneralSubstitution(gs)
	# get an object summary
	summary(gs)
	# get a bubble plot
	plot(gs)
	# get unscaled rate for "0->1" by event name
	getRate(gs,"0->1")
	# get unscaled rate for "0->1" by states
	getRate(gs,from="0", to="1")
	# get scaled rate for "0->1" by name
	getEventRate(gs,"0->1")
	# get the list of unscaled event rates
	gs$rateList
	# set the \emph{unscaled} rates
	gs$rateList<-list("0->1"=1,"1->0"=1)
	# reset equilibrium distribution
	gs$equDist<- 5 * gs$equDist
	# get the equilibrium distribution
	gs$equDist
	# sample a state form the equilibrium distribution
	sampleState(gs)
	# get the associated QMatrix object
	gs$qMatrix
	# create a site object
	s<-Site(alphabet=a, state="0")
	# attach gs to s
	s$processes<-list(gs)
	# set rate multiplier for s and gs
	setParameterAtSite(gs,s,id="rate.multiplier",value=2)
	# get site specific rate for "0->1"
	getEventsAtSite(gs,s,"0->1")
	# get the list of active event objects given the state of s
	getEventsAtSite(gs,s)
	# get the associated Alphabet object
	gs$alphabet
	# clone the object
	gsc<-clone(gs)
	# modify the alphabet of gsc
	gsc$alphabet<-NucleotideAlphabet()
	summary(gsc)
	# check if gsc has undefined rates
	hasUndefinedRate(gsc)
 

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