#include "aligns/KmerAlignCore.h" #include "analysis/DNAVector.h" #include "analysis/KmerTable.h" #include "util/mutil.h" #include "analysis/NonRedKmerTable.h" int K = 12; const vecDNAVector * pAll = NULL; DNAVector dummy; KmerSequence::KmerSequence(int k, const vecDNAVector * p) { m_count = 0; K = k; pAll = p; } int KmerSequence::GetK() const { return K; } long long KmerSequence::BasesToNumber(const DNAVector & d, int off) { long long i; dummy = d; KmerEntry dummyKmer; dummyKmer.SetIndex(-1, off); //cout << "Searching " << tmp << endl; long long ret = BinSearch(m_kmers, dummyKmer); return ret; } long long KmerSequence::BasesToNumberCount(int & count, const DNAVector & d, int off) { long long i; dummy = d; KmerEntry dummyKmer; dummyKmer.SetIndex(-1, off); //cout << "Searching " << tmp << endl; long long ret = BinSearch(m_kmers, dummyKmer); //cout << "ret=" << ret << endl; count = 0; if (ret < 0) return -1; for (i=ret; i you_str[i]) return false; if (me_str[i] < you_str[i]) return true; } return false; } void KmerSequence::Read(const string & fileName) { int ver; CMReadFileStream f; f.Open(fileName.c_str()); long long s; f.Read(ver); f.Read(s); f.Read(K); m_kmers.resize(s); for (int i=0; i