Learn R Programming

phylosim (version 3.0.5)

GTR: The GTR class

Description

This class implements the general time-reversible nucleotide substitution model (GTR, REV). The rate parameters are named as in PAML (see PAML documentation: http://bit.ly/9SQK2f).

The default value for the rate parameters is 1 and the default value for the base frequencies is 0.25. So the GTR objects are equivalent to JC69 objects by default.

Package: Class GTR

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

Directly known subclasses: F81, F84, HKY, K80, K81, T92, TN93

public static class GTR extends UNREST

Usage

GTR(name="Anonymous", rate.params=list(a = 1, b = 1, c = 1, d = 1, e = 1, f = 1),
  base.freqs=rep(0.25, times = 4), ...)

Arguments

name

Object name.

rate.params

A list of unscaled rates (see setRateList.GeneralSubstitution).

base.freqs

Equlibrium distribution.

...

Additional arguments.

Fields and Methods

Methods:

checkConsistency -
getBaseFreqs -
getRateParam -
getRateParamList -
setBaseFreqs -
setRateParam -
setRateParamList -
summary -

Methods inherited from UNREST: checkConsistency, summary

Methods inherited from GeneralSubstitution: 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

References

Tavare, S (1986) "Some Probabilistic and Statistical Problems in the Analysis of DNA Sequences". American Mathematical Society: Lectures on Mathematics in the Life Sciences 17:57-86

See Also

GeneralSubstitution UNREST HKY

Examples

Run this code
# NOT RUN {
	# create substitution process object
       p<-GTR(
		rate.params=list(
			"a"=1, "b"=2, "c"=3,
			"d"=1, "e"=2, "f"=3
		),
		base.freqs=c(2,2,1,1)/6
	)
       # get a summary
       summary(p)
	# display a bubble plot
	plot(p)

	# The following code demonstrates how to use
	# the process in a simulation.

	# create a sequence, attach process p
	s<-NucleotideSequence(length=20,processes=list(list(p)))
	# sample states
	sampleStates(s)
	# make the first five positions invariable
	setRateMultipliers(s,p,0,1:5)
	# get rate multipliers
	getRateMultipliers(s,p)
	# create a simulation object and run simulation
	sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
	Simulate(sim)
	# print alignment
	sim$alignment
 
# }

Run the code above in your browser using DataLab