Many thanks for the timely clarification!

Indeed it works (attached fixed version) -- I will use this
workaround.  Can you somehow please advise when the bug is fixed (I am
not sure how this works with RDKit, do you have a bug report for it on
sourceforge I can check status on)?
(The quick solution is probably for Nik to add this call at the end of
his parsing routine, the proper way is to fix the parsing/molecule
building code).  If there is no bug, and the molecule is incorrect
maybe we should get an error message (in the great rdkit philosophy
that it doesn't try to guess what it going on).

ps. This mol.Debug() is really powerful.

Jean-Paul Ebejer
Early Stage Researcher




On 24 August 2011 13:31, Greg Landrum <[email protected]> wrote:
> Chem.AssignStereochemistry(mol,cleanIt=True,force=True)
#!/usr/bin/env python

from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import AllChem

mol2block = """@<TRIPOS>MOLECULE
MolPort-003-188-453_019_0.279709
50 52 1 0 0 
SMALL
USER_CHARGES


@<TRIPOS>ATOM
  1 S       -8.6120    -7.0040    -0.3820 S.o2  1 <1>   1.4470 
  2 C       -7.0270    -6.7750     0.3880 C.ar  1 <1>  -0.0090 
  3 N       -8.6130    -8.6280    -0.7820 N.am  1 <1>  -0.8490 
  4 C        0.5110     0.3500     0.0410 C.3   1 <1>   1.1630 
  5 C       -6.0660    -6.0670    -0.3340 C.ar  1 <1>  -0.1500 
  6 H       -6.2940    -5.7080    -1.3270 H     1 <1>   0.1500 
  7 C       -3.8050    -5.0550    -0.5920 C.2   1 <1>   0.6340 
  8 C       -4.7990    -5.8200     0.2300 C.ar  1 <1>   0.0860 
  9 O       -8.6420    -6.2660    -1.6320 O.2   1 <1>  -0.6500 
 10 O       -9.6530    -6.7780     0.6050 O.2   1 <1>  -0.6500 
 11 C       -0.6720    -0.5690    -0.0670 C.ar  1 <1>  -0.1430 
 12 C       -6.7350    -7.2390     1.6700 C.ar  1 <1>  -0.1430 
 13 O       -2.6400    -4.9070     0.1040 O.3   1 <1>  -0.4300 
 14 C       -0.5740    -1.9010    -0.2360 C.ar  1 <1>  -0.1500 
 15 H        0.4010    -2.3590    -0.3080 H     1 <1>   0.1500 
 16 O       -4.0240    -4.6320    -1.7180 O.2   1 <1>  -0.5700 
 17 C       -4.5170    -6.2890     1.5150 C.ar  1 <1>  -0.1500 
 18 H       -3.5480    -6.1030     1.9550 H     1 <1>   0.1500 
 19 C       -5.4820    -6.9970     2.2330 C.ar  1 <1>  -0.1500 
 20 H       -5.2580    -7.3580     3.2260 H     1 <1>   0.1500 
 21 F        0.5260     1.0200     1.2260 F     1 <1>  -0.3400 
 22 F        0.5110     1.2930    -0.9410 F     1 <1>  -0.3400 
 23 F        1.7040    -0.3010    -0.0500 F     1 <1>  -0.3400 
 24 O       -7.9970   -11.4510    -1.1640 O.3   1 <1>  -0.5600 
 25 C       -7.6930    -9.0950    -1.8440 C.3   1 <1>   0.1960 
 26 H1      -6.6700    -9.0540    -1.4690 H     1 <1>   0.0800 
 27 H2      -7.7890    -8.4380    -2.7090 H     1 <1>   0.0800 
 28 C       -8.6850    -9.6120     0.3440 C.3   1 <1>   0.1960 
 29 H1      -9.4870    -9.3200     1.0220 H     1 <1>   0.0800 
 30 H2      -7.7360    -9.6090     0.8810 H     1 <1>   0.0800 
 31 C       -1.6000    -4.1920    -0.5520 C.3   1 <1>   0.2630 
 32 H1      -1.6500    -4.3920    -1.6220 H     1 <1>   0.0800 
 33 H2      -0.6380    -4.5270    -0.1640 H     1 <1>   0.0800 
 34 C       -1.7360    -2.7110    -0.3210 C.ar  1 <1>  -0.1430 
 35 C       -2.0060     0.1090     0.0270 C.ar  1 <1>  -0.1500 
 36 H       -2.0990     1.1760     0.1660 H     1 <1>   0.1500 
 37 C       -8.0090   -10.5360    -2.2750 C.3   1 <1>   0.1200 
 38 H1      -8.9970   -10.5560    -2.7360 H     1 <1>   0.0800 
 39 H2      -7.2630   -10.8570    -3.0020 H     1 <1>   0.0800 
 40 C       -8.9620   -11.0340    -0.1800 C.3   1 <1>   0.1200 
 41 H1      -8.9300   -11.7290     0.6590 H     1 <1>   0.0800 
 42 H2      -9.9540   -11.0540    -0.6310 H     1 <1>   0.0800 
 43 C       -3.1060    -0.7160    -0.0750 C.ar  1 <1>  -0.1500 
 44 H       -4.0910    -0.2770    -0.0170 H     1 <1>   0.1500 
 45 C       -7.7440    -8.0100     2.5250 C.3   1 <1>  -0.0970 
 46 H1      -8.6740    -8.1290     1.9700 H     1 <1>   0.0800 
 47 H2      -7.9380    -7.4580     3.4450 H     1 <1>   0.0800 
 48 H3      -7.3380    -8.9920     2.7690 H     1 <1>   0.0800 
 49 C       -2.9950    -2.0970    -0.2500 C.ar  1 <1>  -0.1500 
 50 H       -3.8880    -2.6990    -0.3320 H     1 <1>   0.1500 
@<TRIPOS>BOND
  1   1   2  1   
  2   1   3  am  
  3   1   9  2   
  4   1  10  2   
  5   2   5  ar  
  6   2  12  ar  
  7   3  25  1   
  8   3  28  1   
  9   4  11  1   
 10   4  21  1   
 11   4  22  1   
 12   4  23  1   
 13   5   6  1   
 14   5   8  ar  
 15   7   8  1   
 16   7  13  1   
 17   7  16  2   
 18   8  17  ar  
 19  11  14  ar  
 20  11  35  ar  
 21  12  19  ar  
 22  12  45  1   
 23  13  31  1   
 24  14  15  1   
 25  14  34  ar  
 26  17  18  1   
 27  17  19  ar  
 28  19  20  1   
 29  24  37  1   
 30  24  40  1   
 31  25  26  1   
 32  25  27  1   
 33  25  37  1   
 34  28  29  1   
 35  28  30  1   
 36  28  40  1   
 37  31  32  1   
 38  31  33  1   
 39  31  34  1   
 40  34  49  ar  
 41  35  36  1   
 42  35  43  ar  
 43  37  38  1   
 44  37  39  1   
 45  40  41  1   
 46  40  42  1   
 47  43  44  1   
 48  43  49  ar  
 49  45  46  1   
 50  45  47  1   
 51  45  48  1   
 52  49  50  1   
"""

mol=AllChem.MolFromMol2Block(mol2block)
mol.Debug()
# fix
Chem.AssignStereochemistry(mol,cleanIt=True,force=True)
mol.Debug()
AllChem.Compute2DCoords(mol)
Draw.MolToFile(mol, "broken_mol.png", (400,400))

<<attachment: fixed_mol.png>>

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to