Commit 4673673f by Maarten L. Hekkelman

Added test case

parent 2c28c183
...@@ -45,8 +45,8 @@ if(MSVC) ...@@ -45,8 +45,8 @@ if(MSVC)
# On Windows, do not install in the system location # On Windows, do not install in the system location
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT ($ENV{LOCALAPPDATA} STREQUAL "")) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT ($ENV{LOCALAPPDATA} STREQUAL ""))
message(WARNING "The executable will be installed in $ENV{LOCALAPPDATA}/${PROJECT_NAME}") message(WARNING "The executable will be installed in $ENV{LOCALAPPDATA}")
set(CMAKE_INSTALL_PREFIX "$ENV{LOCALAPPDATA}/${PROJECT_NAME}" CACHE PATH "..." FORCE) set(CMAKE_INSTALL_PREFIX "$ENV{LOCALAPPDATA}" CACHE PATH "..." FORCE)
endif() endif()
# Find out the processor type for the target # Find out the processor type for the target
...@@ -92,7 +92,7 @@ string(TIMESTAMP BUILD_DATE_TIME "%Y-%m-%d" UTC) ...@@ -92,7 +92,7 @@ string(TIMESTAMP BUILD_DATE_TIME "%Y-%m-%d" UTC)
configure_file("${CMAKE_SOURCE_DIR}/src/revision.hpp.in" "${CMAKE_BINARY_DIR}/revision.hpp" @ONLY) configure_file("${CMAKE_SOURCE_DIR}/src/revision.hpp.in" "${CMAKE_BINARY_DIR}/revision.hpp" @ONLY)
# Optionally use mrc to create resources # Optionally use mrc to create resources
find_program(MRC mrc HINTS "$ENV{LOCALAPPDATA}/mrc" "${CMAKE_INSTALL_PREFIX}/../mrc" "/usr/local/bin") find_program(MRC mrc HINTS "$ENV{LOCALAPPDATA}/bin" "$ENV{LOCALAPPDATA}/mrc" "${CMAKE_INSTALL_PREFIX}/../mrc" "/usr/local/bin")
if(MRC) if(MRC)
option(USE_RSRC "Use mrc to create resources" ON) option(USE_RSRC "Use mrc to create resources" ON)
...@@ -119,7 +119,7 @@ message(STATUS "Boost libraries in: ${Boost_LIBRARY_DIRS}") ...@@ -119,7 +119,7 @@ message(STATUS "Boost libraries in: ${Boost_LIBRARY_DIRS}")
find_package(ZLIB) find_package(ZLIB)
find_package(BZip2) find_package(BZip2)
find_package(cifpp 1.0 REQUIRED) find_package(cifpp 1.0 REQUIRED HINTS $ENV{LOCALAPPDATA}/cifpp)
if(CIFPP_FOUND) if(CIFPP_FOUND)
add_compile_definitions("DATA_DIR=\"${CIFPP_SHARE_DIR}\"") add_compile_definitions("DATA_DIR=\"${CIFPP_SHARE_DIR}\"")
...@@ -150,6 +150,8 @@ include_directories( ...@@ -150,6 +150,8 @@ include_directories(
) )
add_executable(mkdssp add_executable(mkdssp
${PROJECT_SOURCE_DIR}/src/dssp.cpp
${PROJECT_SOURCE_DIR}/src/dssp.hpp
${PROJECT_SOURCE_DIR}/src/mkdssp.cpp ${PROJECT_SOURCE_DIR}/src/mkdssp.cpp
${DSSP_RESOURCE}) ${DSSP_RESOURCE})
...@@ -159,5 +161,32 @@ install(TARGETS ${PROJECT_NAME} ...@@ -159,5 +161,32 @@ install(TARGETS ${PROJECT_NAME}
# manual # manual
install(FILES doc/mkdssp.1 DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1) install(FILES doc/mkdssp.1
DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1)
# test
add_executable(unit-test ${PROJECT_SOURCE_DIR}/test/unit-test.cpp ${PROJECT_SOURCE_DIR}/src/dssp.cpp ${DSSP_RESOURCE})
target_include_directories(unit-test PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_link_libraries(unit-test Threads::Threads ${Boost_LIBRARIES} cifpp::cifpp)
if(${ZLIB_FOUND})
target_link_libraries(unit-test ZLIB::ZLIB)
endif()
if(${BZip2_FOUND})
target_link_libraries(unit-test BZip2::BZip2)
endif()
if(MSVC)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
target_compile_options(unit-test PRIVATE /EHsc)
endif()
add_test(NAME unit-test
COMMAND $<TARGET_FILE:unit-test>
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
\ No newline at end of file
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 NKI/AVL, Netherlands Cancer Institute
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if __has_include("config.hpp")
#include "config.hpp"
#endif
#include <exception>
#include <iostream>
#include <filesystem>
#include <fstream>
#include <boost/format.hpp>
#include <boost/date_time/gregorian/formatters.hpp>
#include <cif++/CifUtils.hpp>
#include <cif++/Cif2PDB.hpp>
#include "dssp.hpp"
// --------------------------------------------------------------------
namespace {
std::string gVersionNr, gVersionDate;
}
void load_version_info()
{
const std::regex
rxVersionNr(R"(build-(\d+)-g[0-9a-f]{7}(-dirty)?)"),
rxVersionDate(R"(Date: +(\d{4}-\d{2}-\d{2}).*)"),
rxVersionNr2(R"(mkdssp-version: (\d+(?:\.\d+)+))");
#include "revision.hpp"
struct membuf : public std::streambuf
{
membuf(char* data, size_t length) { this->setg(data, data, data + length); }
} buffer(const_cast<char*>(kRevision), sizeof(kRevision));
std::istream is(&buffer);
std::string line;
while (getline(is, line))
{
std::smatch m;
if (std::regex_match(line, m, rxVersionNr))
{
gVersionNr = m[1];
if (m[2].matched)
gVersionNr += '*';
continue;
}
if (std::regex_match(line, m, rxVersionDate))
{
gVersionDate = m[1];
continue;
}
// always the first, replace with more specific if followed by the other info
if (std::regex_match(line, m, rxVersionNr2))
{
gVersionNr = m[1];
continue;
}
}
}
std::string get_version_nr()
{
return gVersionNr/* + '/' + cif::get_version_nr()*/;
}
std::string get_version_date()
{
return gVersionDate;
}
std::string get_version_string()
{
return gVersionNr + " " + gVersionDate;
}
// --------------------------------------------------------------------
std::string ResidueToDSSPLine(const mmcif::DSSP::ResidueInfo& info)
{
/*
This is the header line for the residue lines in a DSSP file:
# RESIDUE AA STRUCTURE BP1 BP2 ACC N-H-->O O-->H-N N-H-->O O-->H-N TCO KAPPA ALPHA PHI PSI X-CA Y-CA Z-CA
*/
boost::format kDSSPResidueLine(
"%5.5d%5.5d%1.1s%1.1s %c %c%c%c%c%c%c%c%c%c%4.4d%4.4d%c%4.4d %11s%11s%11s%11s %6.3f%6.1f%6.1f%6.1f%6.1f %6.1f %6.1f %6.1f");
auto& residue = info.residue();
if (residue.asymID().length() > 1)
throw std::runtime_error("This file contains data that won't fit in the original DSSP format");
char code = 'X';
if (mmcif::kAAMap.find(residue.compoundID()) != mmcif::kAAMap.end())
code = mmcif::kAAMap.at(residue.compoundID());
if (code == 'C') // a cysteine
{
auto ssbridgenr = info.ssBridgeNr();
if (ssbridgenr)
code = 'a' + ((ssbridgenr - 1) % 26);
}
char ss;
switch (info.ss())
{
case mmcif::ssAlphahelix: ss = 'H'; break;
case mmcif::ssBetabridge: ss = 'B'; break;
case mmcif::ssStrand: ss = 'E'; break;
case mmcif::ssHelix_3: ss = 'G'; break;
case mmcif::ssHelix_5: ss = 'I'; break;
case mmcif::ssHelix_PPII: ss = 'P'; break;
case mmcif::ssTurn: ss = 'T'; break;
case mmcif::ssBend: ss = 'S'; break;
case mmcif::ssLoop: ss = ' '; break;
}
char helix[4] = { ' ', ' ', ' ', ' ' };
for (mmcif::HelixType helixType: { mmcif::HelixType::rh_3_10, mmcif::HelixType::rh_alpha, mmcif::HelixType::rh_pi, mmcif::HelixType::rh_pp })
{
switch (info.helix(helixType))
{
case mmcif::Helix::None: helix[static_cast<int>(helixType)] = ' '; break;
case mmcif::Helix::Start: helix[static_cast<int>(helixType)] = '>'; break;
case mmcif::Helix::End: helix[static_cast<int>(helixType)] = '<'; break;
case mmcif::Helix::StartAndEnd: helix[static_cast<int>(helixType)] = 'X'; break;
case mmcif::Helix::Middle: helix[static_cast<int>(helixType)] = (helixType == mmcif::HelixType::rh_pp ? 'P' : static_cast<char>('3' + static_cast<int>(helixType))); break;
}
}
char bend = ' ';
if (info.bend())
bend = 'S';
double alpha = residue.alpha();
char chirality = alpha == 360 ? ' ' : (alpha < 0 ? '-' : '+');
uint32_t bp[2] = {};
char bridgelabel[2] = { ' ', ' ' };
for (uint32_t i: { 0, 1 })
{
const auto& [p, ladder, parallel] = info.bridgePartner(i);
if (not p)
continue;
bp[i] = p.nr() % 10000; // won't fit otherwise...
bridgelabel[i] = (parallel ? 'a' : 'A') + ladder % 26;
}
char sheet = ' ';
if (info.sheet() != 0)
sheet = 'A' + (info.sheet() - 1) % 26;
std::string NHO[2], ONH[2];
for (int i: { 0, 1 })
{
const auto& [donor, donorE] = info.donor(i);
const auto& [acceptor, acceptorE] = info.acceptor(i);
NHO[i] = ONH[i] = "0, 0.0";
if (acceptor)
{
auto d = acceptor.nr() - info.nr();
NHO[i] = (boost::format("%d,%3.1f") % d % acceptorE).str();
}
if (donor)
{
auto d = donor.nr() - info.nr();
ONH[i] = (boost::format("%d,%3.1f") % d % donorE).str();
}
}
auto ca = residue.atomByID("CA");
auto const& [cax, cay, caz] = ca.location();
return (kDSSPResidueLine % info.nr() % ca.authSeqID() % ca.pdbxAuthInsCode() % ca.authAsymID() % code %
ss % helix[3] % helix[0] % helix[1] % helix[2] % bend % chirality % bridgelabel[0] % bridgelabel[1] %
bp[0] % bp[1] % sheet % floor(info.accessibility() + 0.5) %
NHO[0] % ONH[0] % NHO[1] % ONH[1] %
residue.tco() % residue.kappa() % alpha % residue.phi() % residue.psi() %
cax % cay % caz).str();
}
void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std::ostream& os)
{
const std::string kFirstLine("==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ==== ");
boost::format kHeaderLine("%1% %|127t|%2%");
using namespace boost::gregorian;
auto stats = dssp.GetStatistics();
date today = day_clock::local_day();
auto& cf = structure.getFile().file();
os << kHeaderLine % (kFirstLine + "DATE=" + to_iso_extended_string(today)) % '.' << std::endl
<< kHeaderLine % "REFERENCE W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637" % '.' << std::endl
<< GetPDBHEADERLine(cf, 127) << '.' << std::endl
<< GetPDBCOMPNDLine(cf, 127) << '.' << std::endl
<< GetPDBSOURCELine(cf, 127) << '.' << std::endl
<< GetPDBAUTHORLine(cf, 127) << '.' << std::endl;
os << boost::format("%5.5d%3.3d%3.3d%3.3d%3.3d TOTAL NUMBER OF RESIDUES, NUMBER OF CHAINS, NUMBER OF SS-BRIDGES(TOTAL,INTRACHAIN,INTERCHAIN) %|127t|%c") %
stats.nrOfResidues % stats.nrOfChains % stats.nrOfSSBridges % stats.nrOfIntraChainSSBridges % (stats.nrOfSSBridges - stats.nrOfIntraChainSSBridges) % '.' << std::endl;
os << kHeaderLine % (boost::format("%8.1f ACCESSIBLE SURFACE OF PROTEIN (ANGSTROM**2)") % stats.accessibleSurface) % '.' << std::endl;
// hydrogenbond summary
os << kHeaderLine % (
boost::format("%5.5d%5.1f TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(J) , SAME NUMBER PER 100 RESIDUES")
% stats.nrOfHBonds % (stats.nrOfHBonds * 100.0 / stats.nrOfResidues)) % '.' << std::endl;
os << kHeaderLine % (
boost::format("%5.5d%5.1f TOTAL NUMBER OF HYDROGEN BONDS IN PARALLEL BRIDGES, SAME NUMBER PER 100 RESIDUES")
% stats.nrOfHBondsInParallelBridges % (stats.nrOfHBondsInParallelBridges * 100.0 / stats.nrOfResidues)) % '.' << std::endl;
os << kHeaderLine % (
boost::format("%5.5d%5.1f TOTAL NUMBER OF HYDROGEN BONDS IN ANTIPARALLEL BRIDGES, SAME NUMBER PER 100 RESIDUES")
% stats.nrOfHBondsInAntiparallelBridges % (stats.nrOfHBondsInAntiparallelBridges * 100.0 / stats.nrOfResidues)) % '.' << std::endl;
boost::format kHBondsLine("%5.5d%5.1f TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I%c%1.1d), SAME NUMBER PER 100 RESIDUES");
for (int k = 0; k < 11; ++k)
os << kHeaderLine % (kHBondsLine % stats.nrOfHBondsPerDistance[k] % (stats.nrOfHBondsPerDistance[k] * 100.0 / stats.nrOfResidues) % (k - 5 < 0 ? '-' : '+') % abs(k - 5)) % '.' << std::endl;
// histograms...
os << " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 *** HISTOGRAMS OF *** ." << std::endl;
for (auto hi: stats.residuesPerAlphaHelixHistogram)
os << boost::format("%3.3d") % hi;
os << " RESIDUES PER ALPHA HELIX ." << std::endl;
for (auto hi: stats.parallelBridgesPerLadderHistogram)
os << boost::format("%3.3d") % hi;
os << " PARALLEL BRIDGES PER LADDER ." << std::endl;
for (auto hi: stats.antiparallelBridgesPerLadderHistogram)
os << boost::format("%3.3d") % hi;
os << " ANTIPARALLEL BRIDGES PER LADDER ." << std::endl;
for (auto hi: stats.laddersPerSheetHistogram)
os << boost::format("%3.3d") % hi;
os << " LADDERS PER SHEET ." << std::endl;
// per residue information
os << " # RESIDUE AA STRUCTURE BP1 BP2 ACC N-H-->O O-->H-N N-H-->O O-->H-N TCO KAPPA ALPHA PHI PSI X-CA Y-CA Z-CA" << std::endl;
boost::format kDSSPResidueLine(
"%5.5d !%c 0 0 0 0, 0.0 0, 0.0 0, 0.0 0, 0.0 0.000 360.0 360.0 360.0 360.0 0.0 0.0 0.0");
int last = 0;
for (auto ri: dssp)
{
// insert a break line whenever we detect missing residues
// can be the transition to a different chain, or missing residues in the current chain
if (ri.nr() != last + 1)
os << (kDSSPResidueLine % (last + 1) % (ri.chainBreak() == mmcif::ChainBreak::NewChain ? '*' : ' ')) << std::endl;
os << ResidueToDSSPLine(ri) << std::endl;
last = ri.nr();
}
}
void annotateDSSP(mmcif::Structure& structure, const mmcif::DSSP& dssp, bool writeOther, std::ostream& os)
{
auto& db = structure.getFile().data();
if (dssp.empty())
{
if (cif::VERBOSE)
std::cout << "No secondary structure information found" << std::endl;
}
else
{
// replace all struct_conf and struct_conf_type records
auto& structConfType = db["struct_conf_type"];
structConfType.clear();
auto& structConf = db["struct_conf"];
structConf.clear();
std::map<std::string,int> foundTypes;
auto st = dssp.begin(), lt = st;
auto lastSS = st->ss();
for (auto t = dssp.begin(); ; lt = t, ++t)
{
bool stop = t == dssp.end();
bool flush = (stop or t->ss() != lastSS);
if (flush and (writeOther or lastSS != mmcif::SecondaryStructureType::ssLoop))
{
auto& rb = st->residue();
auto& re = lt->residue();
std::string id;
switch (lastSS)
{
case mmcif::SecondaryStructureType::ssHelix_3:
id = "HELX_RH_3T_P";
break;
case mmcif::SecondaryStructureType::ssAlphahelix:
id = "HELX_RH_AL_P";
break;
case mmcif::SecondaryStructureType::ssHelix_5:
id = "HELX_RH_PI_P";
break;
case mmcif::SecondaryStructureType::ssHelix_PPII:
id = "HELX_LH_PP_P";
break;
case mmcif::SecondaryStructureType::ssTurn:
id = "TURN_TY1_P";
break;
case mmcif::SecondaryStructureType::ssBend:
id = "BEND";
break;
case mmcif::SecondaryStructureType::ssBetabridge:
case mmcif::SecondaryStructureType::ssStrand:
id = "STRN";
break;
case mmcif::SecondaryStructureType::ssLoop:
id = "OTHER";
break;
}
if (foundTypes.count(id) == 0)
{
structConfType.emplace({
{ "id", id },
{ "criteria", "DSSP" }
});
foundTypes[id] = 1;
}
structConf.emplace({
{ "conf_type_id", id },
{ "id", id + std::to_string(foundTypes[id]++) },
// { "pdbx_PDB_helix_id", vS(12, 14) },
{ "beg_label_comp_id", rb.compoundID() },
{ "beg_label_asym_id", rb.asymID() },
{ "beg_label_seq_id", rb.seqID() },
{ "pdbx_beg_PDB_ins_code", rb.authInsCode() },
{ "end_label_comp_id", re.compoundID() },
{ "end_label_asym_id", re.asymID() },
{ "end_label_seq_id", re.seqID() },
{ "pdbx_end_PDB_ins_code", re.authInsCode() },
{ "beg_auth_comp_id", rb.compoundID() },
{ "beg_auth_asym_id", rb.authAsymID() },
{ "beg_auth_seq_id", rb.authSeqID() },
{ "end_auth_comp_id", re.compoundID() },
{ "end_auth_asym_id", re.authAsymID() },
{ "end_auth_seq_id", re.authSeqID() }
// { "pdbx_PDB_helix_class", vS(39, 40) },
// { "details", vS(41, 70) },
// { "pdbx_PDB_helix_length", vI(72, 76) }
});
st = t;
}
if (lastSS != t->ss())
{
st = t;
lastSS = t->ss();
}
if (stop)
break;
}
}
db.add_software("dssp", "other", get_version_nr(), get_version_date());
db.write(os);
}
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 NKI/AVL, Netherlands Cancer Institute
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include <cif++/Structure.hpp>
#include <cif++/Secondary.hpp>
void load_version_info();
std::string get_version_nr();
std::string get_version_date();
std::string get_version_string();
void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std::ostream& os);
void annotateDSSP(mmcif::Structure& structure, const mmcif::DSSP& dssp, bool writeOther, std::ostream& os);
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
#include <boost/iostreams/filter/bzip2.hpp> #include <boost/iostreams/filter/bzip2.hpp>
#include <boost/iostreams/filtering_stream.hpp> #include <boost/iostreams/filtering_stream.hpp>
#include "dssp.hpp"
namespace fs = std::filesystem; namespace fs = std::filesystem;
namespace io = boost::iostreams; namespace io = boost::iostreams;
namespace po = boost::program_options; namespace po = boost::program_options;
...@@ -69,386 +71,6 @@ void print_what (const std::exception& e) ...@@ -69,386 +71,6 @@ void print_what (const std::exception& e)
// -------------------------------------------------------------------- // --------------------------------------------------------------------
namespace {
std::string gVersionNr, gVersionDate, VERSION_STRING;
}
void load_version_info()
{
const std::regex
rxVersionNr(R"(build-(\d+)-g[0-9a-f]{7}(-dirty)?)"),
rxVersionDate(R"(Date: +(\d{4}-\d{2}-\d{2}).*)"),
rxVersionNr2(R"(mkdssp-version: (\d+(?:\.\d+)+))");
#include "revision.hpp"
struct membuf : public std::streambuf
{
membuf(char* data, size_t length) { this->setg(data, data, data + length); }
} buffer(const_cast<char*>(kRevision), sizeof(kRevision));
std::istream is(&buffer);
std::string line;
while (getline(is, line))
{
std::smatch m;
if (std::regex_match(line, m, rxVersionNr))
{
gVersionNr = m[1];
if (m[2].matched)
gVersionNr += '*';
continue;
}
if (std::regex_match(line, m, rxVersionDate))
{
gVersionDate = m[1];
continue;
}
// always the first, replace with more specific if followed by the other info
if (std::regex_match(line, m, rxVersionNr2))
{
gVersionNr = m[1];
continue;
}
}
if (not VERSION_STRING.empty())
VERSION_STRING += "\n";
VERSION_STRING += gVersionNr + " " + gVersionDate;
}
std::string get_version_nr()
{
return gVersionNr/* + '/' + cif::get_version_nr()*/;
}
std::string get_version_date()
{
return gVersionDate;
}
// --------------------------------------------------------------------
std::string ResidueToDSSPLine(const mmcif::DSSP::ResidueInfo& info)
{
/*
This is the header line for the residue lines in a DSSP file:
# RESIDUE AA STRUCTURE BP1 BP2 ACC N-H-->O O-->H-N N-H-->O O-->H-N TCO KAPPA ALPHA PHI PSI X-CA Y-CA Z-CA
*/
boost::format kDSSPResidueLine(
"%5.5d%5.5d%1.1s%1.1s %c %c%c%c%c%c%c%c%c%c%4.4d%4.4d%c%4.4d %11s%11s%11s%11s %6.3f%6.1f%6.1f%6.1f%6.1f %6.1f %6.1f %6.1f");
auto& residue = info.residue();
if (residue.asymID().length() > 1)
throw std::runtime_error("This file contains data that won't fit in the original DSSP format");
char code = 'X';
if (mmcif::kAAMap.find(residue.compoundID()) != mmcif::kAAMap.end())
code = mmcif::kAAMap.at(residue.compoundID());
if (code == 'C') // a cysteine
{
auto ssbridgenr = info.ssBridgeNr();
if (ssbridgenr)
code = 'a' + ((ssbridgenr - 1) % 26);
}
char ss;
switch (info.ss())
{
case mmcif::ssAlphahelix: ss = 'H'; break;
case mmcif::ssBetabridge: ss = 'B'; break;
case mmcif::ssStrand: ss = 'E'; break;
case mmcif::ssHelix_3: ss = 'G'; break;
case mmcif::ssHelix_5: ss = 'I'; break;
case mmcif::ssHelix_PPII: ss = 'P'; break;
case mmcif::ssTurn: ss = 'T'; break;
case mmcif::ssBend: ss = 'S'; break;
case mmcif::ssLoop: ss = ' '; break;
}
char helix[4] = { ' ', ' ', ' ', ' ' };
for (mmcif::HelixType helixType: { mmcif::HelixType::rh_3_10, mmcif::HelixType::rh_alpha, mmcif::HelixType::rh_pi, mmcif::HelixType::rh_pp })
{
switch (info.helix(helixType))
{
case mmcif::Helix::None: helix[static_cast<int>(helixType)] = ' '; break;
case mmcif::Helix::Start: helix[static_cast<int>(helixType)] = '>'; break;
case mmcif::Helix::End: helix[static_cast<int>(helixType)] = '<'; break;
case mmcif::Helix::StartAndEnd: helix[static_cast<int>(helixType)] = 'X'; break;
case mmcif::Helix::Middle: helix[static_cast<int>(helixType)] = (helixType == mmcif::HelixType::rh_pp ? 'P' : static_cast<char>('3' + static_cast<int>(helixType))); break;
}
}
char bend = ' ';
if (info.bend())
bend = 'S';
double alpha = residue.alpha();
char chirality = alpha == 360 ? ' ' : (alpha < 0 ? '-' : '+');
uint32_t bp[2] = {};
char bridgelabel[2] = { ' ', ' ' };
for (uint32_t i: { 0, 1 })
{
const auto& [p, ladder, parallel] = info.bridgePartner(i);
if (not p)
continue;
bp[i] = p.nr() % 10000; // won't fit otherwise...
bridgelabel[i] = (parallel ? 'a' : 'A') + ladder % 26;
}
char sheet = ' ';
if (info.sheet() != 0)
sheet = 'A' + (info.sheet() - 1) % 26;
std::string NHO[2], ONH[2];
for (int i: { 0, 1 })
{
const auto& [donor, donorE] = info.donor(i);
const auto& [acceptor, acceptorE] = info.acceptor(i);
NHO[i] = ONH[i] = "0, 0.0";
if (acceptor)
{
auto d = acceptor.nr() - info.nr();
NHO[i] = (boost::format("%d,%3.1f") % d % acceptorE).str();
}
if (donor)
{
auto d = donor.nr() - info.nr();
ONH[i] = (boost::format("%d,%3.1f") % d % donorE).str();
}
}
auto ca = residue.atomByID("CA");
auto const& [cax, cay, caz] = ca.location();
return (kDSSPResidueLine % info.nr() % ca.authSeqID() % ca.pdbxAuthInsCode() % ca.authAsymID() % code %
ss % helix[3] % helix[0] % helix[1] % helix[2] % bend % chirality % bridgelabel[0] % bridgelabel[1] %
bp[0] % bp[1] % sheet % floor(info.accessibility() + 0.5) %
NHO[0] % ONH[0] % NHO[1] % ONH[1] %
residue.tco() % residue.kappa() % alpha % residue.phi() % residue.psi() %
cax % cay % caz).str();
}
void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std::ostream& os)
{
const std::string kFirstLine("==== Secondary Structure Definition by the program DSSP, NKI version 3.0 ==== ");
boost::format kHeaderLine("%1% %|127t|%2%");
using namespace boost::gregorian;
auto stats = dssp.GetStatistics();
date today = day_clock::local_day();
auto& cf = structure.getFile().file();
os << kHeaderLine % (kFirstLine + "DATE=" + to_iso_extended_string(today)) % '.' << std::endl
<< kHeaderLine % "REFERENCE W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637" % '.' << std::endl
<< GetPDBHEADERLine(cf, 127) << '.' << std::endl
<< GetPDBCOMPNDLine(cf, 127) << '.' << std::endl
<< GetPDBSOURCELine(cf, 127) << '.' << std::endl
<< GetPDBAUTHORLine(cf, 127) << '.' << std::endl;
os << boost::format("%5.5d%3.3d%3.3d%3.3d%3.3d TOTAL NUMBER OF RESIDUES, NUMBER OF CHAINS, NUMBER OF SS-BRIDGES(TOTAL,INTRACHAIN,INTERCHAIN) %|127t|%c") %
stats.nrOfResidues % stats.nrOfChains % stats.nrOfSSBridges % stats.nrOfIntraChainSSBridges % (stats.nrOfSSBridges - stats.nrOfIntraChainSSBridges) % '.' << std::endl;
os << kHeaderLine % (boost::format("%8.1f ACCESSIBLE SURFACE OF PROTEIN (ANGSTROM**2)") % stats.accessibleSurface) % '.' << std::endl;
// hydrogenbond summary
os << kHeaderLine % (
boost::format("%5.5d%5.1f TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(J) , SAME NUMBER PER 100 RESIDUES")
% stats.nrOfHBonds % (stats.nrOfHBonds * 100.0 / stats.nrOfResidues)) % '.' << std::endl;
os << kHeaderLine % (
boost::format("%5.5d%5.1f TOTAL NUMBER OF HYDROGEN BONDS IN PARALLEL BRIDGES, SAME NUMBER PER 100 RESIDUES")
% stats.nrOfHBondsInParallelBridges % (stats.nrOfHBondsInParallelBridges * 100.0 / stats.nrOfResidues)) % '.' << std::endl;
os << kHeaderLine % (
boost::format("%5.5d%5.1f TOTAL NUMBER OF HYDROGEN BONDS IN ANTIPARALLEL BRIDGES, SAME NUMBER PER 100 RESIDUES")
% stats.nrOfHBondsInAntiparallelBridges % (stats.nrOfHBondsInAntiparallelBridges * 100.0 / stats.nrOfResidues)) % '.' << std::endl;
boost::format kHBondsLine("%5.5d%5.1f TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I%c%1.1d), SAME NUMBER PER 100 RESIDUES");
for (int k = 0; k < 11; ++k)
os << kHeaderLine % (kHBondsLine % stats.nrOfHBondsPerDistance[k] % (stats.nrOfHBondsPerDistance[k] * 100.0 / stats.nrOfResidues) % (k - 5 < 0 ? '-' : '+') % abs(k - 5)) % '.' << std::endl;
// histograms...
os << " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 *** HISTOGRAMS OF *** ." << std::endl;
for (auto hi: stats.residuesPerAlphaHelixHistogram)
os << boost::format("%3.3d") % hi;
os << " RESIDUES PER ALPHA HELIX ." << std::endl;
for (auto hi: stats.parallelBridgesPerLadderHistogram)
os << boost::format("%3.3d") % hi;
os << " PARALLEL BRIDGES PER LADDER ." << std::endl;
for (auto hi: stats.antiparallelBridgesPerLadderHistogram)
os << boost::format("%3.3d") % hi;
os << " ANTIPARALLEL BRIDGES PER LADDER ." << std::endl;
for (auto hi: stats.laddersPerSheetHistogram)
os << boost::format("%3.3d") % hi;
os << " LADDERS PER SHEET ." << std::endl;
// per residue information
os << " # RESIDUE AA STRUCTURE BP1 BP2 ACC N-H-->O O-->H-N N-H-->O O-->H-N TCO KAPPA ALPHA PHI PSI X-CA Y-CA Z-CA" << std::endl;
boost::format kDSSPResidueLine(
"%5.5d !%c 0 0 0 0, 0.0 0, 0.0 0, 0.0 0, 0.0 0.000 360.0 360.0 360.0 360.0 0.0 0.0 0.0");
int last = 0;
for (auto ri: dssp)
{
// insert a break line whenever we detect missing residues
// can be the transition to a different chain, or missing residues in the current chain
if (ri.nr() != last + 1)
os << (kDSSPResidueLine % (last + 1) % (ri.chainBreak() == mmcif::ChainBreak::NewChain ? '*' : ' ')) << std::endl;
os << ResidueToDSSPLine(ri) << std::endl;
last = ri.nr();
}
}
void annotateDSSP(mmcif::Structure& structure, const mmcif::DSSP& dssp, bool writeOther, std::ostream& os)
{
auto& db = structure.getFile().data();
if (dssp.empty())
{
if (cif::VERBOSE)
std::cout << "No secondary structure information found" << std::endl;
}
else
{
// replace all struct_conf and struct_conf_type records
auto& structConfType = db["struct_conf_type"];
structConfType.clear();
auto& structConf = db["struct_conf"];
structConf.clear();
std::map<std::string,int> foundTypes;
auto st = dssp.begin(), lt = st;
auto lastSS = st->ss();
for (auto t = dssp.begin(); ; lt = t, ++t)
{
bool stop = t == dssp.end();
bool flush = (stop or t->ss() != lastSS);
if (flush and (writeOther or lastSS != mmcif::SecondaryStructureType::ssLoop))
{
auto& rb = st->residue();
auto& re = lt->residue();
std::string id;
switch (lastSS)
{
case mmcif::SecondaryStructureType::ssHelix_3:
id = "HELX_RH_3T_P";
break;
case mmcif::SecondaryStructureType::ssAlphahelix:
id = "HELX_RH_AL_P";
break;
case mmcif::SecondaryStructureType::ssHelix_5:
id = "HELX_RH_PI_P";
break;
case mmcif::SecondaryStructureType::ssHelix_PPII:
id = "HELX_LH_PP_P";
break;
case mmcif::SecondaryStructureType::ssTurn:
id = "TURN_TY1_P";
break;
case mmcif::SecondaryStructureType::ssBend:
id = "BEND";
break;
case mmcif::SecondaryStructureType::ssBetabridge:
case mmcif::SecondaryStructureType::ssStrand:
id = "STRN";
break;
case mmcif::SecondaryStructureType::ssLoop:
id = "OTHER";
break;
}
if (foundTypes.count(id) == 0)
{
structConfType.emplace({
{ "id", id },
{ "criteria", "DSSP" }
});
foundTypes[id] = 1;
}
structConf.emplace({
{ "conf_type_id", id },
{ "id", id + std::to_string(foundTypes[id]++) },
// { "pdbx_PDB_helix_id", vS(12, 14) },
{ "beg_label_comp_id", rb.compoundID() },
{ "beg_label_asym_id", rb.asymID() },
{ "beg_label_seq_id", rb.seqID() },
{ "pdbx_beg_PDB_ins_code", rb.authInsCode() },
{ "end_label_comp_id", re.compoundID() },
{ "end_label_asym_id", re.asymID() },
{ "end_label_seq_id", re.seqID() },
{ "pdbx_end_PDB_ins_code", re.authInsCode() },
{ "beg_auth_comp_id", rb.compoundID() },
{ "beg_auth_asym_id", rb.authAsymID() },
{ "beg_auth_seq_id", rb.authSeqID() },
{ "end_auth_comp_id", re.compoundID() },
{ "end_auth_asym_id", re.authAsymID() },
{ "end_auth_seq_id", re.authSeqID() }
// { "pdbx_PDB_helix_class", vS(39, 40) },
// { "details", vS(41, 70) },
// { "pdbx_PDB_helix_length", vI(72, 76) }
});
st = t;
}
if (lastSS != t->ss())
{
st = t;
lastSS = t->ss();
}
if (stop)
break;
}
}
db.add_software("dssp", "other", get_version_nr(), get_version_date());
db.write(os);
}
// --------------------------------------------------------------------
int d_main(int argc, const char* argv[]) int d_main(int argc, const char* argv[])
{ {
using namespace std::literals; using namespace std::literals;
...@@ -494,7 +116,7 @@ int d_main(int argc, const char* argv[]) ...@@ -494,7 +116,7 @@ int d_main(int argc, const char* argv[])
if (vm.count("version")) if (vm.count("version"))
{ {
std::cout << argv[0] << " version " << VERSION_STRING << std::endl; std::cout << argv[0] << " version " << get_version_string() << std::endl;
exit(0); exit(0);
} }
...@@ -623,7 +245,6 @@ int main(int argc, const char* argv[]) ...@@ -623,7 +245,6 @@ int main(int argc, const char* argv[])
#if defined(DATA_DIR) #if defined(DATA_DIR)
cif::addDataDirectory(DATA_DIR); cif::addDataDirectory(DATA_DIR);
#endif #endif
load_version_info(); load_version_info();
result = d_main(argc, argv); result = d_main(argc, argv);
......
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 NKI/AVL, Netherlands Cancer Institute
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
This source diff could not be displayed because it is too large. You can view the blob instead.
==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ==== DATE=2021-08-25 .
REFERENCE W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637 .
HEADER RETINOIC-ACID TRANSPORT 28-SEP-94 1CBS .
COMPND MOL_ID: 1; MOLECULE: CELLULAR RETINOIC ACID BINDING PROTEIN TYPE II; CHAIN: A; ENGINEERED: YES .
SOURCE MOL_ID: 1; ORGANISM_COMMON: human; GENE: HUMAN CRABP-II; CELL_LINE: BL21; ORGANISM_SCIENTIFIC: Homo sapiens; ORGA... .
AUTHOR G.J.Kleywegt; T.Bergfors; T.A.Jones .
137 1 0 0 0 TOTAL NUMBER OF RESIDUES, NUMBER OF CHAINS, NUMBER OF SS-BRIDGES(TOTAL,INTRACHAIN,INTERCHAIN) .
7905.0 ACCESSIBLE SURFACE OF PROTEIN (ANGSTROM**2) .
94 68.6 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(J) , SAME NUMBER PER 100 RESIDUES .
0 0.0 TOTAL NUMBER OF HYDROGEN BONDS IN PARALLEL BRIDGES, SAME NUMBER PER 100 RESIDUES .
65 47.4 TOTAL NUMBER OF HYDROGEN BONDS IN ANTIPARALLEL BRIDGES, SAME NUMBER PER 100 RESIDUES .
0 0.0 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I-5), SAME NUMBER PER 100 RESIDUES .
3 2.2 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I-4), SAME NUMBER PER 100 RESIDUES .
4 2.9 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I-3), SAME NUMBER PER 100 RESIDUES .
0 0.0 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I-2), SAME NUMBER PER 100 RESIDUES .
0 0.0 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I-1), SAME NUMBER PER 100 RESIDUES .
0 0.0 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I+0), SAME NUMBER PER 100 RESIDUES .
0 0.0 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I+1), SAME NUMBER PER 100 RESIDUES .
7 5.1 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I+2), SAME NUMBER PER 100 RESIDUES .
9 6.6 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I+3), SAME NUMBER PER 100 RESIDUES .
14 10.2 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I+4), SAME NUMBER PER 100 RESIDUES .
1 0.7 TOTAL NUMBER OF HYDROGEN BONDS OF TYPE O(I)-->H-N(I+5), SAME NUMBER PER 100 RESIDUES .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 *** HISTOGRAMS OF *** .
0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 RESIDUES PER ALPHA HELIX .
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 PARALLEL BRIDGES PER LADDER .
0 0 1 1 1 1 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ANTIPARALLEL BRIDGES PER LADDER .
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 LADDERS PER SHEET .
# RESIDUE AA STRUCTURE BP1 BP2 ACC N-H-->O O-->H-N N-H-->O O-->H-N TCO KAPPA ALPHA PHI PSI X-CA Y-CA Z-CA
1 1 A P 0 0 64 0, 0.0 2,-0.5 0, 0.0 91,-0.0 0.000 360.0 360.0 360.0 151.2 18.1 13.5 43.7
2 2 A N + 0 0 89 1,-0.1 89,-0.0 2,-0.1 44,-0.0 -0.903 360.0 172.5-124.5 100.5 20.6 16.5 43.6
3 3 A F + 0 0 1 -2,-0.5 40,-0.2 110,-0.0 -1,-0.1 0.524 40.0 127.0 -80.0 -9.9 21.1 17.8 40.1
4 4 A S + 0 0 28 41,-0.1 2,-0.3 38,-0.1 40,-0.2 -0.158 37.2 69.9 -55.6 140.2 23.2 20.8 41.5
5 5 A G E S-A 43 0A 19 38,-2.5 38,-2.6 2,-0.1 2,-0.6 -0.868 82.5 -67.6 145.0 177.2 26.6 21.5 40.1
6 6 A N E -A 42 0A 78 -2,-0.3 131,-2.8 36,-0.2 2,-0.4 -0.958 54.1-159.8-104.9 115.8 28.8 22.7 37.2
7 7 A W E -AB 41 136A 1 34,-2.8 34,-1.4 -2,-0.6 2,-0.4 -0.824 13.0-164.1-107.0 141.0 28.5 20.1 34.4
8 8 A K E - B 0 135A 92 127,-3.0 127,-2.3 -2,-0.4 2,-0.1 -0.933 28.2-112.8-119.6 141.9 30.8 19.4 31.5
9 9 A I E + B 0 134A 26 30,-0.4 125,-0.3 -2,-0.4 3,-0.1 -0.449 32.7 170.7 -78.1 144.9 29.7 17.4 28.4
10 10 A I E + 0 0A 86 123,-3.1 2,-0.3 1,-0.4 124,-0.2 0.456 69.4 21.2-126.0 -12.2 31.3 14.0 27.7
11 11 A R E - B 0 133A 141 122,-1.3 122,-2.5 2,-0.0 -1,-0.4 -0.954 53.6-178.8-159.0 138.7 29.0 12.7 24.9
12 12 A S E - B 0 132A 48 -2,-0.3 2,-0.4 120,-0.2 120,-0.2 -0.982 9.1-177.7-140.7 127.1 26.6 14.2 22.3
13 13 A E E - B 0 131A 95 118,-2.5 118,-1.5 -2,-0.4 -2,-0.0 -0.986 62.7 -1.8-128.8 138.0 24.6 12.3 19.8
14 14 A N S > S+ 0 0 64 -2,-0.4 4,-1.6 116,-0.2 5,-0.1 0.655 75.6 137.6 65.5 22.9 22.2 13.4 17.0
15 15 A F H > S+ 0 0 23 2,-0.2 4,-1.9 1,-0.2 5,-0.1 0.940 73.9 44.8 -66.9 -48.6 22.4 17.2 17.7
16 16 A E H > S+ 0 0 67 1,-0.2 4,-2.0 2,-0.2 -1,-0.2 0.902 111.2 55.1 -61.6 -39.6 22.6 18.3 14.1
17 17 A E H > S+ 0 0 91 1,-0.2 4,-1.8 2,-0.2 -1,-0.2 0.857 106.0 52.0 -60.9 -36.1 19.8 15.9 13.1
18 18 A L H X S+ 0 0 1 -4,-1.6 4,-1.7 1,-0.2 -1,-0.2 0.921 109.6 49.8 -65.5 -43.2 17.5 17.5 15.8
19 19 A L H <>S+ 0 0 5 -4,-1.9 5,-2.4 1,-0.2 -2,-0.2 0.852 106.3 56.4 -65.4 -32.2 18.3 20.9 14.3
20 20 A K H ><5S+ 0 0 103 -4,-2.0 3,-1.5 1,-0.2 -1,-0.2 0.929 106.5 48.6 -65.1 -45.5 17.4 19.6 10.8
21 21 A V H 3<5S+ 0 0 53 -4,-1.8 -1,-0.2 1,-0.3 -2,-0.2 0.860 107.3 56.5 -62.3 -36.0 14.0 18.5 11.9
22 22 A L T 3<5S- 0 0 10 -4,-1.7 -1,-0.3 -5,-0.1 -2,-0.2 0.481 120.3-112.1 -75.2 -4.6 13.4 21.9 13.6
23 23 A G T < 5 + 0 0 63 -3,-1.5 2,-0.4 1,-0.2 -3,-0.2 0.696 58.8 158.5 84.0 20.3 14.1 23.5 10.2
24 24 A V < - 0 0 28 -5,-2.4 -1,-0.2 1,-0.1 -2,-0.1 -0.661 41.2-117.3 -79.6 130.0 17.4 25.2 10.9
25 25 A N > - 0 0 92 -2,-0.4 4,-2.5 1,-0.1 3,-0.2 -0.143 25.5-100.1 -67.0 161.3 19.4 25.9 7.6
26 26 A V H > S+ 0 0 97 1,-0.2 4,-1.9 2,-0.2 5,-0.1 0.835 117.9 43.9 -47.2 -52.0 22.8 24.4 6.7
27 27 A M H > S+ 0 0 148 2,-0.2 4,-1.7 1,-0.2 -1,-0.2 0.862 114.2 48.8 -67.6 -38.7 24.9 27.4 7.6
28 28 A L H > S+ 0 0 97 -3,-0.2 4,-2.6 2,-0.2 -1,-0.2 0.872 110.3 54.0 -68.8 -34.0 23.2 28.2 10.9
29 29 A R H X S+ 0 0 26 -4,-2.5 4,-3.0 2,-0.2 5,-0.3 0.924 104.0 54.4 -63.4 -44.3 23.5 24.5 11.8
30 30 A K H X S+ 0 0 164 -4,-1.9 4,-1.6 1,-0.2 -1,-0.2 0.928 111.7 44.7 -54.8 -47.3 27.2 24.6 11.2
31 31 A I H X S+ 0 0 93 -4,-1.7 4,-1.9 1,-0.2 -2,-0.2 0.935 114.7 48.3 -62.9 -48.6 27.6 27.5 13.7
32 32 A A H X S+ 0 0 28 -4,-2.6 4,-2.6 1,-0.2 -2,-0.2 0.914 109.1 51.5 -61.0 -48.3 25.3 25.9 16.3
33 33 A V H X S+ 0 0 49 -4,-3.0 4,-0.5 1,-0.2 -1,-0.2 0.880 110.3 48.7 -59.1 -41.5 26.9 22.5 16.3
34 34 A A H >< S+ 0 0 61 -4,-1.6 3,-0.8 -5,-0.3 4,-0.2 0.933 115.2 43.9 -65.9 -45.8 30.4 23.9 16.8
35 35 A A H >< S+ 0 0 4 -4,-1.9 3,-1.2 1,-0.2 22,-0.2 0.878 110.0 56.3 -68.1 -36.3 29.4 26.1 19.7
36 36 A A H 3< S+ 0 0 10 -4,-2.6 -1,-0.2 1,-0.2 -2,-0.2 0.552 88.7 76.5 -73.9 -8.6 27.3 23.4 21.3
37 37 A S T << S+ 0 0 74 -3,-0.8 -1,-0.2 -4,-0.5 -2,-0.1 0.667 103.3 35.9 -76.7 -14.7 30.2 21.0 21.5
38 38 A K S < S+ 0 0 129 -3,-1.2 -1,-0.2 -4,-0.2 19,-0.1 -0.500 80.2 163.6-135.8 65.0 31.7 22.9 24.5
39 39 A P - 0 0 13 0, 0.0 2,-0.5 0, 0.0 -30,-0.4 -0.429 32.9-139.6 -84.3 157.8 28.9 24.2 26.7
40 40 A A E - C 0 55A 56 15,-2.1 15,-3.0 -2,-0.1 2,-0.5 -0.988 25.8-169.0-111.4 121.5 29.2 25.4 30.3
41 41 A V E -AC 7 54A 7 -34,-1.4 -34,-2.8 -2,-0.5 2,-0.5 -0.976 9.8-176.7-119.1 128.1 26.2 24.2 32.3
42 42 A E E -AC 6 53A 56 11,-2.5 11,-2.6 -2,-0.5 2,-0.4 -0.984 2.8-175.2-124.9 124.3 25.3 25.3 35.8
43 43 A I E -AC 5 52A 3 -38,-2.6 -38,-2.5 -2,-0.5 2,-0.4 -0.963 6.0-174.1-121.0 134.3 22.4 23.9 37.8
44 44 A K E - C 0 51A 114 7,-2.2 7,-1.8 -2,-0.4 2,-0.4 -0.998 10.8-174.0-126.7 121.9 21.1 25.1 41.2
45 45 A Q E + C 0 50A 29 -2,-0.4 2,-0.4 5,-0.2 5,-0.2 -0.969 17.1 177.2-122.2 135.7 18.4 23.0 42.9
46 46 A E E > S- C 0 49A 166 3,-2.5 3,-1.7 -2,-0.4 2,-0.5 -0.849 71.6 -60.6-134.0 90.9 16.4 23.7 46.1
47 47 A G T 3 S- 0 0 51 -2,-0.4 -1,-0.0 1,-0.3 19,-0.0 -0.529 121.1 -13.7 71.2-119.2 13.9 21.0 46.5
48 48 A D T 3 S+ 0 0 67 -2,-0.5 19,-2.4 -3,-0.1 2,-0.5 0.233 116.9 99.1-101.2 12.8 11.6 21.1 43.4
49 49 A T E < -CD 46 66A 69 -3,-1.7 -3,-2.5 17,-0.2 2,-0.3 -0.888 54.3-172.5-104.0 129.6 12.9 24.6 42.3
50 50 A F E -CD 45 65A 2 15,-3.0 15,-2.1 -2,-0.5 2,-0.4 -0.901 22.3-170.5-127.8 149.5 15.5 24.7 39.6
51 51 A Y E -CD 44 64A 41 -7,-1.8 -7,-2.2 -2,-0.3 2,-0.4 -0.995 16.4-175.9-132.3 124.9 17.7 27.3 37.9
52 52 A I E -CD 43 63A 2 11,-2.3 11,-2.5 -2,-0.4 2,-0.5 -0.980 5.8-174.6-131.1 119.3 19.5 26.0 34.8
53 53 A K E -CD 42 62A 71 -11,-2.6 -11,-2.5 -2,-0.4 2,-0.5 -0.967 0.6-175.0-115.1 121.8 22.0 28.1 32.9
54 54 A T E -CD 41 61A 32 7,-2.5 7,-2.3 -2,-0.5 2,-0.4 -0.969 11.8-170.1-118.9 119.0 23.5 26.7 29.6
55 55 A S E +CD 40 60A 40 -15,-3.0 -15,-2.1 -2,-0.5 2,-0.3 -0.888 16.2 157.5-120.5 137.5 26.2 28.9 28.0
56 56 A T - 0 0 29 3,-0.9 3,-0.3 -2,-0.4 -20,-0.1 -0.899 55.0 -98.1-140.6 168.5 28.0 28.8 24.7
57 57 A T S S+ 0 0 113 -2,-0.3 3,-0.1 -22,-0.2 -21,-0.0 0.701 122.9 34.9 -62.8 -20.9 29.9 31.5 22.6
58 58 A V S S+ 0 0 85 1,-0.3 2,-0.3 -26,-0.1 -1,-0.2 0.543 126.6 14.3-112.4 -10.4 26.7 32.1 20.5
59 59 A R - 0 0 97 -3,-0.3 -3,-0.9 -24,-0.1 2,-0.4 -0.899 52.0-169.3-169.0 135.3 23.8 31.7 22.9
60 60 A T E -D 55 0A 67 -2,-0.3 2,-0.4 -5,-0.2 -5,-0.2 -0.986 9.4-169.0-129.9 134.7 23.1 31.5 26.6
61 61 A T E -D 54 0A 51 -7,-2.3 -7,-2.5 -2,-0.4 2,-0.4 -0.957 4.9-170.6-124.3 144.3 19.8 30.4 28.2
62 62 A E E -D 53 0A 112 -2,-0.4 2,-0.3 -9,-0.2 -9,-0.2 -0.978 10.4-175.8-133.9 117.2 18.7 30.7 31.8
63 63 A I E -D 52 0A 20 -11,-2.5 -11,-2.3 -2,-0.4 2,-0.4 -0.892 10.3-166.6-118.8 147.4 15.5 29.0 32.9
64 64 A N E +D 51 0A 109 -2,-0.3 2,-0.3 -13,-0.2 -13,-0.2 -0.987 23.9 152.5-130.4 122.4 13.8 29.1 36.3
65 65 A F E -D 50 0A 10 -15,-2.1 -15,-3.0 -2,-0.4 2,-0.4 -0.977 38.3-140.1-149.7 160.9 11.1 26.6 37.1
66 66 A K E > -D 49 0A 82 3,-0.4 3,-2.0 -2,-0.3 19,-0.3 -0.972 44.0-104.7-117.8 132.7 9.3 24.7 39.8
67 67 A V T 3 S+ 0 0 16 -19,-2.4 19,-0.2 -2,-0.4 3,-0.1 -0.410 107.2 20.4 -59.2 130.3 8.3 21.1 39.0
68 68 A G T 3 S+ 0 0 48 17,-2.7 2,-0.5 1,-0.2 -1,-0.3 0.378 103.5 101.8 91.4 -2.6 4.6 21.0 38.3
69 69 A E S < S- 0 0 111 -3,-2.0 -3,-0.4 16,-0.1 16,-0.4 -0.957 74.5-116.4-119.7 127.6 4.2 24.7 37.6
70 70 A E + 0 0 126 -2,-0.5 2,-0.3 14,-0.1 14,-0.2 -0.295 39.9 168.6 -62.3 140.7 3.9 26.1 34.1
71 71 A F E -E 83 0A 25 12,-2.4 12,-3.2 -6,-0.1 2,-0.4 -0.902 30.8-112.1-143.5 174.1 6.6 28.4 32.8
72 72 A E E +E 82 0A 112 -2,-0.3 10,-0.2 10,-0.2 2,-0.2 -0.936 45.1 135.3-119.4 132.7 7.8 30.1 29.6
73 73 A E E -E 81 0A 25 8,-2.1 8,-2.4 -2,-0.4 2,-0.3 -0.644 46.1 -93.1-144.9-154.3 11.1 29.3 27.8
74 74 A Q E -E 80 0A 83 6,-0.3 25,-0.0 -2,-0.2 2,-0.0 -0.963 28.5-111.5-135.1 153.8 12.2 28.7 24.2
75 75 A T > - 0 0 1 4,-2.6 3,-2.1 -2,-0.3 6,-0.0 -0.283 47.6 -93.9 -71.7 171.4 12.7 25.7 22.1
76 76 A V T 3 S+ 0 0 54 1,-0.3 -1,-0.1 2,-0.1 -57,-0.0 0.849 128.4 51.8 -56.9 -37.1 16.3 24.8 21.0
77 77 A D T 3 S- 0 0 49 2,-0.1 -1,-0.3 1,-0.0 -2,-0.0 0.327 127.9 -97.4 -83.5 6.0 15.9 26.7 17.8
78 78 A G S < S+ 0 0 23 -3,-2.1 -2,-0.1 1,-0.2 -1,-0.0 0.611 72.7 141.1 93.1 16.9 14.7 29.8 19.7
79 79 A R - 0 0 64 1,-0.1 -4,-2.6 21,-0.0 -1,-0.2 -0.765 54.5-109.8 -96.9 133.7 10.9 29.8 19.6
80 80 A P E +E 74 0A 50 0, 0.0 20,-1.6 0, 0.0 21,-0.5 -0.292 46.8 167.2 -58.4 138.3 8.8 30.9 22.7
81 81 A C E -EF 73 99A 1 -8,-2.4 -8,-2.1 18,-0.2 2,-0.5 -0.957 38.3-118.4-150.0 160.5 6.9 28.1 24.3
82 82 A K E -EF 72 98A 60 16,-2.5 16,-2.1 -2,-0.3 2,-0.3 -0.910 38.2-165.0-100.8 129.3 5.0 27.2 27.5
83 83 A S E -EF 71 97A 1 -12,-3.2 -12,-2.4 -2,-0.5 2,-0.4 -0.889 17.2-169.4-121.5 152.9 6.6 24.4 29.4
84 84 A L E - F 0 96A 43 12,-1.4 12,-2.0 -2,-0.3 2,-0.4 -0.956 10.3-159.2-142.2 117.6 5.6 22.0 32.2
85 85 A V E + F 0 95A 0 -16,-0.4 -17,-2.7 -2,-0.4 2,-0.3 -0.800 14.0 174.8-100.5 138.7 8.0 19.7 34.0
86 86 A K E - F 0 94A 129 8,-2.4 8,-2.6 -2,-0.4 2,-0.8 -0.944 39.0-104.1-136.9 158.9 6.9 16.6 35.9
87 87 A W E - F 0 93A 77 -2,-0.3 6,-0.2 6,-0.2 3,-0.1 -0.765 29.3-178.2 -84.3 111.9 8.8 13.8 37.7
88 88 A E E S- 0 0A 121 4,-2.5 2,-0.3 -2,-0.8 -1,-0.2 0.875 78.2 -15.4 -73.2 -40.5 8.5 10.8 35.4
89 89 A S E > S- F 0 92A 60 3,-1.7 3,-1.2 -3,-0.2 -1,-0.3 -0.870 89.8 -77.8-147.6 178.8 10.4 9.0 38.2
90 90 A E T 3 S+ 0 0 148 -2,-0.3 3,-0.0 1,-0.2 -3,-0.0 0.832 129.7 27.0 -53.9 -37.5 12.4 9.8 41.3
91 91 A N T 3 S+ 0 0 59 1,-0.1 22,-2.1 22,-0.0 2,-0.4 0.218 112.5 75.7-112.6 15.7 15.6 10.8 39.3
92 92 A K E < -FG 89 112A 38 -3,-1.2 -4,-2.5 20,-0.2 -3,-1.7 -0.974 53.0-169.2-137.7 122.3 14.0 11.8 36.0
93 93 A M E -FG 87 111A 0 18,-2.6 18,-2.0 -2,-0.4 2,-0.4 -0.837 8.1-161.9-106.2 143.0 12.2 15.0 35.0
94 94 A V E -FG 86 110A 39 -8,-2.6 -8,-2.4 -2,-0.4 2,-0.5 -0.986 1.9-157.3-125.6 138.7 10.3 15.3 31.7
95 95 A C E -FG 85 109A 0 14,-3.1 14,-1.5 -2,-0.4 2,-0.4 -0.966 1.7-159.1-122.0 124.5 9.2 18.6 30.1
96 96 A E E -FG 84 108A 123 -12,-2.0 -12,-1.4 -2,-0.5 2,-0.4 -0.855 15.7-156.1 -99.8 132.1 6.3 19.0 27.6
97 97 A Q E -F 83 0A 12 10,-1.5 10,-0.4 -2,-0.4 2,-0.4 -0.895 10.9-169.7-114.4 144.9 6.5 22.1 25.4
98 98 A K E -F 82 0A 131 -16,-2.1 -16,-2.5 -2,-0.4 2,-0.1 -0.988 28.2-118.8-134.2 119.6 3.7 24.0 23.6
99 99 A L E -F 81 0A 37 -2,-0.4 -18,-0.2 -18,-0.2 3,-0.1 -0.354 11.5-147.7 -60.2 132.2 4.4 26.7 21.0
100 100 A L S S+ 0 0 52 -20,-1.6 2,-0.3 1,-0.2 -1,-0.1 0.859 84.4 11.3 -67.3 -37.4 2.9 30.1 22.1
101 101 A K S S+ 0 0 148 -21,-0.5 -1,-0.2 2,-0.0 2,-0.1 -0.997 113.0 4.8-144.1 142.6 2.3 31.0 18.4
102 102 A G S S- 0 0 59 -2,-0.3 2,-0.3 -3,-0.1 -3,-0.1 -0.340 76.5 -76.8 87.0-168.2 2.4 29.0 15.2
103 103 A E + 0 0 184 -2,-0.1 -2,-0.0 3,-0.0 3,-0.0 -0.879 52.2 128.8-132.0 164.5 3.0 25.3 14.4
104 104 A G - 0 0 44 -2,-0.3 -5,-0.1 -5,-0.0 -82,-0.1 -0.963 58.5 -33.3 169.2-177.6 6.0 23.0 14.2
105 105 A P - 0 0 23 0, 0.0 2,-0.4 0, 0.0 -83,-0.0 -0.225 67.0-102.9 -59.3 151.2 7.3 19.6 15.4
106 106 A K - 0 0 96 -8,-0.1 20,-2.7 -3,-0.0 2,-0.3 -0.674 48.7-165.6 -76.9 125.9 6.3 18.5 18.9
107 107 A T E + H 0 125A 11 -2,-0.4 -10,-1.5 -10,-0.4 2,-0.3 -0.856 18.9 154.7-118.8 155.7 9.2 19.1 21.2
108 108 A S E -GH 96 124A 32 16,-1.4 16,-2.7 -2,-0.3 2,-0.3 -0.947 19.8-150.9-161.2 170.5 10.2 18.0 24.7
109 109 A W E -GH 95 123A 14 -14,-1.5 -14,-3.1 -2,-0.3 2,-0.3 -0.975 4.3-163.0-149.0 154.2 13.2 17.4 26.9
110 110 A T E -GH 94 122A 13 12,-2.0 12,-2.3 -2,-0.3 2,-0.4 -0.971 1.6-163.6-137.0 150.2 14.2 15.2 29.8
111 111 A R E +GH 93 121A 25 -18,-2.0 -18,-2.6 -2,-0.3 2,-0.3 -0.997 16.0 174.7-134.8 130.2 17.0 15.4 32.4
112 112 A E E -GH 92 120A 52 8,-2.0 8,-2.7 -2,-0.4 2,-0.6 -1.000 28.6-136.1-142.5 143.9 18.0 12.4 34.5
113 113 A L E - H 0 119A 28 -22,-2.1 6,-0.2 -2,-0.3 2,-0.1 -0.866 30.0-148.1 -95.8 122.9 20.6 11.5 37.1
114 114 A T > - 0 0 40 4,-2.4 3,-1.7 -2,-0.6 -22,-0.0 -0.402 26.2-103.8 -89.5 168.1 22.1 8.1 36.5
115 115 A N T 3 S+ 0 0 179 1,-0.3 -1,-0.1 2,-0.1 -2,-0.0 0.705 117.8 58.2 -62.1 -23.8 23.4 5.5 39.0
116 116 A D T 3 S- 0 0 108 2,-0.0 -1,-0.3 0, 0.0 -3,-0.0 0.354 122.5-100.0 -88.4 4.3 27.1 6.4 38.1
117 117 A G S < S+ 0 0 37 -3,-1.7 19,-0.3 1,-0.3 -2,-0.1 0.513 82.4 124.3 91.4 6.2 26.7 10.0 39.0
118 118 A E - 0 0 53 17,-0.1 -4,-2.4 15,-0.0 2,-0.4 -0.405 55.4-126.8 -95.6 171.5 26.2 11.4 35.5
119 119 A L E -HI 113 134A 2 15,-2.3 15,-2.7 -6,-0.2 2,-0.5 -0.980 15.1-160.0-121.9 126.8 23.5 13.5 33.9
120 120 A I E -HI 112 133A 38 -8,-2.7 -8,-2.0 -2,-0.4 2,-0.4 -0.956 6.4-170.8-109.9 123.8 21.6 12.5 30.7
121 121 A L E -HI 111 132A 10 11,-3.1 11,-2.7 -2,-0.5 2,-0.4 -0.932 3.2-171.6-108.9 129.8 19.8 15.2 28.8
122 122 A T E -HI 110 131A 22 -12,-2.3 -12,-2.0 -2,-0.4 2,-0.4 -0.970 3.8-167.5-121.6 141.7 17.5 14.2 25.9
123 123 A M E -HI 109 130A 24 7,-2.0 7,-3.1 -2,-0.4 2,-0.4 -0.998 9.6-161.5-125.0 135.5 15.9 16.6 23.5
124 124 A T E +HI 108 129A 30 -16,-2.7 -16,-1.4 -2,-0.4 2,-0.4 -0.935 19.0 178.7-124.9 143.7 13.1 15.5 21.1
125 125 A A E > S-HI 107 128A 0 3,-2.1 3,-2.5 -2,-0.4 -18,-0.2 -0.925 73.9 -54.0-140.0 107.7 11.6 17.0 17.9
126 126 A D T 3 S- 0 0 88 -20,-2.7 -18,-0.0 -2,-0.4 -1,-0.0 -0.384 123.7 -18.3 55.7-116.0 8.9 14.7 16.5
127 127 A D T 3 S+ 0 0 160 -2,-0.2 2,-0.5 -3,-0.1 -1,-0.3 0.444 114.9 98.5-100.3 2.3 10.7 11.3 16.3
128 128 A V E < - I 0 125A 37 -3,-2.5 -3,-2.1 -110,-0.1 2,-0.4 -0.776 54.5-163.7 -93.6 129.4 14.3 12.5 16.4
129 129 A V E - I 0 124A 65 -2,-0.5 2,-0.5 -5,-0.2 -5,-0.2 -0.950 7.7-158.5-118.4 128.4 16.1 12.3 19.8
130 130 A C E - I 0 123A 0 -7,-3.1 -7,-2.0 -2,-0.4 2,-0.5 -0.908 11.2-160.7-103.2 129.9 19.3 14.0 20.8
131 131 A T E +BI 13 122A 49 -118,-1.5 -118,-2.5 -2,-0.5 2,-0.4 -0.947 11.6 176.6-116.6 123.9 21.2 12.5 23.7
132 132 A R E -BI 12 121A 14 -11,-2.7 -11,-3.1 -2,-0.5 2,-0.4 -0.990 10.2-160.7-128.1 136.6 23.9 14.4 25.7
133 133 A V E -BI 11 120A 16 -122,-2.5 -123,-3.1 -2,-0.4 -122,-1.3 -0.947 10.3-175.8-120.4 137.5 25.7 13.1 28.7
134 134 A Y E -BI 9 119A 11 -15,-2.7 -15,-2.3 -2,-0.4 2,-0.3 -0.896 12.9-164.0-131.0 162.0 27.5 15.2 31.3
135 135 A V E -B 8 0A 51 -127,-2.3 -127,-3.0 -2,-0.3 -17,-0.1 -0.938 40.8 -90.9-137.8 151.6 29.7 14.8 34.4
136 136 A R E B 7 0A 96 -19,-0.3 -129,-0.3 -2,-0.3 -131,-0.0 -0.432 360.0 360.0 -67.1 146.1 30.5 17.4 37.0
137 137 A E 0 0 182 -131,-2.8 -131,-0.2 -2,-0.1 -1,-0.1 -0.363 360.0 360.0 -61.5 360.0 33.6 19.4 36.4
\ No newline at end of file
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 NKI/AVL, Netherlands Cancer Institute
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define BOOST_TEST_MODULE DSSP_Test
#include <boost/test/included/unit_test.hpp>
#include <boost/algorithm/string.hpp>
#include <stdexcept>
#include <cif++/Structure.hpp>
#include <cif++/Secondary.hpp>
#include <cif++/CifUtils.hpp>
#include <cif++/Cif2PDB.hpp>
#include "dssp.hpp"
namespace ba = boost::algorithm;
// --------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(ut_dssp)
{
using namespace std::literals;
mmcif::File f("1cbs.cif.gz");
mmcif::Structure structure(f, 1, mmcif::StructureOpenOptions::SkipHydrogen);
mmcif::DSSP dssp(structure, 3, true);
std::stringstream test;
writeDSSP(structure, dssp, test);
std::ifstream reference("1cbs.dssp");
BOOST_ASSERT(reference.is_open());
std::string line_t, line_r;
BOOST_ASSERT (std::getline(test, line_t) and std::getline(reference, line_r));
BOOST_ASSERT(line_t.compare(0, 104, "==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ==== ") == 0);
for (int line_nr = 1; ; ++line_nr)
{
bool done_t = not std::getline(test, line_t);
bool done_r = not std::getline(reference, line_r);
BOOST_CHECK_EQUAL(done_r, done_t);
if (done_r)
break;
if (line_t != line_r)
std::cerr << line_nr << std::endl
<< line_t << std::endl
<< line_r << std::endl;
BOOST_CHECK(line_t == line_r);
}
BOOST_CHECK(test.eof());
BOOST_CHECK(reference.eof());
}
BOOST_AUTO_TEST_CASE(ut_mmcif)
{
using namespace std::literals;
mmcif::File f("1cbs.cif.gz");
mmcif::Structure structure(f, 1, mmcif::StructureOpenOptions::SkipHydrogen);
mmcif::DSSP dssp(structure, 3, true);
std::stringstream test;
annotateDSSP(structure, dssp, true, test);
std::ifstream reference("1cbs-dssp.cif");
BOOST_ASSERT(reference.is_open());
std::string line_t, line_r;
BOOST_ASSERT (std::getline(test, line_t) and std::getline(reference, line_r));
BOOST_ASSERT(line_t.compare(0, 104, "==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ==== ") == 0);
for (int line_nr = 1; ; ++line_nr)
{
bool done_t = not std::getline(test, line_t);
bool done_r = not std::getline(reference, line_r);
BOOST_CHECK_EQUAL(done_r, done_t);
if (done_r)
break;
if (line_t != line_r)
std::cerr << line_nr << std::endl
<< line_t << std::endl
<< line_r << std::endl;
BOOST_CHECK(line_t == line_r);
}
BOOST_CHECK(test.eof());
BOOST_CHECK(reference.eof());
}
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