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

Problem : Drawing multiple Smiles separates by "." / drawing complexe smile using "." ionic bond #184

Open
fjuniat opened this issue Mar 4, 2024 · 1 comment

Comments

@fjuniat
Copy link

fjuniat commented Mar 4, 2024

Hello, I would like to draw the 2,2,2-Trifluoroethylamine hydrochloride chemical with the following SMILE : "C(C(F)(F)F)N.Cl" that has a ionic bond.

https://pubchem.ncbi.nlm.nih.gov/compound/9772#section=IUPAC-Name

However, when I tried to draw it, I obtain a result with some hydrogens missing :

Capture d'écran 2024-03-04 161452

The "N" should have two hydrogens. And the Cl one.

In the file Edge.js, we have theses following bounds :
image

I found that the "." is missing and during the "setBondType" the return weight will be "undefined". One "edge" in _init of Graph.js will have a weight undefined and during the "addEdge", we will have a result of number += undefined. The result will be "NaN" and the added hyrdogens by comparing the weights will not be added.

Do you have a solution to draw molecule that has ionic bound please ?

Thanks

@xavierholt
Copy link

xavierholt commented May 8, 2024

You could specify the hydrogens explicitly - this SMILES string seems to give what you're looking for:

C(C(F)(F)F)[NH2].[ClH]
Screen Shot 2024-05-07 at 8 56 18 PM

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

No branches or pull requests

2 participants