Commit 3b0f2706 by Maarten L. Hekkelman

check if data will fit in old format before doing calculation

parent b87ef206
......@@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.15)
# set the project name
project(mkdssp VERSION 4.3.1 LANGUAGES CXX)
project(mkdssp VERSION 4.3.1.1 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......
Version 4.3.1.1
- Check to see if data will fit in old format before starting calculations
Version 4.3.1
- Optimised for speed
- Fix in sheet numbering (mmCIF output)
......
......@@ -49,7 +49,7 @@ std::string ResidueToDSSPLine(const dssp::residue_info &info)
// auto& residue = info.residue();
auto &residue = info;
if (residue.asym_id().length() > 1)
if (residue.pdb_strand_id().length() > 1)
throw std::runtime_error("This file contains data that won't fit in the original DSSP format");
char code = residue.compound_letter();
......
......@@ -158,6 +158,20 @@ int d_main(int argc, const char *argv[])
fmt = "cif";
}
if (fmt == "dssp")
{
// See if the data will fit at all
auto &db = f.front();
for (const auto &[chain_id, seq_nr] : db["pdbx_poly_seq_scheme"].rows<std::string,int>("pdb_strand_id", "pdb_seq_num"))
{
if (chain_id.length() > 1 or seq_nr > 99999)
{
std::cerr << "The data in this file won't fit in the old DSSP format, please use the mmCIF format instead." << std::endl;
exit(2);
}
}
}
dssp dssp(f.front(), 1, pp_stretch, fmt == "dssp" or config.has("calculate-accessibility"));
if (not output.empty())
......
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