exportStatTree.PhyloSim: Export the per-branch counts of an event as a phylo object

Description Usage Arguments Value Author(s) See Also Examples

Description

Export the per-branch counts of an event as a phylo object.

During simulation the number of events performed on every branch is recorded. The recorded events can be "basic" events, like "insertion", "deletion" and "A->T" or events which are sums of basic events, like "substituion". The getBranchEvents method returns a character vector with the names of the events having per-branch statistics recorded. The method should be called after the simulation is finished.

The per-branch statistics can be exported as phylo objects by using the exportStatTree method. The branch lengths of the exported phylo objects are set to the value of the respective per-branch event count.

Usage

1
2
## S3 method for class 'PhyloSim'
exportStatTree(this, event, ...)

Arguments

this

A PhyloSim object.

event

The name of the event as returned by the getBranchEvents method.

...

Not used.

Value

A phylo object.

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see PhyloSim.

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
27
28
29
	# Create a PhyloSim object.
	# Provide the phylo object
	# and the root sequence.

	# NOTE: this will be a little bit slow
	sim<-PhyloSim(
		phylo=rcoal(3),
		root.seq=CodonSequence(
                               string="ATGATTATT",
                               processes=list(list(GY94(kappa=2,omega.default=0.5)))
                               )
	);
	# make the tree longer to have more events
	scaleTree(sim,5)
	# plot the tree
	plot(sim)
	# run simulation
	Simulate(sim)
	# get the list of recorded per-branch event counts
	getBranchEvents(sim)
	# export the number of substitutions as a phylo object
	subst<-exportStatTree(sim,"substitution")
	# plot the exported phylo object
	plot(subst)
	#export the number of synonymous substitutions as a phylo object
	subst<-exportStatTree(sim,"nr.syn.subst")
	# plot the exported phylo object
	plot(subst)
 

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