Commit b5a14556 authored by Carsten Kemena's avatar Carsten Kemena

String the implementatin of the strategy pattern

parent 93521002
......@@ -1778,7 +1778,7 @@ TEMPLATE_RELATIONS = NO
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
INCLUDE_GRAPH = NO
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
......
doc/logo.png

10.9 KB | W: | H:

doc/logo.png

10.1 KB | W: | H:

doc/logo.png
doc/logo.png
doc/logo.png
doc/logo.png
  • 2-up
  • Swipe
  • Onion skin
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="logo.svg"
inkscape:export-filename="/home/c/ckeme_01/projects/domainWorld/BioSeqDataLib/doc/logo.png"
inkscape:export-xdpi="312.39999"
inkscape:export-ydpi="312.39999">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="70.055269"
inkscape:cy="1010.4047"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:window-width="1436"
inkscape:window-height="1000"
inkscape:window-x="252"
inkscape:window-y="76"
inkscape:window-maximized="0">
<inkscape:grid
type="xygrid"
id="grid2985"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;stroke:#000000;stroke-width:3.12926602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 11.087927,50.943584 C 40.837668,11.85628 93.960355,8.9340465 126.87077,49.917088"
id="path3001"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:3.12926602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 11.206067,20.507499 C 40.955808,59.594804 93.842217,62.04525 126.75263,21.062208"
id="path3001-1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 17.792934,30.042682 0,12.517064"
id="path3043"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 12.973303,23.183444 0,25.034128"
id="path3045"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 119.94112,29.092837 0,12.517064"
id="path3047"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 125.2916,22.876103 0,25.034128"
id="path3049"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-size:31.29266167px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ff0000;fill-opacity:1;stroke:none;font-family:MetaNormal-Roman;-inkscape-font-specification:MetaNormal-Roman"
x="45.376869"
y="42.362183"
id="text3051"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3053"
x="45.376869"
y="42.362183"
style="font-size:18.77559662px;fill:#ff0000">B</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 51.281787,23.78415 0,3.129265"
id="path3104"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:3.12926602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 51.281787,45.689011 0,0"
id="path3106"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 51.281787,43.677341 0,3.129267"
id="path3108"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-size:31.29266167px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000080;fill-opacity:1;stroke:none;font-family:MetaNormal-Roman;-inkscape-font-specification:MetaNormal-Roman"
x="58.251701"
y="42.380959"
id="text3051-2"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3053-4"
x="58.251701"
y="42.380959"
style="font-size:18.77559662px;fill:#000080">S</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 63.593361,20.654883 0,6.258532"
id="path3110"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 63.593361,45.828712 0,3.688062"
id="path3112"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-size:31.29266167px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#008000;fill-opacity:1;stroke:none;font-family:MetaNormal-Roman;-inkscape-font-specification:MetaNormal-Roman"
x="70"
y="42.362183"
id="text3051-0"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3053-3"
x="70"
y="42.362183"
style="font-size:18.77559662px;fill:#008000">D</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 74.324112,46.038259 0,3.827763"
id="path3114"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 74.324112,20.654883 0,6.258532"
id="path3116"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-size:31.29266167px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffcc00;fill-opacity:1;stroke:none;font-family:MetaNormal-Roman;-inkscape-font-specification:MetaNormal-Roman"
x="82.574432"
y="42.55975"
id="text3051-3"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3053-5"
x="82.574432"
y="42.55975"
style="font-size:18.77559662px;fill:#ffcc00">L</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 87.57813,23.981711 0,3.129265"
id="path3118"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.565;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 87.57813,44.01321 0,4.211987"
id="path3120"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 39.697795,42.559746 0,-15.646331"
id="path3948"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.56463301;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 96.024582,26.913415 0,18.775596"
id="path3952"
inkscape:connector-curvature="0" />
</g>
</svg>
/*
* 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 0.1
* @date 2019-11-11
*
* @copyright Copyright (c) 2019
*
*
* Any output strategy should follow the following pattern:
* - Identify if it can handle the provided format: if not return false
* - if an error occured while reading throw a format exception
* - if everything goes through, return true
*
*/
#ifndef BSDL_DOMAIN_DASETINPUTSTRATEGY_HPP
#define BSDL_DOMAIN_DASETINPUTSTRATEGY_HPP
#include "DomainArrangementSet.hpp"
#include "../external/Input.hpp"
#include "../utility/stringHelpers.hpp"
namespace BioSeqDataLib
{
/**
* @brief Function to read the pfam_scan
*
* @tparam DomainType The domain type
* @param in The file to read from
* @param daSet The DomainArrangementSet to add the file content to
*
* \relates DASetReader
*
*/
template<class DomainType>
bool
readPfamFormat(AlgorithmPack::Input &inFile, DomainArrangementSet<DomainType> &daSet)
{
std::string line;
getline(inFile, line);
if ((line.find("pfam_scan.pl") == std::string::npos) && (line.find("CICADA") == std::string::npos))
return false;
int line_counter = 0;
std::string last_name = "";
typename DomainArrangementSet<DomainType>::iterator da;
try
{
while (getline(inFile, line))
{
++line_counter;
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;
}
/*
* pfam_scan.pl format
* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
* # <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 accession;
size_t pos;
if ((pos=tokens[5].find('.')) == std::string::npos)
{
accession=tokens[5];
}
else
{
accession=tokens[5].substr(0, pos);
}
PfamDomain dom(accession, tokens[6], std::stoul(tokens[1])-1, stoul(tokens[2])-1, stoul(tokens[3])-1, stoul(tokens[4])-1, stoul(tokens[8])-1, stoul(tokens[9])-1, stoul(tokens[10]), stod(tokens[11]), stod(tokens[12]), stod(tokens[13]), (tokens[14] == "No_clan") ? "" : tokens[14], tokens[7]);
da->second.emplace_back(std::move(dom));
}
}
catch(...)
{
throw FormatException("Failed to read domain annotation file in pfam format. Error occured in line: " + std::to_string(line_counter));
}
for (auto &arrangement : daSet)
{
sort(arrangement.second.begin(), arrangement.second.end());
}
return true;
}
}
#endif // BSDL_DOMAIN_DASETINPUTSTRATEGY_HPP
\ No newline at end of file
/*
* DASetOutputStrategies.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/>.
*/
#ifndef BSDL_DOMAIN_DASETOUTPUTSTRATEGY_HPP
#define BSDL_DOMAIN_DASETOUTPUTSTRATEGY_HPP
/**
* \file DASetOutputStrategies.hpp
* \brief Header containing different function to write a DASet to file.
*/
#include "DomainArrangementSet.hpp"
#include "DomainOutStrategy.hpp"
#include "../external/Output.hpp"
namespace BioSeqDataLib
{
/** @defgroup DASetOutputStrategies DASet output functions
* These functions can be used together with a DASetWriter to manage the export of domain arrangments into text files.
* @{
*
* \relates DASetWriter
*/
/**
* @brief Function to write DomainArrangementSet into the XDomFormat
*
* @tparam DomainType The domain type
* @param daSet The DomainArrangementSet to write to file
* @param out The name of the output file
* @param domOut A function describing how to handle the DomainOutput
* \see dom2XDom
*
* \relates DASetWriter
*/
template<class DomainType>
void
daSet2XDom(const DomainArrangementSet<DomainType> &daSet, AlgorithmPack::Output &out, std::function<std::string(DomainType)> domOut)
writeXDomFormat(const DomainArrangementSet<DomainType> &daSet, AlgorithmPack::Output &out, std::function<std::string(DomainType)> domOut)
{
for (auto &da : daSet)
{
......@@ -27,9 +72,20 @@ daSet2XDom(const DomainArrangementSet<DomainType> &daSet, AlgorithmPack::Output
}
}
/**
* @brief Function to write a DomainArrangementSet into pfam format.
*
* @tparam DomainType The domain type
* @param daSet The DomainArrangementSet to write to file
* @param out The name of the output file
* @param domOut A function describing how to handle the DomainOutput. The function that should be usually used with this is: dom2Pfam
* \see dom2Pfam
*
* \relates DASetWriter
*/
template<class DomainType>
void
daSet2Pfam(const DomainArrangementSet<DomainType> &daSet, AlgorithmPack::Output &out, std::function<std::string(DomainType)> domOut)
writePfamFormat(const DomainArrangementSet<DomainType> &daSet, AlgorithmPack::Output &out, std::function<std::string(DomainType)> domOut)
{
out << "# pfam_scan.pl\n";
out << "# <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>\n\n";
......@@ -54,6 +110,7 @@ daSet2Pfam(const DomainArrangementSet<DomainType> &daSet, AlgorithmPack::Output
}
}
/** @} */ // end of group1
} // BioSeqDataLib
......
/*
* DASetReader.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 DASetReader.hpp
* @author Carsten Kemena (c.kemena@wwu.de)
* @brief The reader class for Domain Arrangment set.
* @version 0.1
* @date 2019-11-11
*
* @copyright Copyright (c) 2019
*
*/
#ifndef BSDL_DOMAIN_DASETREADER_HPP
#define BSDL_DOMAIN_DASETREADER_HPP
#include <functional>
#include <vector>
#include <memory>
#include <string>
#include "DomainArrangementSet.hpp"
#include <boost/filesystem.hpp>
#include "../external/Input.hpp"
namespace BioSeqDataLib
{
/**
* @brief Class to write a DomainArrangementSet into a file.
*
* @tparam DomainType
*/
template<class DomainType>
class DASetReader
{
private:
std::vector<std::function<bool(AlgorithmPack::Input &, DomainArrangementSet<DomainType> &)> > strategies;
public:
/**
* @brief Construct a new DASetReader object
*
*/
DASetReader()
{}
/**
* @brief Destroy the DASetReader object
*
*/
virtual
~DASetReader()
{}
/**
* @brief Function to read the data from a file.
*
* @param daSet The arrangment set to read the domains into.
* @param fileName The input file name
*/
void
read(const fs::path &fileName, DomainArrangementSet<DomainType> &daSet)
{
try
{
AlgorithmPack::Input inF(fileName);
for (size_t i=0; i<strategies.size(); ++i)
{
inF.seekg(0);
if (strategies[i](inF, daSet))
{
inF.close();
return;
}
}
inF.close();
throw FormatException("Unknown Format in " + fileName.string());
}
catch (const FormatException&)
{
throw;
}
catch (const std::exception&)
{
throw FormatException("Failed to read file: " + fileName.string());
}
}
/**
* @brief Adds an input strategy to the writer.
*
* @param name The name of the strategy.
* @param strategy The function containing the strategy.
*/
void
addStrategy(std::function<bool(AlgorithmPack::Input &, DomainArrangementSet<DomainType> &)> strategy)
{
strategies.emplace_back(strategy);
}
};
}
#endif // BSDL_DOMAIN_DASETREADER_HPP
/*
* DASetWriter.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/>.
*/
#ifndef BSDL_DOMAIN_DASETWRITER_HPP
#define BSDL_DOMAIN_DASETWRITER_HPP
......@@ -7,17 +31,30 @@
#include <string>
#include "DomainArrangementSet.hpp"
#include "DASetOutputStrategy.hpp"
#include "DASetOutputStrategies.hpp"
#include <boost/filesystem.hpp>
#include "../external/Output.hpp"
/**
* \file DASetWriter.hpp
* \brief Header containing the DASetWriter class.
*/
namespace BioSeqDataLib
{
/**
* @brief Class to write a DomainArrangementSet into a file.
*
* This class uses basically the strategy pattern to support different output formats.
* However, instead of using interfaces and classes, I decided to make use of
* std::function, reducing the amount of interfaces and classes.
*
* @tparam DomainType The type of domain object.
*/
template<class DomainType>
class DASetWriter
{
......@@ -25,13 +62,29 @@ class DASetWriter
std::map<std::string, std::function<void(const DomainArrangementSet<DomainType> &, AlgorithmPack::Output &)> > strategies;
public:
/**
* @brief Construct a new DASetWriter object
*
*/
DASetWriter()
{}
/**
* @brief Destroy the DASetWriter object
*
*/
virtual
~DASetWriter()
{}
/**
* @brief Function to write the data into a file.
*
* @param daSet
* @param format
* @param out
*/
void
write(const DomainArrangementSet<DomainType> &daSet, const std::string &format, const fs::path &out)
{
......@@ -39,6 +92,12 @@ class DASetWriter
strategies.at(format)(daSet, outF);
}
/**
* @brief Adds an output strategy to the writer.
*
* @param name The name of the strategy.
* @param strategy The function containing the strategy.
*/
void
addStrategy(const std::string &name, std::function<void(const DomainArrangementSet<DomainType> &, AlgorithmPack::Output &)> strategy)
{
......
......@@ -242,6 +242,10 @@ public:
return arrangements_.find(sourceId)->second;
}
void addInputStrategies();
/**
* \brief Reads a domain file.
*
......
......@@ -5,10 +5,47 @@
#include <sstream>
#include <ios>
#include <iomanip>
/*
* DomainOutStratgies.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 DomainOutStrategies.hpp
* \brief Header containing the Domain class.
*/
namespace BioSeqDataLib
{
/**
* @brief Returns a string with all the information about a domain in Xdom format.
*
* @tparam DomainType The domain type
* @param dom The domain to return as string
* @return std::string The domain information
*/
template<class DomainType>
std::string
dom2XDom(const DomainType &dom)
......@@ -16,6 +53,13 @@ namespace BioSeqDataLib
return (std::to_string(dom.start()+1) + " " + std::to_string(dom.end()+1) + " " + dom.accession() + " " + std::to_string(dom.evalue()));
}
/**
* @brief Returns a string with all the information about a domain in pfamScan format.
*
* @tparam DomainType The domain type
* @param dom The domain to return as string
* @return std::string The domain information
*/
template<class DomainType>
std::string
dom2Pfam(const DomainType &dom)
......