Skip to content
Snippets Groups Projects
Commit 9c096d85 authored by Marco Biasini's avatar Marco Biasini
Browse files

treat Deuterium like hydrogens

parent 1d5c2441
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ void RuleBasedBuilder::CheckResidueCompleteness(const mol::ResidueHandle& rh)
mol::AtomHandleList atoms=rh.GetAtomList();
mol::AtomHandleList::iterator i=atoms.begin();
for (; j!=last_compound_->GetAtomSpecs().end() && i!=atoms.end(); ++j) {
if ((*j).is_leaving || (*j).element=="H")
if ((*j).is_leaving || (*j).element=="H" || (*j).element=="D")
continue;
if ((*j).ordinal!=static_cast<int>((*i).Impl()->GetState())) {
this->OnMissingAtom(rh, (*j).name);
......@@ -72,7 +72,8 @@ bool RuleBasedBuilder::HasUnknownAtoms(mol::ResidueHandle res)
for (mol::AtomHandleList::iterator
i=atoms.begin(), e=atoms.end(); i!=e; ++i) {
if ((*i).Impl()->GetState()==std::numeric_limits<unsigned int>::max()) {
if ((*i).GetElement()=="H" && this->GetStrictHydrogenMode()==false) {
if (((*i).GetElement()=="H" || (*i).GetElement()=="D") &&
this->GetStrictHydrogenMode()==false) {
continue;
}
return true;
......@@ -210,14 +211,15 @@ void RuleBasedBuilder::ConnectAtomsOfResidue(mol::ResidueHandle rh)
mol::AtomHandle a2=this->LocateAtom(atoms, bond.atom_two);
if (a1.IsValid() && a2.IsValid() && this->IsBondFeasible(a1, a2)) {
if (this->GetStrictHydrogenMode() &&
(a1.GetElement()=="H" || a2.GetElement()=="H")) {
(a1.GetElement()=="H" || a2.GetElement()=="D")) {
continue;
}
e.Connect(a1, a2, bond.order);
}
}
for (mol::AtomHandleList::iterator i=atoms.begin(), e=atoms.end(); i!=e; ++i) {
if ((*i).GetElement()=="H" && (*i).GetBondCount()==0) {
if (((*i).GetElement()=="H" || (*i).GetElement()=="D") &&
(*i).GetBondCount()==0) {
this->DistanceBasedConnect(*i);
}
}
......@@ -293,7 +295,7 @@ bool RuleBasedBuilder::IsResidueComplete(const mol::ResidueHandle& residue)
mol::AtomHandleList::iterator i=atoms.begin();
for (AtomSpecList::const_iterator j=last_compound_->GetAtomSpecs().begin(),
e=last_compound_->GetAtomSpecs().end(); j!=e; ++j) {
if ((*j).is_leaving || (*j).element=="H") {
if ((*j).is_leaving || (*j).element=="H" || (*j).element=="D") {
continue;
}
if (!(residue.FindAtom(j->name) || residue.FindAtom(j->alt_name))) {
......
......@@ -50,6 +50,7 @@ void AtomProp::Init()
defaults_["CO"]=AtomProp(2.0000, 58.9330);
defaults_["CR"]=AtomProp(2.0000, 51.9960);
defaults_["CS"]=AtomProp(2.0000, 132.9050);
defaults_["D"]=AtomProp(1.0900, 2.0141);
defaults_["CU"]=AtomProp(1.4000, 63.5460);
defaults_["DB"]=AtomProp(2.0000, 262.0000);
defaults_["DS"]=AtomProp(2.0000, 271.0000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment