|
bpp-seq
2.1.0
|
Utilitary functions dealing with both sites and sequences. More...
#include <Bpp/Seq/SymbolListTools.h>
Inheritance diagram for bpp::SymbolListTools:Public Member Functions | |
| SymbolListTools () | |
| virtual | ~SymbolListTools () |
Static Public Member Functions | |
| static void | getCounts (const SymbolList &list, std::map< int, size_t > &counts) |
| Count all states in the list. More... | |
| static void | getCounts (const SymbolList &list1, const SymbolList &list2, std::map< int, std::map< int, size_t > > &counts) throw (DimensionException) |
| Count all pair of states for two lists of the same size. More... | |
| static void | getCounts (const SymbolList &list, std::map< int, double > &counts, bool resolveUnknowns) |
| Count all states in the list, optionaly resolving unknown characters. More... | |
| static void | getCounts (const SymbolList &list1, const SymbolList &list2, std::map< int, std::map< int, double > > &counts, bool resolveUnknowns) throw (DimensionException) |
| Count all pair of states for two lists of the same size, optionaly resolving unknown characters. More... | |
| static void | getFrequencies (const SymbolList &list, std::map< int, double > &frequencies, bool resolveUnknowns=false) |
| Get all states frequencies in the list. More... | |
| static void | getFrequencies (const SymbolList &list1, const SymbolList &list2, std::map< int, std::map< int, double > > &frequencies, bool resolveUnknowns=false) throw (DimensionException) |
| Get all state pairs frequencies for two lists of the same size.. More... | |
| static double | getGCContent (const SymbolList &list, bool ignoreUnresolved=true, bool ignoreGap=true) throw (AlphabetException) |
| Get the GC content of a symbol list. More... | |
| static size_t | getNumberOfDistinctPositions (const SymbolList &l1, const SymbolList &l2) throw (AlphabetMismatchException) |
| Get the number of distinct positions. More... | |
| static size_t | getNumberOfPositionsWithoutGap (const SymbolList &l1, const SymbolList &l2) throw (AlphabetMismatchException) |
| Get the number of positions without gap. More... | |
| static void | changeGapsToUnknownCharacters (SymbolList &l) |
| Change all gap elements to unknown characters. More... | |
| static void | changeUnresolvedCharactersToGaps (SymbolList &l) |
| Change all unknown characters to gap elements. More... | |
Utilitary functions dealing with both sites and sequences.
Definition at line 56 of file SymbolListTools.h.
|
inline |
Definition at line 59 of file SymbolListTools.h.
|
inlinevirtual |
Definition at line 60 of file SymbolListTools.h.
|
static |
Change all gap elements to unknown characters.
| l | The input list of characters. |
Definition at line 180 of file SymbolListTools.cpp.
References bpp::SymbolList::getAlphabet(), bpp::SymbolList::getAlphabet(), and bpp::SymbolList::size().
|
static |
Change all unknown characters to gap elements.
| l | The input list of characters. |
Definition at line 189 of file SymbolListTools.cpp.
References bpp::SymbolList::getAlphabet(), bpp::SymbolList::getAlphabet(), and bpp::SymbolList::size().
|
inlinestatic |
Count all states in the list.
| list | The list. |
| counts | The output map to store the counts (existing counts will be incremented). |
Definition at line 70 of file SymbolListTools.h.
References bpp::SymbolList::getContent(), and bpp::SymbolList::getContent().
Referenced by bpp::SiteTools::getNumberOfDistinctCharacters(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SiteTools::isParsimonyInformativeSite(), and bpp::CodonSiteTools::numberOfNonSynonymousSubstitutions().
|
inlinestatic |
Count all pair of states for two lists of the same size.
NB: The two lists do node need to share the same alphabet! The states of the first list will be used as the first index in the output, and the ones from the second list as the second index.
| list1 | The first list. |
| list2 | The second list. |
| counts | The output map to store the counts (existing counts will be incremented). |
Definition at line 90 of file SymbolListTools.h.
References bpp::SymbolList::size(), bpp::SymbolList::size(), bpp::SymbolList::size(), bpp::SymbolList::size(), and bpp::SymbolList::size().
|
static |
Count all states in the list, optionaly resolving unknown characters.
For instance, in DNA, N will be counted as A=1/4,T=1/4,C=1/4,G=1/4.
| list | The list. |
| counts | The output map to store the counts (existing ocunts will be incremented). |
| resolveUnknowns | Tell is unknown characters must be resolved. For instance, in DNA, N will be counted as A=1/4,T=1/4,C=1/4,G=1/4. |
Definition at line 51 of file SymbolListTools.cpp.
References bpp::SymbolList::getAlphabet(), bpp::SymbolList::getContent(), bpp::SymbolList::getContent(), bpp::SymbolList::getContent(), and bpp::SymbolList::getContent().
|
static |
Count all pair of states for two lists of the same size, optionaly resolving unknown characters.
For instance, in DNA, N will be counted as A=1/4,T=1/4,C=1/4,G=1/4.
NB: The two lists do node need to share the same alphabet! The states of the first list will be used as the first index in the output, and the ones from the second list as the second index.
| list1 | The first list. |
| list2 | The second list. |
| counts | The output map to store the counts (existing ocunts will be incremented). |
| resolveUnknowns | Tell is unknown characters must be resolved. For instance, in DNA, N will be counted as A=1/4,T=1/4,C=1/4,G=1/4. |
Definition at line 73 of file SymbolListTools.cpp.
|
static |
Get all states frequencies in the list.
| list | The list. |
| resolveUnknowns | Tell is unknown characters must be resolved. For instance, in DNA, N will be counted as A=1/4,T=1/4,C=1/4,G=1/4. |
| frequencies | The output map with all states and corresponding frequencies. Existing frequencies will be erased if any. |
Definition at line 96 of file SymbolListTools.cpp.
References bpp::SymbolList::size().
Referenced by bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::SiteContainerTools::getConsensus(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::CodonSiteTools::meanNumberOfSynonymousPositions(), bpp::CodonSiteTools::piNonSynonymous(), bpp::CodonSiteTools::piSynonymous(), bpp::SiteContainerTools::removeGapSites(), and bpp::SiteContainerTools::removeGapSites().
|
static |
Get all state pairs frequencies for two lists of the same size..
| list1 | The first list. |
| list2 | The second list. |
| resolveUnknowns | Tell is unknown characters must be resolved. For instance, in DNA, N will be counted as A=1/4,T=1/4,C=1/4,G=1/4. |
| frequencies | The output map with all state pairs and corresponding frequencies. Existing frequencies will be erased if any. |
Definition at line 107 of file SymbolListTools.cpp.
|
static |
Get the GC content of a symbol list.
| list | The list. |
| ignoreUnresolved | Do not count unresolved states. Otherwise, weight by each state probability in case of ambiguity (e.g. the R state counts for 0.5). |
| ignoreGap | Do not count gaps in total. |
| AlphabetException | If the list is not made of nucleotide states. |
Definition at line 119 of file SymbolListTools.cpp.
|
static |
Get the number of distinct positions.
The comparison in achieved from position 0 to the minimum size of the two vectors.
| l1 | SymbolList 1. |
| l2 | SymbolList 2. |
| AlphabetMismatchException | if the two lists have not the same alphabet type. |
Definition at line 158 of file SymbolListTools.cpp.
|
static |
Get the number of positions without gap.
The comparison in achieved from position 0 to the minimum size of the two vectors.
| l1 | SymbolList 1. |
| l2 | SymbolList 2. |
| AlphabetMismatchException | if the two lists have not the same alphabet type. |
Definition at line 169 of file SymbolListTools.cpp.