setAlphabet.Site: Attach an Alphabet object to a Site object

Description Usage Arguments Value Author(s) See Also Examples

Description

Attach an Alphabet object to a Site object. If the ancestral site is not NA, then the symbol set of the ancestral Alphabet object and the new Alphabet object must be the same. The current state must be in the symbol set of the new Alphabet object, unless it is NA.

Usage

1
2
## S3 method for class 'Site'
setAlphabet(this, new.alphabet, ...)

Arguments

this

A Site object.

new.alphabet

A valid Alphabet object.

...

Not used.

Value

Returns the new Alphabet object (invisible).

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see Site.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
	# create a site object
	s<-Site()
	# create an Alphabet object
	a<-Alphabet(c("A","T","G"))
	# attach alphabet to site object
	setAlphabet(s,a)
	# set site state
	s$state<-"A"
	# clone the alphabet object
	b<-clone(a)
	# modify symbol set in b
	b$symbols<-c(b$symbols,"C")
	# attach b to s via virtual field
	s$alphabet<-b
	s$alphabet
 

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