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
Alphabet(symbols=NA, type="Generic", ...)
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.
An identifier for the Alphabet object.
Not used.
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
Site Process Event BinaryAlphabet NucleotideAlphabet AminoAcidAlphabet
# 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