GeneralInDel: The GeneralInDel class

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

Description

This is a class implementing the methods which are needed by both the GeneralInsertor and GeneralDeletor process.

Package:
Class GeneralInDel

Object
~~|
~~+--PSRoot
~~~~~~~|
~~~~~~~+--Process
~~~~~~~~~~~~|
~~~~~~~~~~~~+--GeneralInDel

Directly known subclasses:
BrownianInsertor, ContinuousDeletor, ContinuousInsertor, DiscreteDeletor, DiscreteInsertor, FastFieldDeletor, GeneralDeletor, GeneralInsertor

public static class GeneralInDel
extends Process

Usage

1
GeneralInDel(name="Anonymous", rate=NA, propose.by=NA, accept.by=NA, ...)

Arguments

name

The name of the object.

rate

The general rate of the object.

propose.by

A function used to propose events.

accept.by

A function used to accept/reject events.

...

Additional arguments.

Fields and Methods

Methods:

checkConsistency -
getAcceptBy -
getProposeBy -
getRate -
hasUndefinedRate -
is -
proposeLength -
setAcceptBy -
setProposeBy -
setRate -
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 GeneralInsertor GeneralDeletor GeneralSubstitution

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
	# create a GeneralInDel object
	# rejecting half of the events
	# and proposing sizes in the range 1:10
	o<-GeneralInDel(
                   rate=1,
                   propose.by=function(process){sample(1:10,1)},
                   accept.by=function(){sample(c(TRUE,FALSE),1)}
                   );
	# check if inherits from GeneralInDel
	is.GeneralInDel(o)
	# check if it has undefined rates
	hasUndefinedRate(o)
	# get object summary
	summary(o)
	# set/get proposeBy function via virtual field
	o$proposeBy<-function(process){return(3)}	# fixed event length
	o$proposeBy
	# set/get acceptBy function via virtual field
	o$acceptBy<-function(){return(TRUE)}		# accept all events
	o$acceptBy
	# get/set general rate
	o$rate
	o$rate<-2	# double the rate
	# propose event length
	proposeLength(o)
 

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