Describe the bug
plip.structure.preparation.py identifies as carboxylates substructures that it shouldn't
To Reproduce
By running plip -i 2rfy -yv we can see that plip caractherizes as negatively charged substructures that it shouldn't (R-O-C-O-R and R-O-C-O-H groups)
Expected behavior
These groups shouldn't be negatively charged and therefore no Saltbridges should be identified in this case
Screenshots

As for my tests the problem arrises in lines 770-772 of preparation.py, where the simple Carbon bound to two Oxygens check is not robust enough, i have fixed the issue locally with this code as replacement
if group == 'carboxylate':
carboxyl_smarts = pybel.Smarts("[CX3](=[OX1])[OX1-,OX2H1]")
mol = pybel.Molecule(atom.OBAtom.GetParent())
if any(match[0] == atom.idx for match in carboxyl_smarts.findall(mol)):
return True
else:
return False
I've seen that instead of SMARTS this code uses other rules to define functional groups so a different approach may be better suited for this codebase
Describe the bug
plip.structure.preparation.py identifies as carboxylates substructures that it shouldn't
To Reproduce
By running
plip -i 2rfy -yvwe can see that plip caractherizes as negatively charged substructures that it shouldn't (R-O-C-O-R and R-O-C-O-H groups)Expected behavior
These groups shouldn't be negatively charged and therefore no Saltbridges should be identified in this case
Screenshots

As for my tests the problem arrises in lines 770-772 of preparation.py, where the simple Carbon bound to two Oxygens check is not robust enough, i have fixed the issue locally with this code as replacement
I've seen that instead of SMARTS this code uses other rules to define functional groups so a different approach may be better suited for this codebase