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