Commit 446438bf by Maarten L. Hekkelman

Fixing pdb2cif, and sequence checking

parent 4e012cbd
......@@ -6440,9 +6440,9 @@ file read(std::istream &is)
// Well, not quite, Unfortunately... People insisted that
// having only ATOM records also makes up a valid PDB file...
// 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);
else
{
......
......@@ -248,13 +248,12 @@ bool is_valid_pdbx_file(const file &file, std::string_view dictionary, std::erro
for (auto comp_id : comp_ids)
{
std::string letter;
if (compound_factory::kBaseMap.contains(comp_id))
letter = compound_factory::kBaseMap.at(comp_id);
else if (compound_factory::kAAMap.contains(comp_id))
letter = compound_factory::kAAMap.at(comp_id);
else
if (can)
{
if (can)
if (compound_factory::kBaseMap.contains(comp_id))
letter = compound_factory::kBaseMap.at(comp_id);
else
{
auto c = cf.create(comp_id);
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
else
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
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