|
A library for working with phylogenetic and population genetic data.
v0.27.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_SEQUENCE_FUNCTIONS_SIGNATURE_SPECIFICATIONS_H_
2 #define GENESIS_SEQUENCE_FUNCTIONS_SIGNATURE_SPECIFICATIONS_H_
142 return unknown_char_behavior_;
154 return is_nucleic_acids_;
165 return index_lookup_[c];
171 std::vector<std::string>
const&
kmer_list()
const;
196 unknown_char_behavior_ = value;
207 std::string alphabet_;
212 bool is_nucleic_acids_ =
false;
216 mutable std::vector<std::string> kmer_list_;
217 mutable std::vector<std::string> rev_comp_list_;
218 mutable std::vector<size_t> rev_comp_map_;
219 mutable std::vector<size_t> rev_comp_indices_;
225 #endif // include guard
size_t kmer_list_size() const
std::vector< std::string > const & kmer_reverse_complement_list() const
SignatureSpecifications & operator=(SignatureSpecifications const &)=default
Default copy assignment.
static const size_t InvalidCharIndex
Value that is used to indicate an invalid (non-alphabet) char when using index_of().
~SignatureSpecifications()=default
Default destructor.
SignatureSpecifications & unknown_char_behavior(UnknownCharBehavior value)
UnknownCharBehavior unknown_char_behavior() const
size_t kmer_reverse_complement_list_size(bool with_palindromes=true) const
std::vector< std::string > const & kmer_list() const
Return the list of all possible k-mers for the given k and alphabet.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
@ kThrow
Throw an exception.
SignatureSpecifications()=default
bool is_nucleic_acids() const
Speedup and shortcut to test whether the alphabet() is "ACGT".
std::string const & alphabet() const
std::vector< size_t > const & kmer_reverse_complement_indices() const
Get the indices for each kmer in kmer_list() to its reverse complement in the list.
UnknownCharBehavior
List of policies to decide what to do when a char that is not part of the alphabet occurs while count...
size_t char_index(char c) const
Return the index of a char within the alphabet().
Specifications for calculating signatures (like k-mer counts) from Sequences.
@ kSkip
Simply ignore the char by skipping it.
std::vector< size_t > const & kmer_combined_reverse_complement_map() const
Get a map from indices of kmer_list() and signature_counts() vectors to a smaller list which combines...