Commit 8c69437e authored by Carsten Kemena's avatar Carsten Kemena

add test window/match parameter

parent 1e544b5c
......@@ -82,70 +82,6 @@ words2arrangement(multiset<pair<size_t, std::pair<unsigned short, bool> > > &wor
}
return arrangement;
}
/*
BSDL::DomainArrangement<BSDL::Domain>
words2arrangement2(multiset<pair<size_t, std::pair<unsigned short, bool> > > &wordList, unsigned int max_dist, float min_count)
{
struct Helper
{
size_t start;
size_t end;
float score;
Helper(size_t s, size_t e, size_t v) : start(s), end(e), score(v)
{}
};
BSDL::DomainArrangement<BSDL::Domain> arrangement;
std::map<unsigned short, Helper> counter;
auto itEnd = wordList.end();
for (auto it = wordList.begin(); it != itEnd; ++it)
{
auto helper = counter.find(it->second.first);
if (helper != counter.end())
{
// the last hit to this domain was too far away.
if ((it->first - helper->second.end) > max_dist)
{
if ((helper->second.score*100.0/(helper->second.end-helper->second.start)) >= min_count)
//if (helper->second.score >= min_count)
{
string acc = to_string(it->second.first);
while (acc.size() < 5)
acc = "0" + acc;
arrangement.emplace_back("PF" + acc, helper->second.start, helper->second.end, (helper->second.end-helper->second.start)/helper->second.score);
}
helper->second.start=helper->second.end = it->first;
helper->second.score = 1;
}
else
{
if (it->first != helper->second.end)
{
++helper->second.score;
helper->second.end = it->first;
}
}
}
else
counter.emplace(std::piecewise_construct, std::forward_as_tuple(it->second.first), std::forward_as_tuple(it->first, it->first, 1));
}
std::sort(arrangement.begin(), arrangement.end());
std::set<size_t> toDelete;
for (auto i = 1; i<arrangement.size(); ++i)
{
if ((arrangement[i-1].end() > arrangement[i].start()) && ((arrangement[i-1].end() - arrangement[i].start()) > 10))
{
if (arrangement[i-1].evalue() < arrangement[i].evalue())
arrangement.erase(arrangement.begin() + (i-1));
else
arrangement.erase(arrangement.begin() + i);
--i;
}
}
return arrangement;
}
*/
/**
* \brief Reads RADIANT database.
......@@ -297,8 +233,11 @@ main(int argc, char const *argv[])
fs::path detailedFile;
po::options_description hiddenO("Hidden options");
int w, m;
hiddenO.add_options()
("detailed", po::value<fs::path>(&detailedFile), "The output file for the detailed results")
("window_size", po::value<int>(&w), "The window size")
("match", po::value<int>(&m), "The number of matches required")
;
allOpts.add(general).add(outputO).add(translateO).add(hiddenO);
......@@ -396,9 +335,10 @@ main(int argc, char const *argv[])
for (size_t i = 0; i< seqSet.size(); ++i)
{
auto &assignment = assignments[i];
auto da = words2arrangement(assignment, 10, 12);
if (da.size() == 0)
da = words2arrangement(assignment, 5, 7);
auto da = words2arrangement(assignment, m, w);
//auto da = words2arrangement(assignment, 10, 12);
//if (da.size() == 0)
//da = words2arrangement(assignment, 5, 7);
if (pfamLike)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment