# Converter between PDB or mmCIF and MMTF

I'd like to test MMTF, a new format for storing biomolecular structures which is promoted by RCSB as a more compact alternative to mmCIF and PDB.

From MMTF FAQ:

• How do I convert a PDBx/mmCIF file to an MMTF file?

The BioJava library contains methods to read and write PDBx/mmCIF files and MMTF files.

Can I do such a conversion, ideally from command line, but without writing my own Java program?

I wrote a very quick and dirty script to handle conversion between file types using BioJava.

https://github.com/eedlund/Utils/tree/master/BioUtils

To run: java -jar BioUtils.jar $FILE$TYPE

where \$FILE is a PDB or mmCIF file you'd like to convert and \$TYPE is the format of the output file [PDB, CIF, MMTF].

• Does this take into account biological assemblies, or simply convert e.g. MMTF to a PDB of the asymmetric unit? – Harry Aug 3 '17 at 16:04

You looked at this https://github.com/rcsb/mmtf-python

"The python implementation of the MMTF API, decoder and encoder."

• but how to use it to convert between MMTF and something else? – marcin Jun 13 '17 at 21:56
• There's also a C++ encoder/decoder available here: github.com/rcsb/mmtf-cpp – Jose Duarte Apr 28 '18 at 23:37

This python script uses Biopython and does the job well even on large structures. For example:

python cif2pdb.py 4ckh-assembly-1.cif 4ckh-assembly-1.pdb

This generates the structure below.

• The question was about converting to/from MMTF. For PDB <-> mmCIF there are too many tools to list them all. For example, I'm maintaining gemmi which should be at least an order of magnitude faster than BioPython and it also converts more fields (but I'm obviously biased). – marcin Nov 27 '19 at 13:50
• @marcin Thanks for the heads up. Since this is probably a more common conversion, I've opened a new question. – James Nov 27 '19 at 16:15

You can do this with BioStructures.jl in Julia. All the 6 transformations between PDB/mmCIF/MMTF are possible.

For example, PDB to MMTF:

using BioStructures

using BioStructures