Hello all,

I've been trying to output my 3D mol object that has Gasteiger charges to
mol2 file format. How would I go about that? I've only found it for mol and
pdb.

Here is the code I'be been using if that helps:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from rdkit import Chem
from rdkit.Chem import AllChem

smile = 'Cc1ccccc1'

uncharged_mol_1D = Chem.MolFromSmiles(smile)

uncharged_mol_3D = Chem.AddHs(uncharged_mol_1D)
AllChem.EmbedMolecule(uncharged_mol_3D)
AllChem.UFFOptimizeMolecule(uncharged_mol_3D)

charged_mol_3D = uncharged_mol_3D
AllChem.ComputeGasteigerCharges(charged_mol_3D)

fout = Chem.SDWriter('./charged_test.mol')
fout.write(charged_mol_3D)
fout.close()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thank you!
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to