Skip to content

SMILES output wrong for strange CO species. #183

@rwest

Description

@rwest

I'm not sure what this represents (still not used to the lone pairs column) but I'm pretty sure there are only two atoms, a C and an O

1 *4 C 1 0 {2,S}
2    O 0 2 {1,S}

However, the SMILES (generated via RDKit) is [CH2]O

In [19]: print m.fromAdjacencyList('1  *4   C  1 0 {2,S} \n  2 O 0 2 {1,S}').toAdjacencyList()
1 *4 C 1 0 {2,S}
2    O 0 2 {1,S}


In [20]: print m.fromAdjacencyList('1  *4   C  1 0 {2,S} \n  2 O 0 2 {1,S}').getFormula()
CO

In [21]: print m.fromAdjacencyList('1  *4   C  1 0 {2,S} \n  2 O 0 2 {1,S}').toSMILES()
[CH2]O

Strangely, RDKit agrees that there are two atoms:

In [22]: r = m.fromAdjacencyList('1  *4   C  1 0 {2,S} \n  2 O 0 2 {1,S}').toRDKitMol()

In [23]: r
Out[23]: <rdkit.Chem.rdchem.Mol at 0x1048ee600>

In [24]: r.GetNumAtoms()
Out[24]: 2

so I'm not sure what's going on. Perhaps start with some more unit tests on SMILES output from strange things?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions