8 const float MAX_WORD_COUNT_DROP = 1;
\r
10 void SortDescending(const vector<float> &Values, vector<unsigned> &Order);
\r
11 bool GlobalAlign(const SeqData &Query, const SeqData &Target, string &Path);
\r
12 double GetFractIdGivenPath(const byte *A, const byte *B, const char *Path);
\r
13 void USort(const SeqData &Query, const SeqDB &DB, vector<float> &WordCounts,
\r
14 vector<unsigned> &Order);
\r
16 void AddTargets(SeqDB &DB, const SeqData &Query, set<unsigned> &TargetIndexes)
\r
18 const unsigned SeqCount = DB.GetSeqCount();
\r
22 vector<float> WordCounts;
\r
23 vector<unsigned> Order;
\r
24 USort(Query, DB, WordCounts, Order);
\r
25 asserta(SIZE(Order) == SeqCount);
\r
26 unsigned TopSeqIndex = Order[0];
\r
27 float TopWordCount = WordCounts[TopSeqIndex];
\r
28 for (unsigned i = 0; i < SeqCount; ++i)
\r
30 unsigned SeqIndex = Order[i];
\r
31 float WordCount = WordCounts[SeqIndex];
\r
32 if (TopWordCount - WordCount > MAX_WORD_COUNT_DROP)
\r
34 TargetIndexes.insert(SeqIndex);
\r