#include "Common/Sequence.h" #include "BloomDBG/bloom-dbg.h" #include "BloomDBG/MaskedKmer.h" #include "BloomDBG/RollingHash.h" #include "BloomDBG/RollingBloomDBG.h" #include "lib/bloomfilter/BloomFilter.hpp" #include #include using namespace std; typedef RollingBloomDBG Graph; typedef graph_traits GraphTraits; /* each vertex is represented by * std::pair>, where 'string' is the * k-mer and 'vector' is the associated set of * hash values */ typedef graph_traits::vertex_descriptor V; /** Convert a path in the de Bruijn graph to a sequence */ TEST(BloomDBG, pathToSeq) { const string inputSeq = "ACGTAC"; const string spacedSeed = "10001"; const unsigned k = 5; const unsigned numHashes = 2; MaskedKmer::setLength(k); MaskedKmer::setMask(spacedSeed); Path path = BloomDBG::seqToPath(inputSeq, k, numHashes); ASSERT_EQ(2U, path.size()); string outputSeq = BloomDBG::pathToSeq(path, k); ASSERT_EQ("ACNNAC", outputSeq); }