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

Improvements of TFD #630

Merged
merged 2 commits into from
Oct 1, 2015
Merged

Improvements of TFD #630

merged 2 commits into from
Oct 1, 2015

Conversation

sriniker
Copy link
Contributor

  • Use of Morgan invariants to pick atoms if multiple choices are available
  • In case of torsions with symmetric atoms, all possible torsional angles are stored in the TF, thus all possible deviations are determined and the smallest used to calculate the TFD value.

@greglandrum greglandrum added this to the 2015_09_1 milestone Oct 1, 2015
@@ -123,7 +139,8 @@ def _getIndexforTorsion(neighbors, inv):
elif _doMatch(inv, neighbors): # atom has all symmetric neighbors
return neighbors
elif _doNotMatch(inv, neighbors): # atom has all different neighbors
# simply use the first neighbor
# sort by atom inv and simply use the first neighbor
neighbors = _sortNeighbors(inv, neighbors)
Copy link
Member

Choose a reason for hiding this comment

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

You could make this a lot more efficient (and more readable) by taking advantage of the features of Python's sort function. Something like this should work:
neighbors = sorted(neighbors,key=lambda x:inv[x.GetIdx()])

greglandrum added a commit that referenced this pull request Oct 1, 2015
@greglandrum greglandrum merged commit f288bf8 into rdkit:master Oct 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants