How are you generating the depiction (p.s. you're losing stereochemistry
somewhere)?

Speculating - but if you generate a SMILES the output order may (normally
will) be different from the input. When generating a SMILES you can access
the atom output order but it's easier just to label the atoms (e.g. with
atom maps...)

For storage reasons you should use isomeric non-canonical SmiFlavour... but
ignore that take a look at this example:
SmilesParser smipar = new SmilesParser(SilentChemObjectBuilder.getInstance
());

SmilesGenerator smigen = new SmilesGenerator(SmiFlavor.Canonical |
SmiFlavor.AtomAtomMap);
for (String smi : new String[]{"CCO", "C(C)O", "OCC"}) {
    IAtomContainer mol = smipar.parseSmiles(smi);
    for (int i = 0; i < mol.getAtomCount(); i++)
        mol.getAtom(i).setProperty(CDKConstants.ATOM_ATOM_MAPPING, (i + 1));
    System.out.println(smigen.create(mol));
}


[OH:3][CH2:2][CH3:1]
[OH:3][CH2:1][CH3:2]
[OH:1][CH2:2][CH3:3]

All the oxygens are now atom 1... but the map index tells us what the
original storage index was.

John

On 26 April 2017 at 13:49, Nikolas Glaser <glase...@gmail.com> wrote:

> Hello everyone,
>
> I have a part in my code where I want to get all connected atoms of one
> given.
> Now the result of AtomNumbers of the connected atoms does not make sense
> in comparison with the atom numbers of my printed substance.
>
> You can see the code, result and substance in the attached files.
>
> Is there a difference between the AtomNumber in the program to the Number
> in the printed image? In the program there exists Atomnumber 0 but not in
> image so do I have to add 1 to every Atomnumber to compare correctly?
>
> If there is the difference the result does not make sense either, cause
> the „connected atoms“ of AtomNumber 39 should be in the image number 40 and
> 37 also if I make -1 to every atom number the only connected atoms should
> be only two not three.
>
>
> Thanks for your reply.
>
> Cheers
> Niko
>
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Cdk-user mailing list
> Cdk-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cdk-user
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to