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

SKETCH-829 #54

Merged
merged 7 commits into from
Mar 2, 2020
Merged

SKETCH-829 #54

merged 7 commits into from
Mar 2, 2020

Conversation

ZontaNicola
Copy link
Collaborator

canBeChiral(), among other things, makes sure that we set the number of implicit Hs correctly on the stereocenter. If it fails we should not add wedges and dashes

@ZontaNicola ZontaNicola requested a review from d-b-w February 17, 2020 17:21
@ZontaNicola
Copy link
Collaborator Author

@d-b-w let's discuss appropriate tests for this and CRDGEN-250

@d-b-w d-b-w requested a review from ricrogz February 17, 2020 20:21
@@ -389,7 +389,7 @@ void sketcherMinimizerAtom::writeStereoChemistry() // sets stereochemistry for
return;
}
size_t n = neighbors.size();
if (n != 3 && n != 4) {
if (!canBeChiral() || (n != 3 && n != 4)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wait - does this mean that the carbon atoms in the JIRA case aren't going to be marked as chiral at all? That seems wrong, too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

well they are, and it makes sense cause they have no Hs. We have another case to track that problem so in the end they won't, but as far as this case is concerned I think this is the appropriate behaviour for coordgen

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I'm not sure I understand. The C atoms may not have any explicit H atoms, but implicit ones should also be considered, shouldn't they?

Copy link
Collaborator

Choose a reason for hiding this comment

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

So, I guess when I see this I have a couple of questions:

  1. What is (n != 3 && n != 4) even doing? Isn't that logic already performed in CanBeChiral()?
  2. Should there be some earlier check or assertion that we're not setting stereochemistry on something that can't even be chiral in the first place?
  3. What about trigonal nitrogens? Do you allow them to be have parity?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ricrogz the problem is that we were marking the atoms to have 0 implicit Hs. So when I have no Hs I mean no implicit and no explicit Hs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@d-b-w 1) you are right
2) this looks like the right place to check to me. It's at the beginning of where we write stereochemistry to the atom
3) yes

Copy link
Collaborator

@d-b-w d-b-w left a comment

Choose a reason for hiding this comment

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

It sounds like you're curious about how to add tests here. I am too!

Would it be possible to add a mae file that represents this? I guess you don't parse chirality/parity information out of mae files, so maybe it would be hard to generate a test case for this.

Would it be possible to add a test in the core suite that exercises the type of problem in the case? It's really a problem in the communication between coordgen and the core suite, right?

@@ -389,7 +389,7 @@ void sketcherMinimizerAtom::writeStereoChemistry() // sets stereochemistry for
return;
}
size_t n = neighbors.size();
if (n != 3 && n != 4) {
if (!canBeChiral() || (n != 3 && n != 4)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

So, I guess when I see this I have a couple of questions:

  1. What is (n != 3 && n != 4) even doing? Isn't that logic already performed in CanBeChiral()?
  2. Should there be some earlier check or assertion that we're not setting stereochemistry on something that can't even be chiral in the first place?
  3. What about trigonal nitrogens? Do you allow them to be have parity?

@d-b-w
Copy link
Collaborator

d-b-w commented Feb 27, 2020

looks like we've misplaced valgrind. @ricrogz - do you remember what we did last time that happened?

@@ -389,7 +389,7 @@ void sketcherMinimizerAtom::writeStereoChemistry() // sets stereochemistry for
return;
}
size_t n = neighbors.size();
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not valgrind, @d-b-w: the build failed (and everyting after it) because n is now unused.

address build failure
@d-b-w d-b-w merged commit d98f16a into schrodinger:master Mar 2, 2020
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.

3 participants