Write SDF - Atoms coordinates are empty

28 views
Skip to first unread message

ric...@gmail.com

unread,
Apr 2, 2019, 6:51:32 AM4/2/19
to indigo-general
Hello,

Using Indigo to write SDF give me mol file/SDF with empty coords.

I have to use molconvert (molconvert sdf sdf-no-coords.sdf -o sdf-with-coords.sdf)

Here is the python script:

...

    csv_path = '...'

    indigo = Indigo()

    writer = indigo.writeFile('my.sdf')

    with open(csv_path, 'rb') as csvfile:
       
        reader = csv.reader(csvfile, delimiter=',')
        reader.next()

        for row in reader:

            mol = indigo.loadMolecule(row[1].strip())

            mol.setProperty('reference', row[0].strip())
            mol.setProperty('name', row[3].strip().decode('utf8'))
            mol.setProperty('cas', row[4].strip())

            writer.sdfAppend(mol)

    writer.close()


And here is the result :

  -INDIGO-04011917312D

  8  8  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 Br  0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 S   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  2  6  2  0  0  0  0
  2  3  1  0  0  0  0
  3  4  2  0  0  0  0
  4  5  1  0  0  0  0
  5  6  1  0  0  0  0
  4  7  1  0  0  0  0
  7  8  3  0  0  0  0
M  END


Many thanks in advance for answer or comments.

Eric

site...@greenpharma.com

unread,
May 20, 2019, 6:08:43 AM5/20/19
to indigo-general
Hello,

No response for this question although i encounter this problem on a regularly basis.

I have to use the Chemaxon's molconvert tool to get a SDF with coordinates.

Is there anything to do ?
Reply all
Reply to author
Forward
0 new messages