Learn R Programming

phylosim (version 3.0.5)

Alphabet: The Alphabet class

Description

Class representing an alphabet (a set of symbols). Package: Class Alphabet

Object ~~| ~~+--PSRoot ~~~~~~~| ~~~~~~~+--Alphabet

Directly known subclasses: AminoAcidAlphabet, AnyAlphabet, BinaryAlphabet, CodonAlphabet, NucleotideAlphabet

public static class Alphabet extends PSRoot

Usage

Alphabet(symbols=NA, type="Generic", ...)

Arguments

symbols

A character vector containing the symbols for the alphabet. All elements must have the same length and no duplicates are allowed. No element of the vector may contain the dash symbol, which is reserved for gaps.

type

An identifier for the Alphabet object.

...

Not used.

Fields and Methods

Methods:

!= -
== -
as.character -
checkConsistency -
getSize -
getSymbolLength -
getSymbols -
getType -
getWriteProtected -
hasSymbols -
is -
isEmpty -
setSize -
setSymbolLength -
setSymbols -
setType -
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

Site Process Event BinaryAlphabet NucleotideAlphabet AminoAcidAlphabet

Examples

Run this code
# NOT RUN {
		# create an alphabet object
		a<-Alphabet(type="Binary",symbols=c("0","1"));
		# print summary
		summary(a);
		# change the identifier
		a$type<-"Nucleotide";
		# change the symbol set
		a$symbols<-c("A","T","G","C");
		# print summary again
		summary(a);
		# clone the alphabet object
		b<-clone(a);
		# test the equality of the symbol sets
		a == b;
 
# }

Run the code above in your browser using DataLab