Write full ID in legacy output

This commit is contained in:
Maarten L. Hekkelman
2026-04-21 12:25:26 +02:00
parent 7eb2189187
commit 2c0520571a
2 changed files with 4 additions and 8 deletions

View File

@@ -165,7 +165,7 @@ void writeDSSP(const dssp &dssp, std::ostream &os)
version.insert(version.end(), 10 - version.length(), ' ');
os << "==== Secondary Structure Definition by the program DSSP, NKI version " << version << " ==== DATE=" << std::put_time(tm, "%F") << " .\n"
<< "REFERENCE M.L. HEKKELMAN ET AL, PROTEIN SCIENCE 34.8 (2025) e70208; W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637    .\n"
<< "REFERENCE M.L. HEKKELMAN ET AL, PROTEIN SCIENCE 34.8 (2025) e70208; W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637 .\n"
<< dssp.get_pdb_header_line(dssp::pdb_record_type::HEADER) << ".\n"
<< dssp.get_pdb_header_line(dssp::pdb_record_type::COMPND) << ".\n"
<< dssp.get_pdb_header_line(dssp::pdb_record_type::SOURCE) << ".\n"

View File

@@ -1789,12 +1789,8 @@ std::string DSSP_impl::GetPDBHEADERLine()
std::ranges::copy(date, header + 50);
std::string id = mDB.name();
if (id.starts_with("pdb_"))
id.erase(0, 4);
if (id.length() < 4)
id.insert(id.end(), 4 - id.length(), ' ');
else if (id.length() > 8)
id.erase(id.begin() + 8, id.end());
if (id.length() > 18)
id.erase(id.begin() + 18, id.end());
std::ranges::copy(id, header + 62);