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

Fix #532 - smilesAtomOutputOrder incorrect #535

Merged
merged 2 commits into from
Jul 14, 2015

Conversation

baoilleach
Copy link
Contributor

Handle disconnected components correctly when generating the _smilesAtomOutputOrder property. This requires:
(a) the mapping from the fragment molecules back to the original molecule
(b) the fragment maps to be sorted at the same time as the fragment smiles (if canonical)

Handle disconnected components correctly when generating the _smilesAtomOutputOrder property. This requires:
(a) the mapping from the fragment molecules back to the original molecule
(b) the fragment maps to be sorted at the same time as the fragment smiles (if canonical)
This makes things a little less clear (which is why I left it out originally) but it's more efficient. Now, rather than updating vfragsmi with the sorted fragment smiles, the final result smiles is generated directly.
@baoilleach
Copy link
Contributor Author

I'm not sure it's worth doing, but in the case of non-canonical SMILES, you could avoid a vector copy if you generated the flattenedAtomOrdering directly from within the main loop over the fragment smiles (rather than populating allAtomOrdering).

@greglandrum
Copy link
Member

Thanks for this Noel.
I added a couple of small tests and discovered that there are some problems with the SMILES generated. I created a branch with your changes and my tests here: https://github.com/rdkit/rdkit/tree/Issue532

@NadineSchneider : would you mind taking a look at this and seeing if you can figure out what the problem is?

@baoilleach
Copy link
Contributor Author

I meant to ask you about writing tests. In your test code, did you mean to set atom 0 to oxygen? "m->getAtomWithIdx(0)->setAtomicNum(8);"

@greglandrum
Copy link
Member

oh my, that is a stupid copy and paste bug.

@greglandrum greglandrum merged commit 93b3802 into rdkit:master Jul 14, 2015
@greglandrum
Copy link
Member

Ok, the fix is on master, along with a couple of simple tests.
Thanks for the PR Noel!

@baoilleach baoilleach deleted the Issue532 branch July 14, 2015 14:08
@greglandrum greglandrum modified the milestone: 2015_09_1 Oct 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants