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

nicify IsResidueComplete function

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