Commit 64d93a63 authored by Dr. Carsten Kemena's avatar Dr. Carsten Kemena
Browse files

adaptions to new BSDL version

parent 4d01e2d0
Pipeline #64032 passed with stage
in 19 seconds
[submodule "libs/BioSeqDataLib"]
path = libs/BioSeqDataLib
url = https://ebbgit.uni-muenster.de/domainWorld/BioSeqDataLib.git
url = ../../domain-world/BioSeqDataLib.git
......@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.6)
project (RADIANT C CXX)
SET(MAJOR_VERSION 0)
SET(MINOR_VERSION 9)
SET(PATCH_VERSION 2-beta)
SET(PATCH_VERSION 3-beta)
SET(CMAKE_CXX_FLAGS_COVERAGE
"-g -O0 --coverage -fprofile-arcs -ftest-coverage -fno-inline -fno-inline-small-functions -fno-default-inline"
......@@ -33,7 +33,7 @@ MARK_AS_ADVANCED(
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wunused -pedantic")
set(CMAKE_CXX_FLAGS "-std=c++17 -Wall -Wextra -Wunused -pedantic")
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING
......@@ -83,20 +83,20 @@ configure_file (
#include_directories(${CMAKE_CURRENT_BINARY_DIR})
set (BSDL_PATH ${PROJECT_SOURCE_DIR}/libs/BioSeqDataLib/src/)
set (BSDL_src ${BSDL_PATH}/external/Input.cpp ${BSDL_PATH}/external/Output.cpp
set (BSDL_src ${BSDL_PATH}/utility/Input.cpp ${BSDL_PATH}/utility/Output.cpp
)
SET(radiantDB_src ${PROJECT_SOURCE_DIR}/src/makeRadiantDb.cpp ${BSDL_src} ${BSDL_PATH}/external_interfaces/domainProgs.cpp ${BSDL_PATH}utility/stringHelpers.cpp)
SET(radiantDB_src ${PROJECT_SOURCE_DIR}/src/makeRadiantDb.cpp ${BSDL_src} ${BSDL_PATH}/external_interfaces/EI_Manager.cpp ${BSDL_PATH}/external_interfaces/DP_Manager.cpp ${BSDL_PATH}utility/stringHelpers.cpp)
SET(radiantDB_exe makeRadiantDB)
ADD_EXECUTABLE(${radiantDB_exe} ${radiantDB_src})
target_link_libraries(${radiantDB_exe}
${Boost_LIBRARIES} ${SQLITE3_LIBRARY} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
)
SET(radiant_src ${PROJECT_SOURCE_DIR}/src/radiant.cpp ${PROJECT_SOURCE_DIR}/src/RadiantDB.cpp ${BSDL_src} ${BSDL_PATH}/external_interfaces/domainProgs.cpp ${BSDL_PATH}utility/stringHelpers.cpp
SET(radiant_src ${PROJECT_SOURCE_DIR}/src/radiant.cpp ${PROJECT_SOURCE_DIR}/src/RadiantDB.cpp ${BSDL_src} ${BSDL_PATH}/external_interfaces/DP_Manager.cpp ${BSDL_PATH}utility/stringHelpers.cpp
${BSDL_PATH}domain/Domain.cpp ${BSDL_PATH}domain/DomainExt.cpp ${BSDL_PATH}domain/PfamDomain.cpp ${BSDL_PATH}domain/DomainArrangement.cpp
${BSDL_PATH}utility/utility.cpp ${BSDL_PATH}external_interfaces/domainProgs.cpp
${BSDL_PATH}utility/utility.cpp ${BSDL_PATH}external_interfaces/EI_Manager.cpp ${BSDL_PATH}/utility/algorithm.cpp
)
SET(radiant_exe radiant)
......
Subproject commit 342217c4ec244ee94fdc2df8a46b197f592e1952
Subproject commit 71e7fcd4d592ba6d21d56e1bb89470c21cb72dc6
......@@ -10,8 +10,8 @@
#include <boost/filesystem.hpp>
// BSDL header
#include "../libs/BioSeqDataLib/src/external/Input.hpp"
#include "../libs/BioSeqDataLib/src/external/Output.hpp"
#include "../libs/BioSeqDataLib/src/utility/Input.hpp"
#include "../libs/BioSeqDataLib/src/utility/Output.hpp"
#include "common.hpp"
......
......@@ -14,8 +14,8 @@
// BSDL header
#include "../libs/BioSeqDataLib/src/external/Input.hpp"
#include "../libs/BioSeqDataLib/src/external/Output.hpp"
#include "../libs/BioSeqDataLib/src/utility/Input.hpp"
#include "../libs/BioSeqDataLib/src/utility/Output.hpp"
#include "../libs/BioSeqDataLib/src/sequence/SequenceSet.hpp"
#include "../libs/BioSeqDataLib/src/sequence/Sequence.hpp"
......
......@@ -12,9 +12,12 @@
#include <boost/filesystem.hpp>
// BSDL header
#include "../libs/BioSeqDataLib/src/external/Input.hpp"
#include "../libs/BioSeqDataLib/src/external/Output.hpp"
#include "../libs/BioSeqDataLib/src/utility/Input.hpp"
#include "../libs/BioSeqDataLib/src/utility/Output.hpp"
#include "../libs/BioSeqDataLib/src/utility/stringHelpers.hpp"
#include "../libs/BioSeqDataLib/src/sequence/Sequence.hpp"
#include "../libs/BioSeqDataLib/src/sequence/SequenceSet.hpp"
#include "../libs/BioSeqDataLib/src/sequence/SeqSetIOManager.hpp"
#include "common.hpp"
#include "version.hpp"
......@@ -207,52 +210,14 @@ turnFile2db(fs::path &inFile, D &database, bool reverse)
std::vector<std::pair<size_t,size_t> > families;
BSDL::SequenceSet<BSDL::Sequence<> > seqSet;
//Stockholm
//#=GF AC PF10417.8
//A0A0L0HRL4_SPIPN/171-210 ...........SLQLGDRR..KV..ATPADWtGK.................GDEV.IIHN.G.V.S.N.E.E.A..A------rlfpg.....................
/*
AlgorithmPack::Input sequences(inFile);
std::string line;
std::smatch m;
std::regex re ("PF([0-9]{5})\\.");
std::string accession = "";
std::string gap_chars = ".-";
size_t start = 0;
while (getline(sequences, line))
{
//std::cout << line << std::endl;
// line is alignment
if ((line[0] != '#') && (line[0] != '/'))
{
auto tokens = BSDL::split(line, " ");
for (auto gap_char : gap_chars)
tokens[1].erase (std::remove(tokens[1].begin(), tokens[1].end(), gap_char), tokens[1].end());
std::transform(tokens[1].begin(), tokens[1].end(),tokens[1].begin(), ::toupper);
seqSet.emplace_back(accession, tokens[1], "", "");
}
else
{
if (line.compare(0, 7, "#=GF AC") == 0)
{
std::regex_search (line, m, re);
accession = m[1].str();
if (seqSet.size() != 0)
{
families.emplace_back(start, seqSet.size());
start = seqSet.size();
}
}
}
}
families.emplace_back(start, seqSet.size());*/
// *** BEGIN FASTA ***///
// rename sequences
std::smatch m;
std::regex re ("PF([0-9]{5})\\.");
seqSet.read(inFile);
BioSeqDataLib::SeqSetIOManager<BioSeqDataLib::Sequence<> > ioManager;
ioManager.loadDefaultInputStrategies();
seqSet = ioManager.read(inFile);
for (size_t i=0; i<seqSet.size(); ++i)
{
std::string comment = seqSet[i].comment();
......
......@@ -13,14 +13,16 @@
#include <boost/filesystem.hpp>
// BSDL header
#include "../libs/BioSeqDataLib/src/external/Input.hpp"
#include "../libs/BioSeqDataLib/src/external/Output.hpp"
#include "../libs/BioSeqDataLib/src/utility/Input.hpp"
#include "../libs/BioSeqDataLib/src/utility/Output.hpp"
#include "../libs/BioSeqDataLib/src/sequence/Sequence.hpp"
#include "../libs/BioSeqDataLib/src/sequence/SeqFunctions.hpp"
#include "../libs/BioSeqDataLib/src/sequence/SequenceSet.hpp"
#include "../libs/BioSeqDataLib/src/sequence/SeqSetIOManager.hpp"
#include "../libs/BioSeqDataLib/src/DomainModule.hpp"
#include "../libs/BioSeqDataLib/src/utility/utility.hpp"
#include "../libs/BioSeqDataLib/src/external_interfaces/domainProgs.hpp"
#include "../libs/BioSeqDataLib/src/utility/stringHelpers.hpp"
#include "../libs/BioSeqDataLib/src/external_interfaces/DP_Manager.hpp"
#include "common.hpp"
#include "RadiantDB.hpp"
......@@ -33,6 +35,33 @@ namespace fs = boost::filesystem;
namespace BSDL = BioSeqDataLib;
namespace ct = boost::container;
struct DomainInfo
{
std::string name;
std::string type;
std::string clan;
DomainInfo(const std::string &n, const std::string &t, const std::string &c) : name(n), type(t), clan(c)
{}
};
void
readDomainInfo(const fs::path &pfamInfo, std::map<std::string, DomainInfo> &info)
{
BSDL::Input in(pfamInfo);
std::string line;
while (getline(in, line))
{
auto tokens = BSDL::split(line, " ");
if (tokens.size()==3)
info.emplace(std::piecewise_construct, std::make_tuple(tokens[0]), std::make_tuple(tokens[1], tokens[2], "No_clan"));
else
info.emplace(std::piecewise_construct, std::make_tuple(tokens[0]), std::make_tuple(tokens[1], tokens[2], tokens[3]));
}
}
/**
......@@ -222,7 +251,7 @@ assignWords(const fs::path &inFile, BSDL::SequenceSet<BSDL::Sequence<> > &seqSet
void
printHeader(const std::string &radiantVersion, bool pfamLike, bool translate, const fs::path &inFile, const fs::path &databaseFile, AlgorithmPack::Output &out)
printHeader(const std::string &radiantVersion, bool pfamLike, bool translate, const fs::path &inFile, const fs::path &databaseFile, BioSeqDataLib::Output &out)
{
system_clock::time_point today = system_clock::now();
std::time_t tt;
......@@ -326,7 +355,11 @@ main(int argc, char const *argv[])
//omp_set_num_threads(nThreads);
BSDL::SequenceSet<BSDL::Sequence<> > seqSet;
seqSet.read(inFile);
BioSeqDataLib::SeqSetIOManager<BioSeqDataLib::Sequence<> > ioManager;
ioManager.loadDefaultInputStrategies();
seqSet = ioManager.read(inFile);
//seqSet.read(inFile);
size_t nameLength = 0;
for (auto &seq : seqSet)
......@@ -361,7 +394,7 @@ main(int argc, char const *argv[])
if (!detailedFile.empty())
{
AlgorithmPack::Output detailedOut(detailedFile);
BioSeqDataLib::Output detailedOut(detailedFile);
for (size_t i = 0; i< seqSet.size(); ++i)
{
detailedOut << ">" << seqSet[i].name() << "\n";
......@@ -372,7 +405,7 @@ main(int argc, char const *argv[])
}
std::map<std::string, BioSeqDataLib::DomainInfo> infoSet;
std::map<std::string, DomainInfo> infoSet;
try
{
readDomainInfo(databaseFile.string()+"/info.txt", infoSet);
......@@ -411,7 +444,7 @@ main(int argc, char const *argv[])
}
file.close();
*/
AlgorithmPack::Output out(outFile);
BioSeqDataLib::Output out(outFile);
if (!noHeader)
printHeader(radiantVersion, pfamLike, translate, inFile, databaseFile, out);
for (size_t i = 0; i< seqSet.size(); ++i)
......
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