setAcceptBy.GeneralInDel: Set the function used for accepting/rejecting indel events

Description Usage Arguments Value Author(s) See Also Examples

Description

Set the function used for accepting/rejecting indel events.

The function object must have the following arguments: process (the caller process), sequence (the target sequence), window (a vector containing the positions affecting acceptance).

Usage

1
2
## S3 method for class 'GeneralInDel'
setAcceptBy(this, value, ...)

Arguments

this

A GeneralInDel object.

value

A function object.

...

Not used.

Value

The function object (invisible).

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see GeneralInDel.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
	# create a GeneralInDel object
	# rejecting half of the events
	o<-GeneralInDel(
                   rate=1,
                   propose.by=function(process){return(5)},
                   accept.by=function( ){sample(c(TRUE,FALSE),1)}
                   );
	# set/get the acceptBy function
	setAcceptBy(o,value=function( ){return(FALSE)})	# reject all events
	getAcceptBy(o)
	# set/get acceptBy function via virtual field
	o$acceptBy<-function(){return(TRUE)}		# accept all events
	o$acceptBy
 

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