Commit 446438bf by Maarten L. Hekkelman

Fixing pdb2cif, and sequence checking

parent 4e012cbd
...@@ -6440,9 +6440,9 @@ file read(std::istream &is) ...@@ -6440,9 +6440,9 @@ file read(std::istream &is)
// Well, not quite, Unfortunately... People insisted that // Well, not quite, Unfortunately... People insisted that
// having only ATOM records also makes up a valid PDB file... // having only ATOM records also makes up a valid PDB file...
// Since mmCIF files cannot validly start with a letter character // Since mmCIF files cannot validly start with a letter character
// the test has changed into the following: // apart from the letter 'd', the test has changed into the following:
if (std::isalpha(ch)) if (std::isalpha(ch) and std::toupper(ch) != 'D')
read_pdb_file(is, result); read_pdb_file(is, result);
else else
{ {
......
...@@ -248,13 +248,12 @@ bool is_valid_pdbx_file(const file &file, std::string_view dictionary, std::erro ...@@ -248,13 +248,12 @@ bool is_valid_pdbx_file(const file &file, std::string_view dictionary, std::erro
for (auto comp_id : comp_ids) for (auto comp_id : comp_ids)
{ {
std::string letter; std::string letter;
if (compound_factory::kBaseMap.contains(comp_id))
letter = compound_factory::kBaseMap.at(comp_id); if (can)
else if (compound_factory::kAAMap.contains(comp_id))
letter = compound_factory::kAAMap.at(comp_id);
else
{ {
if (can) if (compound_factory::kBaseMap.contains(comp_id))
letter = compound_factory::kBaseMap.at(comp_id);
else
{ {
auto c = cf.create(comp_id); auto c = cf.create(comp_id);
if (c and c->one_letter_code()) if (c and c->one_letter_code())
...@@ -262,6 +261,13 @@ bool is_valid_pdbx_file(const file &file, std::string_view dictionary, std::erro ...@@ -262,6 +261,13 @@ bool is_valid_pdbx_file(const file &file, std::string_view dictionary, std::erro
else else
letter = "X"; letter = "X";
} }
}
else
{
if (compound_factory::kAAMap.contains(comp_id))
letter = compound_factory::kAAMap.at(comp_id);
else if (comp_id.length() == 1 and compound_factory::kBaseMap.contains(comp_id))
letter = compound_factory::kBaseMap.at(comp_id);
else else
letter = '(' + comp_id + ')'; letter = '(' + comp_id + ')';
} }
......
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