Commit b0ed1686 authored by Carsten Kemena's avatar Carsten Kemena

removed commented code

parent 1777b873
......@@ -30,9 +30,6 @@ DBAccess::DBAccess(const fs::path &prefix)
open(prefix);
}
void DBAccess::open(const fs::path &prefix)
{
// open connection to database
......
......@@ -46,85 +46,11 @@ DBCreator::shortenEvalue_(std::string &evalue)
}
}
/*
void
DBCreator::cleanDA_(BSDL::DomainArrangement<BSDL::Domain> &da)
{
// in case of large overlaps of domains only one domain is kept. The importance by database is: Pfam, Superfamily, Smart, Prosite, Gene3dD
std::sort (da.begin(), da.end(), [](const BSDL::Domain &a, const BSDL::Domain &b){return a.start() < b.start();} );
for (const string &keepName : querySet)
{
set<size_t> toDelete;
bool changed = true;
while (changed)
{
size_t nDomains = da.size();
for (size_t i=1; i<nDomains; ++i)
{
BSDL::Domain &dom1 = da[i-1];
BSDL::Domain &dom2 = da[i];
if ((dom1.end() > dom2.start()+this->filter_threshold_) && ((dom1.accession() == keepName) || (dom2.accession() == keepName)))
{
if (dom1.accession() != dom2.accession())
toDelete.insert(dom1.accession() == keepName ? i : i-1);
}
}
for (auto it=toDelete.rbegin(); it!=toDelete.rend(); ++it)
da.erase(da.begin() + (*it));
if (toDelete.empty())
changed = false;
toDelete.clear();
}
}
vector<string> importance = {"PF", "SS", "SM", "PS", "G3"};
for (const string &prefix : importance)
{
vector<size_t> toDelete;
bool changed = true;
while (changed)
{
size_t nDomains = da.size();
for (size_t i=1; i<nDomains; ++i)
{
BSDL::Domain &dom1 = da[i-1];
BSDL::Domain &dom2 = da[i];
string pre1 = dom1.accession().substr(0,2);
string pre2 = dom2.accession().substr(0,2);
if ((dom1.end() > dom2.start()+10) && ((pre1 == prefix) || (pre2 == prefix)))
{
if (pre1 == pre2)
{
if ((dom1.end() - dom1.start()) < (dom2.end() - dom2.start()))
toDelete.push_back(i);
else
toDelete.push_back(i-1);
}
else
toDelete.push_back(pre1 == prefix ? i : i-1);
}
}
for (int i=toDelete.size()-1; i>=0; --i)
da.erase(da.begin() + toDelete[i]);
if (toDelete.empty())
changed = false;
toDelete.clear();
}
}
}
*/
void
DBCreator::addDomainArrangement_(BSDL::DomainArrangement<BSDL::Domain> &da, const std::string &proteinID, const std::string &proteinLength)
{
sort(da.begin(), da.end());
/*if (this->performFiltering_)
{
std::set<string> empty;
this->cleanDA_(da, empty);
}*/
string id = da[0].accession();
stringstream stream;
stream << std::scientific << da[0].evalue();
......@@ -150,8 +76,6 @@ DBCreator::addDomainArrangement_(BSDL::DomainArrangement<BSDL::Domain> &da, cons
void
DBCreator::readInterPro(const fs::path &interProFile, const std::string &includeDB)
{
//auto itDBEnd = dbNames.end();
AlgorithmPack::Input inS;
inS.open(interProFile);
......
......@@ -57,9 +57,6 @@ class DBCreator
void static
shortenEvalue_(std::string &evalue);
//void
//cleanDA_(BSDL::DomainArrangement<BSDL::Domain> &da, const std::set<std::string> &querySet);
/**
* @brief Adds a single domain Arrangement to the database
*
......@@ -77,18 +74,6 @@ class DBCreator
//filter_threshold_ = 10;
}
/* void
filter(bool doFilter)
{
performFiltering_ = doFilter;
}
void
threshold(int t)
{
filter_threshold_ = t;
}*/
/**
* @brief Reads a standard domain annotation file.
*
......
......@@ -119,7 +119,7 @@ main(int argc, char *argv[])
{
if ((daFiles.size() > 0) and (!seqFiles.empty()) and (seqFiles.size() != daFiles.size()))
{
cerr << "Error! If you provide a sequence file, you have to provide one for each annotation file.";
cerr << "Error! If you provide a sequence file, you have to provide one for each annotation file.\n";
exit(1);
}
}
......
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