template<size_t span = KMER_DEFAULT_SPAN>
class gatb::core::kmer::impl::Kmer< span >::KmerCanonical
Kmer type for the ModelCanonical class.
This class represent canonical kmers, ie. a value that is the minimal value of the forward kmer and its reverse complement.
The implementation maintains a table of two Type objects, the first one for the forward kmer and the second one for the reverse complement.
We can know which object is the canonical one (ie. the minimum) by using the method value.* One can also retrieve the strand used for the canonical form with the method strand.
It is still possible to get the forward kmer with forward and the reverse complement with revcomp.
NOTE: this class is not intended to be used directly by end users. Instead, the typedef definition ModelCanonical::Kmer should be preferred.
Example of use:
ModelCanonical model (kmerSize);
std::cout << std::endl;
std::cout << "-------------------- CANONICAL --------------------" << std::endl;
std::cout <<
"kmer value is: " << kmer.
value() << std::endl;
std::cout << "kmer string is: " << model.toString(kmer.value()) << std::endl;
std::cout << "forward value is: " << kmer.forward() << std::endl;
std::cout << "forward string is: " << model.toString(kmer.forward()) << std::endl;
std::cout << "revcomp value is: " << kmer.revcomp() << std::endl;
std::cout << "revcomp string is: " << model.toString(kmer.revcomp()) << std::endl;
std::cout <<
"used strand is : " <<
toString(kmer.strand()) << std::endl;