Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few fixes to improve MMFF/UFF robustness #274

Merged
merged 1 commit into from
Jun 3, 2014
Merged

A few fixes to improve MMFF/UFF robustness #274

merged 1 commit into from
Jun 3, 2014

Conversation

ptosco
Copy link
Contributor

@ptosco ptosco commented Jun 1, 2014

  • fixed a bug in Code/ForceField/MMFF/testMMFFForceField.cpp
  • fixed a bug in Code/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.cpp
    which caused misassignment of atom types in CYGUAN01 upon shuffling
    the order of atoms in the validation SDF files
  • changed hard-coded constants into const
  • added checks for acos and asin function parameters to be within
    a (-1, 1) range

- fixed a bug in Code/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.cpp
  which caused misassignment of atom types in CYGUAN01 upon shuffling
  the order of atoms in the validation SDF files
- added checks for acos and asin function parameters to be within
  a (-1, 1) range
@@ -40,6 +40,14 @@ namespace ForceFields {
inline bool isDoubleZero(const double x) {
return ((x < 1.0e-10) && (x > -1.0e-10));
}
inline void clipToOne(double &x) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is it better to set the values to (-1.0,1.0) or to raise some kind of value error.
I'm not sure how often this occurs or under what circumstances. If it's a round-off correction thing, then this makes sense, but if it's more to hammer things that are really out-of-range due to other problems back in range so that you don't get NaNs from other functions, this feels wrong to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Greg,

I don't think this should ever occur, given the way cosine and sine functions are computed. I think the only possibility are small round off issues (if ever) for angles close to 0, 180 degrees for cosine and 90,270 for sine. This was one of the concerns of the reviewer, I don't think it slows down the code significantly, so I decided to address it.

Cheers,
p.

Paolo Tosco, Ph.D.
Department of Drug Science and Technology
Via Pietro Giuria, 9 - 10125 Torino (Italy)
Tel: +39 011 670 7680 | Mob: +39 348 5537206
Fax: +39 011 670 7687 | E-mail: paolo.tosco@unito.it

http://open3dqsar.org | http://open3dalign.org

On 2 Jun 2014, at 07:08, Greg Landrum notifications@github.com wrote:

In Code/ForceField/MMFF/Params.h:

@@ -40,6 +40,14 @@ namespace ForceFields {
inline bool isDoubleZero(const double x) {
return ((x < 1.0e-10) && (x > -1.0e-10));
}

  • inline void clipToOne(double &x) {
    Question: is it better to set the values to (-1.0,1.0) or to raise some kind of value error.
    I'm not sure how often this occurs or under what circumstances. If it's a round-off correction thing, then this makes sense, but if it's more to hammer things that are really out-of-range due to other problems back in range so that you don't get NaNs from other functions, this feels wrong to me.


Reply to this email directly or view it on GitHub.

greglandrum added a commit that referenced this pull request Jun 3, 2014
A few fixes to improve MMFF/UFF robustness
@greglandrum greglandrum merged commit 77fad19 into rdkit:master Jun 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants