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

Feature/depict - Part 2 (Reactions + Layouting) #160

Merged
merged 17 commits into from Sep 26, 2015
Merged

Conversation

johnmay
Copy link
Member

@johnmay johnmay commented Sep 25, 2015

Part 2 - mainly tweaks to depiction classes (now immutable), reaction layout, and some long overdue patches to the SDG (allow it to handle fragments).

Rendering code hard to test as usual but added some for the layout updates.

Reaction Layout

Testing the removal of parts, here's the original...

CNC1=C(OCCC#N)C=CC=C1.CCCC[Sn](CCCC)(CCCC)N=[N+]=[N-].CC[Al]CC)CC>CC1=CC=CC=C1.CCOC(C)=O.O>CNC1=C(OCCC2=NN=NN2)C=CC=C1

No Agents...

Products Only...

Reactants Only...

Empty Reaction - (failed reaction)...

Agents only... it doesn't depict the arrow, actually I think that makes sense!

Atom Maps and Highlight

In the generator we turn on withAtomMapNumbers() or withAtomMapHighlight() to show the atom-mapping between reactants and products (supplied in the input SMILES).

CC1(C)CCCC(C)(C)N1.C([Li])CCC.[s:16]1[cH:20][cH:19][cH:18][c:17]1-[c:21]1[c:29]2[c:25]([n:26][s:27][n:28]2)[c:24](-[c:30]2[s:31][cH:32][cH:33][cH:34]2)[cH:23][cH:22]1.[CH3:35][Sn:36](Cl)([CH3:38])[CH3:37]>C1OCCC1.C(OCC)C.O>[CH3:35][Sn:36]([CH3:38])([CH3:37])[c:32]1[s:31][c:30](-[c:24]2[c:25]3[c:29]([n:28][s:27][n:26]3)[c:21](-[c:17]3[s:16][c:20]([Sn:36]([CH3:38])([CH3:37])[CH3:35])[cH:19][cH:18]3)[cH:22][cH:23]2)[cH:34][cH:33]1

Cl[c:2]1[c:11]2[c:6]([c:7]3[cH:15][cH:14][cH:13][cH:12][c:8]3[cH:9][cH:10]2)[n:5][cH:4][n:3]1.O1CCCC1.[Br-].[CH2:22]([Mg+])[CH:23]([CH3:25])[CH3:24].Cl>CN1CCCC1=O>[CH2:22]([c:2]1[c:11]2[c:6]([c:7]3[cH:15][cH:14][cH:13][cH:12][c:8]3[cH:9][cH:10]2)[n:5][cH:4][n:3]1)[CH:23]([CH3:25])[CH3:24]

Salt Layout

By default, the SDG now lays out fragments of a molecule in a grid. If possible it tries to (re)bond ionic fragments before doing so with temporary bonds. Here's some results:

Sodium Benzoate

image

AlCl3
[Al+3].[Cl-].[Cl-].[Cl-]

image

K2CO3
[K+].[O-]C=O[O-][K+]

CHEMBL11933 - avoids the nitro

…ing methods for PDF/PS output that need to convert to PS Points (1/72 inch).
…ffset may be negative and we need to account for that.
…et the coordinates after invoking depict(IReaction).
…hreads. This is useful since we need to set the scale parameter before rendering, therefore even if the caller is good and doesn't change options during a run of depictions we have to! Note this is tricky since each parameter is an mutable instance we need to deep copy for every modification.
@egonw
Copy link
Member

egonw commented Sep 26, 2015

The images are not working for me...

* Kenneth L. Kelly and Deanne B. Judd.
* "Color: Universal Language and Dictionary of Names",
* National Bureau of Standards,
* Spec. Publ. 440, Dec. 1976, 189 pages.
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to put this in cheminf.bibx too and user {@cdk.cite ...}

egonw added a commit that referenced this pull request Sep 26, 2015
A few minor comments which can be applied later.
@egonw egonw merged commit ad921ba into master Sep 26, 2015
@johnmay
Copy link
Member Author

johnmay commented Sep 26, 2015

Doh images aren't shareable from google. Odd because the last ones were

@johnmay
Copy link
Member Author

johnmay commented Sep 26, 2015

Hopefully visible now but I think its google moving links.. probably to prevent hot linking.

Here's the album link - https://goo.gl/photos/J99araookYzmTsa6A

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