[Rdkit-discuss] Saving mol file

2018-09-25 Thread Colin Bournez
Hey everyone, I have a question concerning the Chem.MolToMolFile() function. When I open this file containing a N+ (here is the line corresponding in the mol file) : 11.37003.4360 -11.8300 N 0 3 0 0 0 0 0 0 0 0 0 0 And I just save it back withotu any modification, the line

Re: [Rdkit-discuss] Saving mol file

2018-09-25 Thread Greg Landrum
Hi Colin, The RDkit outputs charge information to mol blocks using the CHG line: In [3]: m = Chem.MolFromSmiles('C[NH3+]') In [4]: print(Chem.MolToMolBlock(m)) RDKit 2D 2 1 0 0 0 0 0 0 0 0999 V2000 0.0.0. C 0 0 0 0 0 0 0 0 0 0 0 0

Re: [Rdkit-discuss] Saving mol file

2018-09-25 Thread Colin Bournez
Well yes I have this line indeed, I did not put the whole file for clarity purpose. The thing is tools as MOE, Pymol read it without problem but RDock for example can't read it properly and returns a neutral N which is not the case. And if I open it with pymol and save it back in mol format, th

Re: [Rdkit-discuss] Saving mol file

2018-09-26 Thread GALLY Jose Manuel
Dear Colin, this is a specific problem I stumbled upon some time ago.[1] I also mentioned it to the rDock mailing list.[2] Maybe there is a better work-around, but in the meantime I wrote the attached function. It takes as input the Mol Block, which in my case are in a dataframe. Hope that help