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

SMILES extension and depiction of multipart reactions #986

Merged
merged 18 commits into from Aug 1, 2023
Merged

Conversation

johnmay
Copy link
Member

@johnmay johnmay commented Jul 26, 2023

Emma in cdk/depict#33 suggest supporting multistep SMILES as
{A}>{B}>{C}>{D}>{E} is short for {A}>{B}>{C} and {C}>{D}>{E}. Importantly this single string allows us to depict them in a single image in CDK depict.

We already have a reaction set model in CDK so it's simply a matter of a few minor modifications to the SMILES parsing.
The depiction was a little trickier and required cleanup to how we currently handle reactions. I'm still not convinced this is that clean, but there are a lot of pieces to position in the reaction so it's always going to be a bit finiky, particularly as I wanted the ability to optimise layout for linear sequences.

Example:

ClC1=NC=2N(C(=C1)N(CC3=CC=CC=C3)CC4=CC=CC=C4)N=CC2C(OCC)=O>C1(=CC(=CC(=N1)C)N)N2C[C@H](CCC2)O.O1CCOCC1.CC1(C2=C(C(=CC=C2)P(C3=CC=CC=C3)C4=CC=CC=C4)OC5=C(C=CC=C15)P(C6=CC=CC=C6)C7=CC=CC=C7)C.C=1C=CC(=CC1)\C=C\C(=O)\C=C\C2=CC=CC=C2.C=1C=CC(=CC1)\C=C\C(=O)\C=C\C2=CC=CC=C2.C=1C=CC(=CC1)\C=C\C(=O)\C=C\C2=CC=CC=C2.[Pd].[Pd].[Cs]OC(=O)O[Cs]>C1(=CC(=CC(=N1)C)NC2=NC=3N(C(=C2)N(CC4=CC=CC=C4)CC5=CC=CC=C5)N=CC3C(OCC)=O)N6C[C@H](CCC6)O>CO.C1CCOC1.O.O[Li]>C1(=CC(=CC(=N1)C)NC2=NC=3N(C(=C2)N(CC4=CC=CC=C4)CC5=CC=CC=C5)N=CC3C(O)=O)N6C[C@H](CCC6)O>CN(C)C(=[N+](C)C)ON1C2=C(C=CC=N2)N=N1.F[P-](F)(F)(F)(F)F.[NH4+].[Cl-].CN(C)C=O.CCN(C(C)C)C(C)C>C1(=CC(=CC(=N1)C)NC2=NC=3N(C(=C2)N(CC4=CC=CC=C4)CC5=CC=CC=C5)N=CC3C(N)=O)N6C[C@H](CCC6)O>>C1(=CC(=CC(=N1)C)NC2=NC=3N(C(=C2)N)N=CC3C(N)=O)N4C[C@H](CCC4)O |f:4.5.6.7.8,16.17,18.19|  US20190241576A1

Result:

US20190241576A1

Not handled reaction/step labels yet but molecule titles/labels work well (although there is no way to get this in via SMILES:

image

TODO:

  • John to check, new pieces are packaged-private
  • SVG, px units single reaction needs tweaking

@egonw
Copy link
Member

egonw commented Jul 27, 2023

@johnmay, WIP?

@johnmay
Copy link
Member Author

johnmay commented Jul 27, 2023

Yep but will try and get bits fixed up today.

@johnmay
Copy link
Member Author

johnmay commented Jul 27, 2023

Will wait for SonarCloud but should be done now.

@sonarcloud
Copy link

sonarcloud bot commented Jul 27, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 42 Code Smells

48.2% 48.2% Coverage
7.9% 7.9% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@johnmay
Copy link
Member Author

johnmay commented Jul 28, 2023

Good to go, the code smells are marginal and most already present

@egonw egonw self-assigned this Jul 28, 2023
@egonw
Copy link
Member

egonw commented Aug 1, 2023

Looks good.

@egonw egonw merged commit b24906d into main Aug 1, 2023
5 of 6 checks passed
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