|
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.
void SymbolListTools::getCounts |
( |
const SymbolList & |
list, |
|
|
std::map< int, double > & |
counts, |
|
|
bool |
resolveUnknowns |
|
) |
| |
|
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.
- Author
- J. Dutheil
- Parameters
-
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. |
- Returns
- A map with all states and corresponding counts.
Definition at line 51 of file SymbolListTools.cpp.
References bpp::Alphabet::getAlias(), bpp::SymbolList::getAlphabet(), and bpp::SymbolList::getContent().
void SymbolListTools::getCounts |
( |
const SymbolList & |
list1, |
|
|
const SymbolList & |
list2, |
|
|
std::map< int, std::map< int, double > > & |
counts, |
|
|
bool |
resolveUnknowns |
|
) |
| |
throw | ( | DimensionException |
| ) | | |
|
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.
- Author
- J. Dutheil
- Parameters
-
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. |
- Returns
- A map with all states and corresponding counts.
Definition at line 73 of file SymbolListTools.cpp.