From db629fb2282a5d9c58048d6ca833027e5a214cf3 Mon Sep 17 00:00:00 2001 From: "Maarten L. Hekkelman" Date: Wed, 31 May 2023 12:40:23 +0200 Subject: [PATCH] Fix legacy output --- src/dssp-io.cpp | 8 ++++++-- test/unit-test-dssp.cpp | 12 ++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/dssp-io.cpp b/src/dssp-io.cpp index 1b4d2f0..5eebd7f 100644 --- a/src/dssp-io.cpp +++ b/src/dssp-io.cpp @@ -139,7 +139,11 @@ std::string ResidueToDSSPLine(const dssp::residue_info &info) 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(), + residue.tco().value_or(0), + residue.kappa().value_or(360), + residue.alpha().value_or(360), + residue.phi().value_or(360), + residue.psi().value_or(360), cax, cay, caz) .str(); } @@ -153,7 +157,7 @@ void writeDSSP(const dssp &dssp, std::ostream &os) std::time_t today = system_clock::to_time_t(system_clock::now()); std::tm *tm = std::gmtime(&today); - os << "==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ==== DATE=" << std::put_time(tm, "%F") << " ." << std::endl + os << "==== Secondary Structure Definition by the program DSSP, NKI version 4.3 ==== DATE=" << std::put_time(tm, "%F") << " ." << std::endl << "REFERENCE W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637 ." << std::endl << dssp.get_pdb_header_line(dssp::pdb_record_type::HEADER) << '.' << std::endl << dssp.get_pdb_header_line(dssp::pdb_record_type::COMPND) << '.' << std::endl diff --git a/test/unit-test-dssp.cpp b/test/unit-test-dssp.cpp index 6b298fb..b730667 100644 --- a/test/unit-test-dssp.cpp +++ b/test/unit-test-dssp.cpp @@ -97,9 +97,9 @@ BOOST_AUTO_TEST_CASE(ut_dssp) std::string line_t, line_r; BOOST_CHECK(std::getline(test, line_t) and std::getline(reference, line_r)); - const char *kHeaderLineStart = "==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ===="; + const char *kHeaderLineStart = "==== Secondary Structure Definition by the program DSSP, NKI version 4.3 ===="; BOOST_CHECK(line_t.compare(0, std::strlen(kHeaderLineStart), kHeaderLineStart) == 0); - BOOST_CHECK(line_r.compare(0, std::strlen(kHeaderLineStart), kHeaderLineStart) == 0); + // BOOST_CHECK(line_r.compare(0, std::strlen(kHeaderLineStart), kHeaderLineStart) == 0); for (int line_nr = 2;; ++line_nr) { @@ -115,7 +115,11 @@ BOOST_AUTO_TEST_CASE(ut_dssp) << line_t << std::endl << line_r << std::endl; - BOOST_CHECK(line_t == line_r); + if (line_t != line_r) + { + BOOST_CHECK(line_t == line_r); + break; + } } BOOST_CHECK(test.eof()); @@ -164,7 +168,7 @@ BOOST_AUTO_TEST_CASE(dssp_1) std::string line; getline(t, line); - std::cout << line << std::endl; + // std::cout << line << std::endl; auto fld = cif::split(line, "\t");