bpp-seq3
3.0.0
|
Utilitary functions dealing with alphabets. More...
#include <Bpp/Seq/Alphabet/AlphabetTools.h>
Public Member Functions | |
AlphabetTools () | |
virtual | ~AlphabetTools () |
Static Public Member Functions | |
static int | getType (char state) |
Character identification method for sequence's alphabet identification. More... | |
static bool | checkAlphabetCodingSize (const Alphabet &alphabet) |
This checks that all characters in the alphabet are coded by a string of same length. More... | |
static bool | checkAlphabetCodingSize (const Alphabet *alphabet) |
This checks that all characters in the alphabet are coded by a string of same length. More... | |
static unsigned int | getAlphabetCodingSize (const Alphabet &alphabet) |
In case that all states in the given alphabet have a string description of same length, send this length; e.g. 3 for codon alphabets. More... | |
static unsigned int | getAlphabetCodingSize (const Alphabet *alphabet) |
In case that all states in the given alphabet have a string description of same length, send this length; e.g. 3 for codon alphabets. More... | |
static bool | isNucleicAlphabet (const Alphabet &alphabet) |
static bool | isDNAAlphabet (const Alphabet &alphabet) |
static bool | isRNAAlphabet (const Alphabet &alphabet) |
static bool | isProteicAlphabet (const Alphabet &alphabet) |
static bool | isCodonAlphabet (const Alphabet &alphabet) |
static bool | isWordAlphabet (const Alphabet &alphabet) |
static bool | isRNYAlphabet (const Alphabet &alphabet) |
static bool | isBinaryAlphabet (const Alphabet &alphabet) |
static bool | isIntegerAlphabet (const Alphabet &alphabet) |
static bool | isDefaultAlphabet (const Alphabet &alphabet) |
static bool | isAllelicAlphabet (const Alphabet &alphabet) |
static bool | match (std::shared_ptr< const Alphabet > alphabet, int i, int j) |
Tell if two characters match according to a given alphabet. More... | |
Static Public Attributes | |
static std::shared_ptr< const DNA > | DNA_ALPHABET = make_shared<const DNA>() |
static std::shared_ptr< const RNA > | RNA_ALPHABET = make_shared<const RNA>() |
static std::shared_ptr< const CodonAlphabet > | DNA_CODON_ALPHABET = make_shared<const CodonAlphabet>(dynamic_pointer_cast<const NucleicAlphabet>(DNA_ALPHABET)) |
static std::shared_ptr< const CodonAlphabet > | RNA_CODON_ALPHABET = make_shared<const CodonAlphabet>(dynamic_pointer_cast<const NucleicAlphabet>(RNA_ALPHABET)) |
static std::shared_ptr< const ProteicAlphabet > | PROTEIN_ALPHABET = make_shared<const ProteicAlphabet>() |
static std::shared_ptr< const DefaultAlphabet > | DEFAULT_ALPHABET = make_shared<const DefaultAlphabet>() |
Static Private Member Functions | |
template<class Y > | |
static bool | alphabetInheritsFrom (const Alphabet &alphabet) |
Utilitary functions dealing with alphabets.
Definition at line 31 of file AlphabetTools.h.
|
inline |
Definition at line 42 of file AlphabetTools.h.
|
inlinevirtual |
Definition at line 43 of file AlphabetTools.h.
|
inlinestaticprivate |
Definition at line 201 of file AlphabetTools.h.
|
static |
This checks that all characters in the alphabet are coded by a string of same length.
This method is used when states are coded by more than one character, typically: codon alphabets.
alphabet | The alphabet to check. |
Definition at line 57 of file AlphabetTools.cpp.
References bpp::AlphabetState::getNum(), bpp::Alphabet::getNumberOfChars(), bpp::Alphabet::getNumberOfTypes(), bpp::Alphabet::getStateAt(), and bpp::Alphabet::intToChar().
|
static |
This checks that all characters in the alphabet are coded by a string of same length.
This function performs the same work as the previous one, but deals with pointers instead of reference. This may be more convenient since we often use pointers on alphabets.
alphabet | a pointer toward the alphabet to check. |
Definition at line 73 of file AlphabetTools.cpp.
|
static |
In case that all states in the given alphabet have a string description of same length, send this length; e.g. 3 for codon alphabets.
alphabet | The alphabet to analyse. |
Definition at line 80 of file AlphabetTools.cpp.
References bpp::Alphabet::intToChar().
Referenced by bpp::StringSequenceTools::codeSequence().
|
static |
In case that all states in the given alphabet have a string description of same length, send this length; e.g. 3 for codon alphabets.
This function performs the same work as the previous one, but deals with pointers instead of reference. This may be more convenient since we often use pointers on alphabets.
alphabet | a pointer toward the alphabet to analyse. |
Definition at line 89 of file AlphabetTools.cpp.
|
static |
Character identification method for sequence's alphabet identification.
Return :
state | The character to test. |
Definition at line 28 of file AlphabetTools.cpp.
References bpp::TextTools::toString().
Referenced by bpp::StringSequenceTools::getAlphabetFromSequence().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 171 of file AlphabetTools.h.
Referenced by bpp::SequenceApplicationTools::getProbabilisticSiteContainer().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 153 of file AlphabetTools.h.
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 135 of file AlphabetTools.h.
Referenced by bpp::CodonSiteTools::fixedDifferences(), bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::GeneticCode::getCodingSequence(), bpp::SequenceApplicationTools::getProbabilisticSiteContainers(), bpp::SequenceApplicationTools::getSiteContainers(), bpp::CodonSiteTools::hasGapOrStop(), bpp::CodonSiteTools::hasStop(), bpp::CodonSiteTools::isMonoSitePolymorphic(), bpp::CodonSiteTools::isSynonymousPolymorphic(), bpp::CodonSiteTools::meanNumberOfSynonymousPositions(), bpp::CodonSiteTools::numberOfNonSynonymousSubstitutions(), bpp::CodonSiteTools::numberOfSubstitutions(), bpp::CodonSiteTools::piNonSynonymous(), bpp::CodonSiteTools::piSynonymous(), bpp::BppOAlphabetIndex1Format::read(), and bpp::BppOAlphabetIndex2Format::read().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 165 of file AlphabetTools.h.
Referenced by bpp::SiteContainerTools::resolveDottedAlignment().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 117 of file AlphabetTools.h.
Referenced by bpp::SequenceTools::complement(), bpp::SequenceTools::getComplement(), bpp::SequenceTools::invertComplement(), bpp::RNY::RNY(), bpp::SequenceTools::RNYslice(), and bpp::SequenceTools::transcript().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 159 of file AlphabetTools.h.
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 111 of file AlphabetTools.h.
Referenced by bpp::SequenceApplicationTools::getAlphabet(), bpp::GeneticCode::getCodingSequence(), and bpp::RNY::getRNY().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 129 of file AlphabetTools.h.
Referenced by bpp::CodonFromProteicAlphabetIndex1::CodonFromProteicAlphabetIndex1(), bpp::CodonFromProteicAlphabetIndex2::CodonFromProteicAlphabetIndex2(), bpp::BppOAlphabetIndex1Format::read(), and bpp::BppOAlphabetIndex2Format::read().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 123 of file AlphabetTools.h.
Referenced by bpp::SequenceTools::complement(), bpp::SequenceTools::getComplement(), bpp::SequenceTools::invertComplement(), bpp::SequenceTools::reverseTranscript(), and bpp::RNY::RNY().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 147 of file AlphabetTools.h.
Referenced by bpp::SequenceApplicationTools::getProbabilisticSiteContainer(), and bpp::SequenceApplicationTools::getSiteContainer().
|
inlinestatic |
alphabet | The alphabet to check. |
Definition at line 141 of file AlphabetTools.h.
|
inlinestatic |
Tell if two characters match according to a given alphabet.
Example (DNA):
* A,T: false * A,A: true * A,N: true * A,Y: false * N,Y: true * N,N: true *
alphabet | The alphabet to use. |
i | First character to check. |
j | Secondt character to check. |
Definition at line 191 of file AlphabetTools.h.
References bpp::VectorTools::vectorIntersection().
Referenced by bpp::SequenceTools::findFirstOf().
|
static |
Definition at line 39 of file AlphabetTools.h.
Referenced by bpp::NexusIOSequence::appendAlignmentFromStream().
Definition at line 34 of file AlphabetTools.h.
Referenced by bpp::StringSequenceTools::getAlphabetFromSequence().
|
static |
Definition at line 36 of file AlphabetTools.h.
|
static |
Definition at line 38 of file AlphabetTools.h.
Referenced by bpp::StringSequenceTools::getAlphabetFromSequence().
Definition at line 35 of file AlphabetTools.h.
Referenced by bpp::StringSequenceTools::getAlphabetFromSequence().
|
static |
Definition at line 37 of file AlphabetTools.h.