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

Patch/canon aam smiles #465

Merged
merged 4 commits into from
Jun 30, 2018
Merged

Patch/canon aam smiles #465

merged 4 commits into from
Jun 30, 2018

Conversation

johnmay
Copy link
Member

@johnmay johnmay commented Jun 27, 2018

Resolves #274.

Atom Map Index now affects canonical ordering (if and only if output SMILES has atom maps). In this first example the two inputs (left of reaction) are the same except for their atom map numbering. They get different atom-maps.

[*:2]C(CC[*:3])[*:1]>>[*:1]C([*:2])CC[*:3]
[*:2]C(CC[*:1])[*:2]>>[*:1]CCC([*:2])[*:2]

The more useful SmiFlavor.AtomAtomMapRenumber flag takes the same input, canonicalises without atom-atom maps and then renumbers them on output:

[*:2]C(CC[*:3])[*:1]>>[*:1]CCC([*:2])[*:3]
[*:1]CCC([*:2])[*:3]>>[*:1]CCC([*:2])[*:3]

If desired the caller can track the renumbering by parsing the output inspecting the output ordering array.

… By default it produces the exact same ordering as the current bit packing used in Canon. However it is much simpler to add optional invariants (e.g. AtomAtomMaps).
Copy link
Member

@egonw egonw left a comment

Choose a reason for hiding this comment

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

Did you really mean to say "initial initial"?

@@ -120,7 +123,7 @@ private Canon(int[][] g, long[] partition, boolean[] hydrogens, boolean symOnly)
/**
* Compute the canonical labels for the provided structure. The labelling
* does not consider isomer information or stereochemistry. This method
* allows provision of a custom array of initial invariants.
* allows provision of a custom array of initial initial.
Copy link
Member

Choose a reason for hiding this comment

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

-> "initial seeds"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Stupid IDE likes to change all occurrences by default. Should be initial invariants.

@johnmay
Copy link
Member Author

johnmay commented Jun 30, 2018

fixed

@egonw egonw merged commit c376648 into master Jun 30, 2018
@johnmay johnmay deleted the patch/canon-aam-smiles branch July 27, 2019 10:05
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.

2 participants