Skip to content
Snippets Groups Projects
Commit a7553694 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

mmcif writer: clarify error message for insertion codes

Only relevant for resnum based alignments, i.e. enabled mmcif_conform flag
parent 86eb4b1d
No related branches found
No related tags found
No related merge requests found
...@@ -712,6 +712,7 @@ namespace { ...@@ -712,6 +712,7 @@ namespace {
std::vector<int> resnums; std::vector<int> resnums;
for(auto res: res_list) { for(auto res: res_list) {
int num = res.GetNumber().GetNum(); int num = res.GetNumber().GetNum();
char ins_code = res.GetNumber().GetInsCode();
if(num < 1) { if(num < 1) {
std::stringstream ss; std::stringstream ss;
ss << "Try to construct mmCIF entity from residues using resnum "; ss << "Try to construct mmCIF entity from residues using resnum ";
...@@ -721,6 +722,15 @@ namespace { ...@@ -721,6 +722,15 @@ namespace {
ss << "but be aware of the consequences..."; ss << "but be aware of the consequences...";
throw ost::io::IOException(ss.str()); throw ost::io::IOException(ss.str());
} }
if(ins_code != '\0') {
std::stringstream ss;
ss << "Try to construct mmCIF entity from residues using resnum ";
ss << "based alignments. Insertion codes are not allowed ";
ss << "in this case. Got: " << ins_code << " in residue " << res;
ss << ". You may set mmcif_conform flag to False to write something ";
ss << "but be aware of the consequences...";
throw ost::io::IOException(ss.str());
}
res_mon_ids.push_back(res.GetName()); res_mon_ids.push_back(res.GetName());
resnums.push_back(num); resnums.push_back(num);
max_resnum = std::max(max_resnum, num); max_resnum = std::max(max_resnum, num);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment