ToleranceSubstitution: The ToleranceSubstitution 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.

In contrast to GeneralSubstitution, the ToleranceSubstitution class has a site-specific substitution tolerance parameter ("substitution.tolerance") which determines the probability of accepting the proposed events. As a consequence, the branch lengths inferred from the simulated data will no longer correspond to the neutral expectations unless all tolerance values are equal to 1.

Package:
Class ToleranceSubstitution

Object
~~|
~~+--PSRoot
~~~~~~~|
~~~~~~~+--Process
~~~~~~~~~~~~|
~~~~~~~~~~~~+--ToleranceSubstitution

Directly known subclasses:

public static class ToleranceSubstitution
extends Process

Usage

1
ToleranceSubstitution(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.ToleranceSubstitution).

...

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
 # construct a GTR process object, we will use this to fill in the rates
 # for the ToleranceSubstitution process.
 gtr         <- GTR(
       name="MyGTR",
           rate.params=list(
               "a"=1, "b"=2, "c"=3,
                   "d"=1, "e"=2, "f"=3
           ),
           base.freqs=c(2,2,1,1)/6
   )
 rate.list.gtr   <- gtr$rateList

 # Construct the ToleranceSubstitution process.
 p   <- ToleranceSubstitution(
     name        = "MyTolSubst",
     alphabet    = NucleotideAlphabet(),
     rate.list   = rate.list.gtr,
 )

 plot(p)

 # construct root sequence object
 s<-NucleotideSequence(length=20)

 # attach process
 attachProcess(s,p)

 # sample states from the equilibrium
 # distribution of the attached processes
 sampleStates(s)

 ## Set the substitution tolerance parameters for some sites:
 setParameterAtSites(s, p, "substitution.tolerance",c(0,0.05,0.1),1:3)

 ## Plot the substitution tolerance parameters across sites:
 plotParametersAtSites(s,p,"substitution.tolerance")

 # Construct simulation object:
 sim <-PhyloSim(root.seq=s, phylo=rtree(3))

 # Run simulation:
 Simulate(sim)

 # Plot alignment:
 plot(sim)

 

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