Commit 0ebcff18 authored by Carsten Kemena's avatar Carsten Kemena

restructuring code

parent ba130381
......@@ -84,7 +84,7 @@ set(sequenceCPP SeqFunctions.cpp)
PREPEND(sequenceCPP "${CMAKE_CURRENT_SOURCE_DIR}/src/sequence" ${sequenceCPP})
# The domain module
set(domainCPP Domain.cpp DomainExt.cpp PfamDomain.cpp SFDomain.cpp DomainArrangementSet.cpp DomainArrangement.cpp )
set(domainCPP Domain.cpp DomainExt.cpp PfamDomain.cpp SFDomain.cpp DomainArrangementSet.cpp DomainArrangement.cpp DASetReader.cpp)
PREPEND(domainCPP "${CMAKE_CURRENT_SOURCE_DIR}/src/domain" ${domainCPP})
# external_interfaces module
......
#include "DASetReader.hpp"
#include "InputStrategies/DASetInputStrategy.hpp"
#include "InputStrategies/PfamReader.hpp"
#include "InputStrategies/RADIANTReader.hpp"
#include "InputStrategies/InterProTSVReader.hpp"
namespace BioSeqDataLib
{
}
\ No newline at end of file
......@@ -41,12 +41,17 @@
#include <memory>
#include <string>
#include "PfamDomain.hpp"
#include "DomainArrangementSet.hpp"
#include "DASetInputStrategies.hpp"
#include "InputStrategies/DASetInputStrategy.hpp"
#include "InputStrategies/PfamReader.hpp"
#include "InputStrategies/RADIANTReader.hpp"
#include "InputStrategies/InterProTSVReader.hpp"
#include <boost/filesystem.hpp>
#include "../external/Input.hpp"
#include "PfamDomain.hpp"
namespace BioSeqDataLib
{
......@@ -117,7 +122,7 @@ class DASetReader
void
loadDefaultStrategies()
{
std::cout << "YOU SHOULD NOT SEE THIS\n";
}
......@@ -137,6 +142,24 @@ class DASetReader
}
};
template<>
void
inline DASetReader<PfamDomain>::loadDefaultStrategies()
{
using strategy = DASetInputStrategy<PfamDomain>;
addStrategy(std::unique_ptr<strategy>(new PfamReader<PfamDomain>));
}
template<>
void
inline DASetReader<Domain>::loadDefaultStrategies()
{
using strategy = DASetInputStrategy<Domain>;
addStrategy(std::unique_ptr<strategy>(new PfamReader<Domain>));
addStrategy(std::unique_ptr<strategy>(new RADIANTReader<Domain>));
addStrategy(std::unique_ptr<strategy>(new InterProTSVReader<Domain>));
}
}
......
......@@ -10,7 +10,7 @@
namespace BioSeqDataLib
{
/*
std::string
getFormatString(const DomainFileFormat &format)
......@@ -36,59 +36,7 @@ getFormatString(const DomainFileFormat &format)
}
return "unknown";
}
// <seq id> <alignment start> <alignment end> <envelope start> <envelope end> <hmm acc> <hmm name> <type> <hmm start> <hmm end> <hmm length> <bit score> <E-value> <significance> <clan>
template<>
void
DomainArrangementSet<Domain>::pfamTokens2Domain_(std::string &&acc, const std::vector<std::string> &tokens, DomainArrangement<Domain> &da)
{
da.emplace_back(acc, stoul(tokens[1])-1, stoul(tokens[2])-1, stod(tokens[12]));
}
template<>
void
DomainArrangementSet<DomainExt>::pfamTokens2Domain_(std::string &&acc, const std::vector<std::string> &tokens, DomainArrangement<DomainExt> &da)
{
da.emplace_back(acc, tokens[6], std::stoul(tokens[1])-1, std::stoul(tokens[2])-1, std::stoul(tokens[3])-1, std::stoul(tokens[4])-1, std::stoul(tokens[8])-1, std::stoul(tokens[9])-1, std::stoul(tokens[10]), std::stod(tokens[11]), std::stod(tokens[12]));
}
template<>
void
DomainArrangementSet<PfamDomain>::pfamTokens2Domain_(std::string &&acc, const std::vector<std::string> &tokens, DomainArrangement<PfamDomain> &da)
{
//accession, std::string name, size_t seqStart, size_t seqEnd, size_t envStart, size_t envEnd, size_t hmmStart, size_t hmmEnd, size_t hmm_length, double bit_score, double evalue, double significance, std::string clan, std::string type
std::string clan = (tokens[14] == "No_clan") ? "" : tokens[14];
da.emplace_back(acc, tokens[6], std::stoul(tokens[1])-1, std::stoul(tokens[2])-1, std::stoul(tokens[3])-1, std::stoul(tokens[4])-1, std::stoul(tokens[8])-1, std::stoul(tokens[9])-1, std::stoul(tokens[10]), std::stod(tokens[11]), std::stod(tokens[12]), std::stod(tokens[13]), clan, tokens[7]);
}
template<>
void
DomainArrangementSet<Domain>::radiantTokens2Domain_(std::string &&acc, const std::vector<std::string> &tokens, DomainArrangement<Domain> &da)
{
da.emplace_back(acc, stoul(tokens[1])-1, stoul(tokens[2])-1, -1);
}
/*
template<>
void
DomainArrangementSet<DomainExt>::radiantTokens2Domain_(std::string &&acc, const std::vector<std::string> &tokens, DomainArrangement<DomainExt> &da)
{
da.emplace_back(acc, tokens[6], std::stoul(tokens[1])-1, std::stoul(tokens[2])-1, std::stoul(tokens[1])-1, std::stoul(tokens[2])-1, std::stoul(tokens[8])-1, std::stoul(tokens[9])-1, std::stoul(tokens[10]), std::stod(tokens[11]), std::stod(tokens[12]));
}
template<>
void
DomainArrangementSet<PfamDomain>::radiantTokens2Domain_(std::string &&acc, const std::vector<std::string> &tokens, DomainArrangement<PfamDomain> &da)
{
//accession, std::string name, size_t seqStart, size_t seqEnd, size_t envStart, size_t envEnd, size_t hmmStart, size_t hmmEnd, size_t hmm_length, double bit_score, double evalue, double significance, std::string clan, std::string type
std::string clan = (tokens[14] == "No_clan") ? "" : tokens[14];
da.emplace_back(acc, tokens[6], std::stoul(tokens[1])-1, std::stoul(tokens[2])-1, std::stoul(tokens[3])-1, std::stoul(tokens[4])-1, std::stoul(tokens[8])-1, std::stoul(tokens[9])-1, std::stoul(tokens[10]), std::stod(tokens[11]), std::stod(tokens[12]), std::stod(tokens[13]), clan, tokens[7]);
}*/
*/
/*
* hmmscan tblout format
......@@ -98,6 +46,7 @@ DomainArrangementSet<PfamDomain>::radiantTokens2Domain_(std::string &&acc, const
* # GTP_EFTU PF00009.22 188 1kjz_A - 400 5.9e-43 146.4 0.1 1 1 1.8e-45 1.2e-42 145.5 0.1 3 187 5 193 3 194 0.95 Elongation factor Tu GTP binding domain
*/
/*
template<>
void
DomainArrangementSet<Domain>::hmmTokens2Domain_(std::string &&acc, const std::vector<std::string> &tokens, DomainArrangement<Domain> &da)
......@@ -171,7 +120,7 @@ DomainArrangementSet<Domain>::interProTSVTokens2Domain_(const std::vector<std::s
std::map<std::string, DomainDB> str2db = {{"Gene3D", DomainDB::gene3d}, {"Hamap", DomainDB::hamap}, {"PANTHER", DomainDB::panther}, {"Pfam", DomainDB::pfam}, {"PIRSF", DomainDB::pirsf}, {"PRINTS", DomainDB::prints}, {"ProDom", DomainDB::prodom}, {"ProSitePatterns", DomainDB::prosite}, {"ProSiteProfiles", DomainDB::prosite}, {"SMART", DomainDB::smart}, {"SUPERFAMILY", DomainDB::superfamily}, {"TIGRFAM", DomainDB::tigrfams}};
da.emplace_back(tokens[4], std::stoul(tokens[6]), std::stoul(tokens[7]), (tokens[8][0] == '-') ? 999 : stod(tokens[8]), str2db[tokens[3]]);
}
*/
/**
*
......
......@@ -80,7 +80,7 @@ private:
std::map<std::string, DomainArrangement<DomainType> > arrangements_; // DomainArrangement storage by sequence name
std::map<std::string, int> uniqueIds_; // Stores the unique ids of every domain type.
using DomainArrangement_t = typename std::map<std::string, DomainArrangement<DomainType> >;
/*
template<typename DomainType2>
static void
pfamTokens2Domain_(std::string &&acc __attribute__((unused)), const std::vector<std::string> &tokens __attribute__((unused)), DomainArrangement<DomainType2> &da __attribute__((unused)))
......@@ -183,7 +183,7 @@ private:
// empty function, only exist to make specialization for cases it makes sense
void
_readASSFile(AP::Input &inFile);
*/
public:
using iterator = typename DomainArrangement_t::iterator;
......@@ -462,6 +462,7 @@ DomainArrangementSet<DomainType>::~DomainArrangementSet()
{}
/*
template<typename DomainType>
void
DomainArrangementSet<DomainType>::read(const fs::path &inFileName)
......@@ -520,7 +521,10 @@ DomainArrangementSet<DomainType>::read(const fs::path &inFileName)
});
}
}
*/
/*
template<typename DomainType>
DomainFileFormat
......@@ -561,7 +565,10 @@ DomainArrangementSet<DomainType>::_identifyFormat(AP::Input &inFile)
return DomainFileFormat::unknown;
}
*/
/*
template<typename DomainType>
void
DomainArrangementSet<DomainType>::_readPfamScanOutput(AP::Input &inFile)
......@@ -570,7 +577,7 @@ DomainArrangementSet<DomainType>::_readPfamScanOutput(AP::Input &inFile)
* pfam_scan.pl format
* # <seq id> <alignment start> <alignment end> <envelope start> <envelope end> <hmm acc> <hmm name> <type> <hmm start> <hmm end> <hmm length> <bit score> <E-value> <significance> <clan>
*1kjz_A 5 193 3 194 PF00009.22 GTP_EFTU Domain 3 187 188 145.5 1.2e-42 1 CL0023
*/
*
std::string line;
std::vector<std::string> domainInfo;
std::string accessionNumber;
......@@ -613,7 +620,7 @@ DomainArrangementSet<DomainType>::_readRadiantOutput(AP::Input &inFile)
# <seq id> <match start> <match end> <hmm acc> <hmm name> <type> <clan>
ENSP00000362111.4 25 25 PF00335 Tetraspannin Family CL0347
*/
*
std::string line;
std::vector<std::string> domainInfo;
......@@ -646,7 +653,7 @@ DomainArrangementSet<DomainType>::_readDAMAOutput(AP::Input &inFile)
{
/*
* 2.8e-26 404 508 sp|P20111|ACTN2_CHICK PF00435 1
*/
*
std::string line;
std::vector<std::string> domainInfo;
auto it = uniqueIds_.end();
......@@ -711,7 +718,7 @@ DomainArrangementSet<DomainType>::_readHMMScanDomtblOutput(AP::Input &inFile)
* # target name accession tlen query name accession qlen E-value score bias # of c-Evalue i-Evalue score bias from to from to from to acc description of target
* # ------------------- ---------- ----- -------------------- ---------- ----- --------- ------ ----- --- --- --------- --------- ------ ----- ----- ----- ----- ----- ----- ----- ---- ---------------------
* # GTP_EFTU PF00009.22 188 1kjz_A - 400 5.9e-43 146.4 0.1 1 1 1.8e-45 1.2e-42 145.5 0.1 3 187 5 193 3 194 0.95 Elongation factor Tu GTP binding domain
*/
*
std::string line;
std::vector<std::string> domainInfo;
......@@ -756,7 +763,7 @@ DomainArrangementSet<DomainType>::_readASSFile(AP::Input &inFile)
SCOP Family ID
SCOP domain ID of closest structure (px value)
gnl|Cobs_1.4|Cobs_00004-mRNA-1 0045816 390-451 5.72e-10 1 ICPYECPTNLVYQACGSsCKETCDTVNNSDnlKCTTSTPIEGCFCPEDYIFY-NGSCILKKNC 0.022 44897 57568
*/
*
std::string line;
std::vector<std::string> domainInfo;
......@@ -812,7 +819,7 @@ DomainArrangementSet<DomainType>::_readXDOMFormat(AP::Input &inFile)
}
}
}
*/
template<typename DomainType>
......
/*
* DASetInputStrategies.hpp
*
* Created on: 26 Sep 2019
* Author: Carsten Kemena
* Email: c.kemena[@]uni-muenster.de
* Copyright: 2019
*
* This file is part of BioSeqDataLib.
*
* BioSeqDataLib is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BioSeqDataLib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BioSeqDataLib. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file DASetInputStrategies.hpp
* @author Carsten Kemena (c.kemena@wwu.de)
* @brief File containing the different input strategies for DomainArrangmentReader.
*
* @version 1.0
* @date 2019-11-11
*
* @copyright Copyright (c) 2019
*
*
*/
#ifndef BSDL_DOMAIN_INPUTSTRATEGIES_DASETINPUTSTRATEGY_HPP
#define BSDL_DOMAIN_INPUTSTRATEGIES_DASETINPUTSTRATEGY_HPP
#include "../DomainArrangementSet.hpp"
#include "../../external/Input.hpp"
#include "../../utility/stringHelpers.hpp"
namespace BioSeqDataLib
{
/**
* @brief Interface class for DASetInput strategies
*
* This class is an abstract class describing the functions needed by DASetReader.
*
* @tparam DomainType The domain type.
*/
template<typename DomainType>
class DASetInputStrategy
{
public:
/**
* @brief String denoting the supported format(s)
*
* The idea is to use this so that the application can automatically create a list of supported formats.
*
* @return std::vector<std::string> The format
*/
virtual std::vector<std::string> formats() const = 0;
/**
* @brief Check if this strategie can handle the provided file format.
*
* @param inFile The file to read
* @return true The file format is correct for this strategy.
* @return false This file format is not supported by the given strategy.
*/
virtual bool checkFormat(AlgorithmPack::Input &inFile) const = 0;
/**
* @brief Reads the provides file
*
* @param inFile The file to read
* @param fileName The file name of the inFile parmeter. Only to be used for exception throwing.
* @return DomainArrangementSet<DomainType> The DomainArrangementSet containig all domains from the file.
*/
virtual DomainArrangementSet<DomainType> readFile(AlgorithmPack::Input &inFile, const std::string &fileName) const = 0;
};
}
#endif //
\ No newline at end of file
/**
* @file RADIANTReader.hpp
* @author Carsten Kemena (c.kemena@wwu.de)
* @brief Contains the RADIANTReader class definition.
* @version 1.0
* @date 2019-11-20
*
* @copyright Copyright (c) 2019
*
*/
#ifndef BSDL_DOMAIN_INPUTSTRATEGIES_INTERPROTSVREADER_HPP
#define BSDL_DOMAIN_INPUTSTRATEGIES_INTERPROTSVREADER_HPP
#include "DASetInputStrategy.hpp"
namespace BioSeqDataLib
{
/**
* @brief InterProTSV format reader class
*
* @tparam DomainType The domainType to be used.
*/
template<typename DomainType>
class InterProTSVReader final : public DASetInputStrategy<DomainType>
{
private:
std::map<std::string, DomainDB> str2db_ = {{"Gene3D", DomainDB::gene3d}, {"Hamap", DomainDB::hamap}, {"PANTHER", DomainDB::panther}, {"Pfam", DomainDB::pfam}, {"PIRSF", DomainDB::pirsf}, {"PRINTS", DomainDB::prints}, {"ProDom", DomainDB::prodom}, {"ProSitePatterns", DomainDB::prosite}, {"ProSiteProfiles", DomainDB::prosite}, {"SMART", DomainDB::smart}, {"SUPERFAMILY", DomainDB::superfamily}, {"TIGRFAM", DomainDB::tigrfams}};
public:
std::vector<std::string> formats() const
{
return { "InterProTSV" };
}
bool
checkFormat(AlgorithmPack::Input &inFile) const
{
std::string line;
inFile.seekg(0);
getline(inFile, line);
auto tokens = split(line, "\t");
if ((tokens.size() == 11) || (tokens.size() == 15))
return false;
return true;
}
// 1 Protein Accession (e.g. P51587)
// 4 DB
// 5 ACCESSION
// 7 start
// 8 stop
// 9 evalue
DomainArrangementSet<DomainType>
readFile(AlgorithmPack::Input &inFile, const std::string &fileName) const
{
DomainArrangementSet<DomainType> daSet;
std::string line;
inFile.seekg(0);
int line_counter = 0;
std::string last_name = "";
typename DomainArrangementSet<DomainType>::iterator da;
try
{
++line_counter;
while (getline(inFile, line))
{
if (line.empty() || (line[0] == '#'))
continue;
auto tokens = split(line, "\t", true);
if (tokens[0] != last_name)
{
last_name = tokens[0];
da = daSet.emplace(last_name, DomainArrangement<DomainType>()).first;
}
da->second.emplace_back(tokens[4], std::stoul(tokens[6])-1, std::stoul(tokens[7])-1, (tokens[8][0] == '-') ? -1 : stod(tokens[8]), str2db_.at(tokens[3]));
}
}
catch(...)
{
throw FormatException("Error: Failed to read domain annotation file '" + fileName + "'. Format of file: InterProTSV. Error occured in line: " + std::to_string(line_counter) + "\n");
}
for (auto &arrangement : daSet)
{
sort(arrangement.second.begin(), arrangement.second.end());
}
return daSet;
}
};
} // BioSeqDataLib
#endif // BSDL_DOMAIN_INPUTSTRATEGIES_INTERPROTSVREADER_HPP
\ No newline at end of file
/*
* DASetInputStrategies.hpp
*
* Created on: 26 Sep 2019
* Author: Carsten Kemena
* Email: c.kemena[@]uni-muenster.de
* Copyright: 2019
*
* This file is part of BioSeqDataLib.
*
* BioSeqDataLib is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BioSeqDataLib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BioSeqDataLib. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file DASetInputStrategies.hpp
* @file PfamReader.hpp
* @author Carsten Kemena (c.kemena@wwu.de)
* @brief File containing the different input strategies for DomainArrangmentReader.
*
* @version 0.1
* @date 2019-11-11
* @brief Contains the PfamReader class.
* @version 1.0
* @date 2019-11-20
*
* @copyright Copyright (c) 2019
*
*
*/
#ifndef BSDL_DOMAIN_INPUTSTRATEGIES_PFAMREADER_HPP
#define BSDL_DOMAIN_INPUTSTRATEGIES_PFAMREADER_HPP
#ifndef BSDL_DOMAIN_DASETINPUTSTRATEGY_HPP
#define BSDL_DOMAIN_DASETINPUTSTRATEGY_HPP
#include "DomainArrangementSet.hpp"
#include "../external/Input.hpp"
#include "../utility/stringHelpers.hpp"
#include "DASetInputStrategy.hpp"
namespace BioSeqDataLib
{
/**
* @brief Interface class for DASetInput strategies
*
* This class is an abstract class describing the functions needed by DASetReader.
*
* @tparam DomainType The domain type.
*/
template<typename DomainType>
class DASetInputStrategy
{
public:
/**
* @brief String denoting the supported format(s)
*
* The idea is to use this so that the application can automatically create a list of supported formats.
*
* @return std::vector<std::string> The format
*/
virtual std::vector<std::string> formats() const = 0;
/**
* @brief Check if this strategie can handle the provided file format.
*
* @param inFile The file to read
* @return true The file format is correct for this strategy.
* @return false This file format is not supported by the given strategy.
*/
virtual bool checkFormat(AlgorithmPack::Input &inFile) const = 0;
/**
* @brief Reads the provides file
*
* @param inFile The file to read
* @param fileName The file name of the inFile parmeter. Only to be used for exception throwing.
* @return DomainArrangementSet<DomainType> The DomainArrangementSet containig all domains from the file.
*/
virtual DomainArrangementSet<DomainType> readFile(AlgorithmPack::Input &inFile, const std::string &fileName) const = 0;
};
/**
* @brief PfamScan format reader class
*
......@@ -120,7 +50,6 @@ class PfamReader final : public DASetInputStrategy<DomainType>
DomainArrangementSet<DomainType> daSet;
std::string line;
inFile.seekg(0);
getline(inFile, line);
int line_counter = 0;
std::string last_name = "";
typename DomainArrangementSet<DomainType>::iterator da;
......@@ -175,12 +104,6 @@ class PfamReader final : public DASetInputStrategy<DomainType>
}
};
}
#endif // BSDL_DOMAIN_DASETINPUTSTRATEGY_HPP
\ No newline at end of file
#endif //
\ No newline at end of file
/**
* @file RADIANTReader.hpp
* @author Carsten Kemena (c.kemena@wwu.de)
* @brief Contains the RADIANTReader class definition.
* @version 1.0
* @date 2019-11-20
*
* @copyright Copyright (c) 2019
*
*/
#ifndef BSDL_DOMAIN_INPUTSTRATEGIES_RADIANTREADER_HPP
#define BSDL_DOMAIN_INPUTSTRATEGIES_RADIANTREADER_HPP
#include "DASetInputStrategy.hpp"
namespace BioSeqDataLib
{
/**
* @brief RADIANT format reader class
*
* @tparam DomainType The domainType to be used.
*/
template<typename DomainType>
class RADIANTReader final : public DASetInputStrategy<DomainType>
{
public:
std::vector<std::string> formats() const
{
return { "RADIANT" };
}
bool
checkFormat(AlgorithmPack::Input &inFile) const
{
std::string line;
inFile.seekg(0);
getline(inFile, line);
if (line.find("RADIANT") == std::string::npos)
return false;
return true;
}
DomainArrangementSet<DomainType>
readFile(AlgorithmPack::Input &inFile, const std::string &fileName) const
{
DomainArrangementSet<DomainType> daSet;
std::string line;
inFile.seekg(0);
int line_counter = 0;
std::string last_name = "";
typename DomainArrangementSet<DomainType>::iterator da;
try
{
while (getline(inFile, line))
{
if (line.empty() || (line[0] == '#'))
continue;
auto tokens = split(line, " ");
if (tokens[0] != last_name)
{
last_name = tokens[0];
da = daSet.emplace(last_name, DomainArrangement<DomainType>()).first;
}
da->second.emplace_back(std::move(tokens[3]), std::stoul(tokens[1])-1, std::stoul(tokens[2])-1, -1.0);
}
}
catch(...)
{
throw FormatException("Error: Failed to read domain annotation file '" + fileName + "'. Format of file: RADIANT. Error occured in line: " + std::to_string(line_counter) + "\n");
}
for (auto &arrangement : daSet)
{
sort(arrangement.second.begin(), arrangement.second.end());
}
return daSet;
}
};
} // BioSeqDataLib
#endif // BSDL_DOMAIN_INPUTSTRATEGIES_HPP
\ No newline at end of file
......@@ -40,13 +40,13 @@ ADD_EXECUTABLE(${phylogeny_tests_exe} ${phylogeny_tests_src})
target_link_libraries(${phylogeny_tests_exe}
${Boost_LIBRARIES} BioSeqDataLib
)
SET(external_interfaces_tests_src ./external_interfaces/external_interfaces_tests.cpp)
SET(external_interfaces_tests_exe external_interfaces_tests)
ADD_EXECUTABLE(${external_interfaces_tests_exe} ${external_interfaces_tests_src})
target_link_libraries(${external_interfaces_tests_exe}
${Boost_LIBRARIES} BioSeqDataLib
)
#
#SET(external_interfaces_tests_src ./external_interfaces/external_interfaces_tests.cpp)
#SET(external_interfaces_tests_exe external_interfaces_tests)
#ADD_EXECUTABLE(${external_interfaces_tests_exe} ${external_interfaces_tests_src})
#target_link_libraries(${external_interfaces_tests_exe}
# ${Boost_LIBRARIES} BioSeqDataLib
#)
SET(draw_tests_src ./draw/drawTests.cpp)
SET(draw_tests_exe draw_tests)
......
......@@ -4,7 +4,9 @@
#include <boost/test/unit_test.hpp>
#include "../../src/domain/PfamDomain.hpp"
#include "../../src/domain/DASetInputStrategies.hpp"
#include "../../src/domain/InputStrategies/PfamReader.hpp"
#include "../../src/domain/InputStrategies/RADIANTReader.hpp"
#include "../../src/domain/InputStrategies/InterProTSVReader.hpp"
......@@ -16,7 +18,7 @@ BOOST_AUTO_TEST_CASE( pfamScanFormatTest )
{
BSDL::DomainArrangementSet<BSDL::PfamDomain> daSet;
AlgorithmPack::Input in("../tests/domain/data_new/BB20012.pfamScan");
AlgorithmPack::Input in("../tests/domain/data/BB20012.pfamScan");
BSDL::PfamReader<BSDL::PfamDomain> reader;
BOOST_CHECK_EQUAL(reader.checkFormat(in), true);
daSet = reader.readFile(in, "x");
......@@ -65,7 +67,7 @@ BOOST_AUTO_TEST_CASE( pfamScanFormatTest )
// check read with Domain
BSDL::PfamReader<BSDL::Domain> reader2;
in.open("../tests/domain/data_new/BB20012.pfamScan");
in.open("../tests/domain/data/BB20012.pfamScan");
BioSeqDataLib::DomainArrangementSet<BioSeqDataLib::Domain> daSet2 = reader2.readFile(in, "x");
in.close();
BOOST_CHECK_EQUAL(daSet2.size(), 27);
......@@ -79,7 +81,7 @@ BOOST_AUTO_TEST_CASE( pfamScanFormatTest )
// check read with DomainExt
BSDL::PfamReader<BSDL::DomainExt> reader3;
in.open("../tests/domain/data_new/BB20012.pfamScan");
in.open("../tests/domain/data/BB20012.pfamScan");
BioSeqDataLib::DomainArrangementSet<BioSeqDataLib::DomainExt> daSet3 = reader3.readFile(in, "x");
in.close();
BOOST_CHECK_EQUAL(daSet3.size(), 27);
......@@ -99,11 +101,63 @@ BOOST_AUTO_TEST_CASE( pfamScanFormatTest )
BOOST_CHECK_CLOSE(dom3.bitscore(), 35.6, 0.01);
// check format fail
in.open("../tests/domain/data_new/test.fasta");