Discussion:
[PyMOL] Convert multiple .mae to .pdb files
Kar Weng Ng
2017-02-20 06:58:35 UTC
Permalink
Dear Sir/Madam,

I am final year School of Pharmacy student, currently working on a homology
modelling project. I am relatively new to using PyMOL. I would like to
convert .mae ligand structures that were produced by glide_dock into .pdb
files. I understand that I could use the: load ligand_1.mae, then go to
File > Save molecule command. However I have thousands of ligand files to
convert. May I know if there's a way or script that could do this in a
faster way?

Thank you for your time.

Best Regards,
Ng Kar Weng
School of Pharmacy
Taylor's University Lakeside Campus, Malaysia
Thomas Holder
2017-02-21 13:12:13 UTC
Permalink
Hi Kar Weng,

This is possible with a Python script. Save the following to a file (e.g. "mae2pdb.py") and run it with PyMOL ("File > Run Script..." or use the "run" command). This will convert all .mae files from the current directory to .pdb files.

from pymol import cmd
import glob
for filename in glob.glob('*.mae'):
cmd.load(filename)
cmd.save(filename[:-4] + '.pdb')
cmd.delete('*')

Hope that helps.

Cheers,
Thomas
Post by Kar Weng Ng
Dear Sir/Madam,
I am final year School of Pharmacy student, currently working on a homology modelling project. I am relatively new to using PyMOL. I would like to convert .mae ligand structures that were produced by glide_dock into .pdb files. I understand that I could use the: load ligand_1.mae, then go to File > Save molecule command. However I have thousands of ligand files to convert. May I know if there's a way or script that could do this in a faster way?
Thank you for your time.
Best Regards,
Ng Kar Weng
School of Pharmacy
Taylor's University Lakeside Campus, Malaysia
--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.
Loading...