|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
69 throw std::runtime_error(
"Invalid nucleic acid." );
86 throw std::runtime_error(
"Invalid twobit value." );
98 for(
size_t i = 0; i < sequence.size(); ++i ) {
110 result.reserve( vec.
size() );
112 for(
size_t i = 0; i < vec.
size(); ++i ) {
127 std::string res =
"";
128 for(
size_t i = 0; i < vec.
data_size(); ++i ) {
155 auto tmp = cpy & 0x3;
182 std::reverse( res.begin(), res.end() );
TwobitVector::ValueType translate_from_nucleic_acid(char site)
Translate a char into TwobitVector::ValueType.
WordType const & data_at(size_t index) const
Return a single word of the vector.
size_t data_size() const
Return the number of words (of type WordType) that are used to store the values in the vector.
uint64_t WordType
Underlying word type for the bitvector.
std::string to_nucleic_acids(TwobitVector const &vec)
Turn a TwobitVector into its string representation of nucleic acids.
std::string bitstring(TwobitVector const &vec)
Return a string with a bit-representation of a TwobitVector.
ValueType
Value Type enumeration for the elements of a TwobitVector.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
static const size_t kValuesPerWord
Constant that holds the number of values (of tyoe ValueType) that are stored in a single word in the ...
char translate_to_nucleic_acid(TwobitVector::ValueType value)
Translate a TwobitVector::ValueType into its char representation.
size_t size() const
Return the size of the vector, that is, how many values (of type ValueType) it currently holds.
TwobitVector from_nucleic_acids(std::string const &sequence)
Turn a string of nucleic acids into a TwobitVector.