How to convert whole folder containing .mol file to .pdb format in one run?
How to convert whole folder containing .mol file to .pdb format in one run?
You can try openbabel to convert.
http://openbabel.org/wiki/Tutorial:Basic_Usage
It offers a tons of file format conversions.
This is easily done with a small script by means of the Cactvs Cheminformatics Toolkit (visit www.xemistry.com/academic for free academic packages). This gives you more opportunities to control what exactly is happening in the translation than running a turnkey application.
Minimal Tcl script:
foreach f [glob *.mol] {
molfile loop $f eh {
molfile write [file rootname $f].pdb $eh
}
}
Minimal Python script:
import glob,os
for f in glob.glob('*.mol'):
for e in Molfile(f):
Molfile.Write(os.path.splitext(f)[0]+'.pdb',e)
(these scripts allow for multi-record SDF with a misleading suffix in addition to single-record simple Molfiles)
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.