Open jsjyhzy opened 1 year ago
Thanks for the report.
I think, if I read the grammar specified in section 2.2 of http://opensmiles.org/opensmiles.html carefully, that C(CC)1OC1
is not valid SMILES.
Looking at:
branched_atom ::= atom ringbond branch branch ::= '(' chain ')' | '(' bond chain ')' | '(' dot chain ')'
a ringbond must always directly follow an atom specification and cannot appear after a chain.
Ideally I think pysmiles should raise an error is such a case, but I don't know when I'll have time to implement that. I'll leave the issue open until then at least.
Dear developers
In some cases, the marker of ring closure bonds will locate after the marker of branching, for example
C(CC)1OC1
andC1(CC)OC1
. OpenBabel can accept them and yield the same structure, which can be validated by command lineobabel -ismi -:'C1(CC)OC1' -osmi
andobabel -ismi -:'C(CC)1OC1' -osmi
, the converted SMILES expressions areC1(CC)OC1
.However pysmiles acting differently as following:
the number last expression is somehow been misinterpreted. would the pysmiles be permissive to this condition?