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

No coords atropisomers - fix smiles output of atrop wedges after reordering #7418

Merged
merged 17 commits into from May 7, 2024

Conversation

tadhurst-cdd
Copy link
Contributor

Reference Issue

Needed for several things, including ("the Canonicalization of Enhanced stereo for](#7041")

What does this implement/fix? Explain your changes.

Allows atropisomers to be represented with wedge bonds even when there are no coordinates. The assumption is that the lowest numbered "other atom" are each end are considered to be on the same side of the atropisomer bond.

Any other comments?

Copy link
Member

@greglandrum greglandrum left a comment

Choose a reason for hiding this comment

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

A couple of small suggestions

"ZM374979_atrop2.sdf"};

for (auto file : files) {
std::cout << "File: " << file << std::endl;
Copy link
Member

Choose a reason for hiding this comment

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

Please don't include output like this in the tests, it makes the running the tests really noisy and doesn't add anything. If there's an informative message that you want to output when a test fails, you can do that with catch2's INFO() macro.

I know that I approved several older PRs that also have a large amount of output, but I plan to do a PR to clean that up in the not-too-distant future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

Copy link
Member

Choose a reason for hiding this comment

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

You fixed that one example, but there are a number of other outputs to std::cout in that file and in the other tests added for this PR

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 think I got them all - probably one I didn't put in.

Atropisomers::AtropAtomAndBondVec atomAndBondVecs[2];
if (!Atropisomers::getAtropisomerAtomsAndBonds(
bondNbr, atomAndBondVecs, mol)) {
throw RDKit::SmilesParseException(
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be a SmilesParseException since we aren't parsing SMILES at this point.
This should either be a ValueError if it's something which could happen but shouldn't or handled using the RDKit's CHECK_INVARIANT() if this only happens in the case of an RDKit bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to value error

Copy link
Member

@greglandrum greglandrum left a comment

Choose a reason for hiding this comment

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

LGTM

@greglandrum greglandrum merged commit a2b149a into rdkit:master May 7, 2024
12 checks passed
@greglandrum
Copy link
Member

Thanks @tadhurst-cdd !

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