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

Classifying geometry based on RMSD #213

Merged
merged 13 commits into from
May 7, 2024
Merged

Classifying geometry based on RMSD #213

merged 13 commits into from
May 7, 2024

Conversation

aarongarrison
Copy link
Contributor

Added a new geometry classification function that calculates the RMSDs between the first coordination shell of mononuclear complexes and ideal geometries with the same coordination number, and classifies based on that. Should improve classifications compared to the angle deviation approach previously implemented.

Copy link
Member

@ralf-meyer ralf-meyer left a comment

Choose a reason for hiding this comment

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

Not quite sure why, but get_geometry_type_distance() is also limited to a maximum coordination number of 6. I tracked it down to the use of get_first_shell() to determine the coordination number. Is get_first_shell() somehow limited to a maximum coordination number of 6?

distances.append(distance)
positions[idx, :] = np.array(atom.coords()) - np.array(metal_atom.coords()) #shift so the metal is at (0, 0, 0)

def permutations(list):
Copy link
Member

Choose a reason for hiding this comment

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

testing this function, it seems that it could be replaced by itertools.permutations()

Copy link
Member

Choose a reason for hiding this comment

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

Which I have done in my recent changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe that get_first_shell is limited to a maximum coordination number of 6: it uses the function obtain_truncation_metal to get the first shell (before applying any edge/sandwich logic), which determines neighbors using the getBondedAtomsSmart function. This function, as shown in commit 79272c1, assumes a maximum coordination number of 6. If the default behavior of getBondedAtomsSmart is set to not assume a maximum of 6-coordinated structures, some of the tests will fail for geometry checks, so I do not want to change that behavior. However, changing the oct argument to False will allow for get_geometry_type_distance to classify geometries with coordination numbers higher than 6, which I have tested. I can introduce a workaround variable to allow for different behavior (such as in commit 46abd16), but I do not want to add that argument to more functions than needed (since readability on those extra arguments would be difficult to interpret). I would argue that we should change the test cases to add oct=True to getBondedAtomsSmart (since that function should not assume a maximum coordination number), but I am not sure if that would also require adding arguments to many functions to ensure that the test cases work as intended.

Copy link
Member

Choose a reason for hiding this comment

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

I just spent some time trying to understand why these 4 test cases:

  • test_geocheck_oct[broken_ligands]
  • test_geocheck_oct[H_transfer]
  • test_geocheck_oct[rotational_group]
  • test_geocheck_oct[iodine_sulfur]

fail when we set oct=False as default in getBondedAtomsSmart and got nowhere... My recommendation for now is just to merge what you have and address this issue during the hackathon on higher coordination complexes.

@aarongarrison aarongarrison merged commit ba0ef66 into master May 7, 2024
8 checks passed
@aarongarrison aarongarrison deleted the geometry_changes branch May 7, 2024 17:54
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

3 participants