setAlphabets.Sequence: Assotiate Alphabet objects to a set of Site objects...

Description Usage Arguments Value Author(s) See Also Examples

Description

Assotiate Alphabet objects to a set of Site objects aggregated by a Sequence object.

Usage

1
2
## S3 method for class 'Sequence'
setAlphabets(this, value, index, ...)

Arguments

this

A Sequence object.

value

A list of Alphabet objects, recycled if shorter than the index vector.

index

An integer vector specifying a set of positions. It is set to 1:seq$length if omitted.

...

Not used.

Value

The Sequence object (invisible).

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see Sequence.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
	# create a Sequence object
	s<-Sequence(length=10)
	# set the alphabets for range 1:5
	setAlphabets(s,list(NucleotideAlphabet(),BinaryAlphabet()),1:5)
	# set the alphabets for range 6:10
	setAlphabets(s,list(AminoAcidAlphabet()),6:10)
	# get the list of attached Alphabet objects
	getAlphabets(s)
	# get Alphabets from a range
	getAlphabets(s,c(2:3,5))
	# set alphabets via virtual field
	s$alphabets<-list(BinaryAlphabet(),NucleotideAlphabet())
	# get alphabets via virtual field
	s$alphabets
 

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