conversion of mol file to pdb
2
0
Entering edit mode
9.4 years ago
khushgee0 • 0

How to convert whole folder containing .mol file to .pdb format in one run?

R • 7.6k views
ADD COMMENT
1
Entering edit mode
9.4 years ago

You can try openbabel to convert.

http://openbabel.org/wiki/Tutorial:Basic_Usage

It offers a tons of file format conversions.

ADD COMMENT
0
Entering edit mode
9.4 years ago
wdiwdi ▴ 380

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)

ADD COMMENT

Login before adding your answer.

Traffic: 1554 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6