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 output option to disable the RDKit dative bond syntax #7372

Open
johnmay opened this issue Apr 19, 2024 · 1 comment · May be fixed by #7384
Open

SMILES output option to disable the RDKit dative bond syntax #7372

johnmay opened this issue Apr 19, 2024 · 1 comment · May be fixed by #7384

Comments

@johnmay
Copy link
Contributor

johnmay commented Apr 19, 2024

The recent addition of SANITIZE_CLEANUP_ORGANOMETALLICS (#6357) means many -> and <- now appear in SMILES output from RDKit and causes issues in NextMove Software tools (specifically NameRxn). We can turn this off during sanitization but I think the cleaner API is to make this a SMILES output option. Ideally this would be OFF by default such that the SMILES generated by RDKit can be safely consumed by other tools without modification. As it is now you will not be able paste in output in to ChemDraw or Marvin or indeed (m)any other tools.

>>> Chem.MolToSmiles(Chem.MolFromSmiles('[NH3][Pt][NH3]'))
'N->[Pt]<-N'

To emphasize my "point of view" what does RDKit make of the similar behaviour in Indigo?

Indigo indigo = new Indigo();
IndigoObject mol = indigo.loadMolecule("NCCO |Sg:n:1,2:n:ht|");
indigo.setOption("smiles-saving-format", "chemaxon");
System.out.println(mol.smiles() + " chemaxon");
indigo.setOption("smiles-saving-format", "daylight");
System.out.println(mol.smiles() + " daylight");
NCCO |Sg:n:1,2:n:ht| chemaxon
NC{-}C{+n}O daylight

Does RDKit accept what Indigo calls "daylight" SMILES?

Other comments:

  • CXSMILES has an option for dative bonds which is more widely supported
  • I'm not keen on the syntax of using the '>' for anything other than reactions.
  • If SanitizeMol can automatically add them in easily, what is the benefit in storing them?
@greglandrum
Copy link
Member

I think adding support for a flag to disable this extension is completely reasonable and will get something in.

@greglandrum greglandrum linked a pull request Apr 23, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants