From 26556eefd540aee071a65f4eed04d53b5c5fdb85 Mon Sep 17 00:00:00 2001 From: Tobias Schmidt <tobias.schmidt@unibas.ch> Date: Fri, 22 Jul 2011 14:34:36 +0200 Subject: [PATCH] chemdict parser marks all residues with formula H2O as waters (necessary for charmm dialect) --- modules/io/src/mol/chemdict_parser.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/io/src/mol/chemdict_parser.cc b/modules/io/src/mol/chemdict_parser.cc index e493b7934..5934b8341 100644 --- a/modules/io/src/mol/chemdict_parser.cc +++ b/modules/io/src/mol/chemdict_parser.cc @@ -96,6 +96,10 @@ void ChemdictParser::OnDataItem(const StarDataItem& item) } else if (item.GetName()==StringRef("formula", 7)) { compound_->SetFormula(item.GetValue().str()); + if (compound_->GetFormula()=="H2 O") { + compound_->SetChemClass(mol::ChemClass(mol::ChemClass::WATER)); + compound_->SetOneLetterCode('.'); + } } else if (item.GetName()==StringRef("one_letter_code", 15)) { if (item.GetValue().length()==1) { compound_->SetOneLetterCode(item.GetValue()[0]); @@ -164,4 +168,4 @@ void ChemdictParser::InitTypeMap() tm_["WATER"]=mol::ChemClass(mol::ChemClass::WATER); } -}} \ No newline at end of file +}} -- GitLab