Actually, it is possible to get arbitrary orders, if you (ab)use the '.'
component ("zero order bond") directive and the numeric bonding ("ring
closure") directives:

>>> Chem.MolToSmiles( Chem.MolFromSmiles("O1.Cl2.C12" ) )
'OCCl'

Whether you want to do things that way is another question.

On Mon, Nov 18, 2019 at 10:24 AM David Cosgrove <[email protected]>
wrote:

> Hi Rafal,
> It is not always possible to preserve the atom ordering in the SMILES
> string because there is an implied bond between contiguous symbols in the
> SMILES. I think, for example, that the molecule with the SMILES OCCl
> couldn’t have the order in the molecule object O first, Cl second, C third,
> with bonds between 1 and 3 and 2 and 3 and get the SMILES in that order.
>
> I hope that made sense. Please ask again if not.
>
> Best regards,
> Dave
>
>
> On Mon, 18 Nov 2019 at 12:33, Rafal Roszak <[email protected]> wrote:
>
>> Hi all,
>>
>> Is there any way to preserve atom order from Mol object during
>> exporting to smiles? I tried MolToSmiles with rootedAtAtom=0 and
>> canonical=False options but it not always prevent oryginal order.
>> I know I can use _smilesAtomOutputOrder to map old indices to new one
>> in canonical smiles but maybe we have something more handy?
>>
>> Best,
>>
>> Rafał
>>
>>
>> _______________________________________________
>> Rdkit-discuss mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
> --
> David Cosgrove
> Freelance computational chemistry and chemoinformatics developer
> http://cozchemix.co.uk
>
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to