6 #include "CompressedSequence.hpp" 7 #include "CompressedCoverage.hpp" 26 Unitig() : coveragesum(0) {}
27 Unitig(
const char* s,
bool full =
false) : seq(s) { initializeCoverage(full); }
29 void initializeCoverage(
bool full) {
31 const size_t ssz = seq.size(), k = Kmer::k;
35 ccov = CompressedCoverage();
36 ccov.initialize(ssz >= k ? ssz - k + 1 : 0, full);
39 void cover(
size_t start,
size_t end) {
41 ccov.cover(start, end);
43 if (end < start) swap(start, end);
45 __sync_add_and_fetch(&coveragesum, end - start + 1);
48 inline size_t numKmers()
const {
return seq.size( ) - Kmer::k + 1; }
49 inline size_t length()
const {
return seq.size(); }
59 CompressedCoverage ccov;
60 CompressedSequence seq;
71 Unitig() : coveragesum(0) {}
72 Unitig(
const char* s,
bool full =
false) : seq(s) { initializeCoverage(full); }
74 void initializeCoverage(
bool full) {
76 const size_t ssz = seq.size(), k = Kmer::k;
80 ccov = CompressedCoverage();
81 ccov.initialize(ssz >= k ? ssz - k + 1 : 0, full);
84 void cover(
size_t start,
size_t end) {
86 ccov.cover(start, end);
88 if (end < start) swap(start, end);
90 __sync_add_and_fetch(&coveragesum, end - start + 1);
93 inline size_t numKmers()
const {
return seq.size( ) - Kmer::k + 1; }
94 inline size_t length()
const {
return seq.size(); }
96 inline const void*
getData()
const {
return nullptr; }
97 inline void*
getData() {
return nullptr; }
101 CompressedCoverage ccov;
102 CompressedSequence seq;
106 #endif // BFG_CONTIG_HPP T data
Data associated with the unitigs of the graph.
Definition: Unitig.hpp:62
Interface for the class Kmer:
const T * getData() const
Return a constant pointer to the data associated with the unitig.
Definition: Unitig.hpp:54
Represent a unitig which is a vertex of the Compacted de Bruijn graph.
Definition: Unitig.hpp:22