sample.tnt: Sample a coalescent tree according to a PCR experiment,...

Description Usage Arguments Value See Also Examples

Description

This method returns a coalescent tree sampled according to the PCR experiment specified by the parameters stored in the slots of the PCRcoal object given as the first argument. All of the slots must contain a defined value.

This method also returns the subsample sizes and size trajectories corresponding to the sampled tree.

Usage

1
2
	## S4 method for signature 'PCRcoal'
sample.tnt(object)

Arguments

object

A PCRcoal object, with all the slots defined.

Value

A list containing the following elements:

phylo

A ape phylo object (rooted).

trajectories

A matrix containing the sampled size trajectories (rows ~ subsamples, columns ~ cycles).

subsamples

A vector of subsample sizes.

See Also

The PCRcoal class. The sample.tree and sample.trs methods.

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
	# Construct a PCRcoal object 
	# and specify the experimental conditions:
	sim <-PCRcoal(
        initial.size    =5,
        sample.size     =10,
        nr.cycles       =30,
        efficiencies    =c(rep(0.1, 30))
    	)

	# Sample a coalescent tree with subsample sizes and
    # size trajectories:
	res <- sample.tnt(sim)

	# Print subsample sizes:
	print(res$subsamples)
	
	# Print size trajectories:
	print(res$trajectories)

	# Print tree info:
	print(res$phylo)

	# Plot the tree:
	plot(res$phylo)

pcrcoal documentation built on May 1, 2019, 8:03 p.m.

Related to sample.tnt in pcrcoal...