Learn R Programming

phylosim (version 3.0.5)

getEventsAtSite.GeneralDeletor: Title

Description

Title.

This method generates a list containing a single deletion event object. The rate of the event is calculated as the product of the general rate of the process and the "rate.multiplier" site-process specific parameter. An empty list is returned if the rate is zero or NA.

Usage

# S3 method for GeneralDeletor
getEventsAtSite(this, target.site, ...)

Arguments

this

A GeneralDeletor object.

target.site

The target Site object.

...

Not used.

Value

A list of event objects.

See Also

For more information see GeneralDeletor.

Examples

Run this code
# NOT RUN {
	# create the Sequence object
	s<-NucleotideSequence(string="ATGCCCGGCGGATTTATTA");
	# create a GeneralDeletor object
	# proposed deletion length: 4, always accept
	d<-GeneralDeletor(
			name = "Del Bosque",
			rate = 0.5,
			propose.by=function(process, sequence, position){ 4 },
			accept.by=function(process, sequence, range){ TRUE }
 	)
	# attach process to site
	attachProcess(s,d);
	# set the rate multiplier
	setRateMultipliers(s,d,2)
	# get the list of active events at site 6
	events<-getEventsAtSite(d,s$sites[[6]])
	events;
	# print sequence
	s
	# set the position for the event object
	e<-events[[1]];
	e$.position<-6;
	# perform the deletion event
	Perform(e)
	# check the results
	s
 
# }

Run the code above in your browser using DataLab