Learn R Programming

phylosim (version 3.0.5)

BrownianInsertor: The BrownianInsertor class

Description

The BrownianInsertor class inherits from the DiscreteInsertor or ContinuousInsertor class depending on the type constructor argument ("discrete" or "continuous").

This process generates the insert sequence based on the sites flanking the insertions as follows:

  • An insert length is sampled by calling the function stored in the proposeBy virtual field.

  • A sequence object is constructed.

  • The processes attached to both flanking sites are attached to the insert sequence. If there are no common processes, the processes from a randomly chosen site will be attached to the insert.

  • The site-process specific parameters are sampled from Brownian paths with linear trends having the values from the flanking sites as endpoints.

The "noisiness" of the Brownian path can be controlled through the scale virtual field/constructor parameter.

Package: Class BrownianInsertor

Object ~~| ~~+--PSRoot ~~~~~~~| ~~~~~~~+--Process ~~~~~~~~~~~~| ~~~~~~~~~~~~+--GeneralInDel ~~~~~~~~~~~~~~~~~| ~~~~~~~~~~~~~~~~~+--GeneralInsertor ~~~~~~~~~~~~~~~~~~~~~~| ~~~~~~~~~~~~~~~~~~~~~~+--DiscreteInsertor ~~~~~~~~~~~~~~~~~~~~~~~~~~~| ~~~~~~~~~~~~~~~~~~~~~~~~~~~+--BrownianInsertor

Directly known subclasses:

public static class BrownianInsertor extends DiscreteInsertor

Usage

BrownianInsertor(name="Anonymous", type="discrete", scale=0.001, ...)

Arguments

name

Object name.

type

Process type (see above).

scale

Brownian path scale parameter.

...

Additional arguments.

Fields and Methods

Methods:

BrownianPath -
checkConsistency -
getScale -
getType -
setScale -
setType -
summary -

Methods inherited from DiscreteInsertor: checkConsistency, getProbs, getSizes, plot, setProbs, setSizes, summary

Methods inherited from GeneralInsertor: checkConsistency, generateInsert, getAcceptWin, getEventsAtSite, getGenerateBy, getInsertHook, getTemplateSeq, is, setAcceptWin, setGenerateBy, setInsertHook, setTemplateSeq, summary

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

See Also

DiscreteInsertor ContinuousInsertor GeneralInsertor GeneralInDel

Examples

Run this code
# NOT RUN {
	# create a BrownianInsertor process, discrete type
	p<-BrownianInsertor(
                       type="discrete",
                       scale=0.05,
                       sizes=1:4,
                       probs=c(3/6,1/6,1/6,1/6),
                       rate=0.05
                       )
	# get object summary
	summary(p)
	# plot insert length distribution
	plot(p)
	# create a nucleotide sequence, attach processes
	s<-NucleotideSequence(string="AAAAAAAAAAA",processes=list(list(p,JC69())))
	# create simulation object
	sim<-PhyloSim(root.seq=s, phylo=rcoal(2))
	# simulate and show alignment
	Simulate(sim)
	sim$alignment
	# check the rate multipliers and insertion tolerances in one of the sequences
	res<-sim$sequences[[2]]
	getRateMultipliers(res,p)
	getInsertionTolerance(res,p)
 
# }

Run the code above in your browser using DataLab