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

nicify IsResidueComplete function

parent 73e34f23
No related branches found
No related tags found
No related merge requests found
...@@ -5,23 +5,20 @@ namespace ost { namespace conop { ...@@ -5,23 +5,20 @@ namespace ost { namespace conop {
bool CompoundLibBase::IsResidueComplete(const ost::mol::ResidueHandle& res, bool check_hydrogens, Compound::Dialect dialect) const{ bool CompoundLibBase::IsResidueComplete(const ost::mol::ResidueHandle& res, bool check_hydrogens, Compound::Dialect dialect) const{
CompoundPtr compound = this->FindCompound(res.GetName(), dialect); CompoundPtr compound = this->FindCompound(res.GetName(), dialect);
AtomSpecList a_spec = compound->GetAtomSpecs(); AtomSpecList a_spec = compound->GetAtomSpecs();
for(AtomSpecList::const_iterator it=a_spec.begin(); it!=a_spec.end();++it){ for(AtomSpecList::const_iterator it=a_spec.begin(); it!=a_spec.end();++it){
if(it->element=="H" || it->element=="D"){
if(check_hydrogens){ if (it->is_leaving) continue;
if(!res.FindAtom(it->name).IsValid()){
return false; if((it->element=="H" || it->element=="D") && (!check_hydrogens)) continue;
}
} if(res.FindAtom(it->name).IsValid() || res.FindAtom(it->alt_name)) continue;
}
else{ return false;
if(!res.FindAtom(it->name).IsValid()){
return false;
}
}
} }
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment