|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_SEQUENCE_FUNCTIONS_LABELS_H_
2 #define GENESIS_SEQUENCE_FUNCTIONS_LABELS_H_
38 #include <unordered_map>
39 #include <unordered_set>
241 std::unordered_set<std::string>
const&
labels,
248 #endif // include guard
bool is_valid_label(std::string const &label)
Check whether a given string is a valid label for a Sequence.
Sequence const * find_sequence(SequenceSet const &set, std::string const &label)
Return a pointer to a Sequence with a specific label, or nullptr iff not found.
void filter_by_label_list(SequenceSet &set, std::unordered_set< std::string > const &labels, bool invert)
Remove all those Sequences from a SequenceSet whose labels are in the given list.
HashingFunctions
List of the currently implemented hashing functions.
bool has_valid_labels(SequenceSet const &set)
Check whether all Sequences in a SequenceSet have valid labels.
std::string sanitize_label(std::string const &label)
Sanitize a label by replacing all invalid characters with underscores.
std::unordered_set< std::string > labels(SequenceSet const &set)
Return a set of all labels of the SequenceSet.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Store a set of Sequences.
void relabel_with_hash(Sequence &seq, utils::HashingFunctions hash_function)
Relabel the Sequence using the hash digest of its sites.
bool has_unique_labels(SequenceSet const &set, bool case_sensitive)
Return true iff all labels of the Sequences in the SequenceSet are unique.
void sanitize_labels(SequenceSet &set)
Sanitize the labels of all Sequences in the SequenceSet by replacing all invalid characters with unde...
std::pair< std::string, size_t > guess_sequence_abundance(Sequence const &sequence)
Guess the abundance of a Sequence, using it's label.
std::unordered_map< std::string, std::string > attributes
LabelAttributes label_attributes(Sequence const &sequence)
Get the attributes list (semicolons-separated) from a Sequence.
bool has_valid_label(Sequence const &seq)
Check whether a Sequence has a valid label.