# 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? 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? Jun 13 '17 at 21:56
• There's also a C++ encoder/decoder available here: github.com/rcsb/mmtf-cpp Apr 28 '18 at 23:37

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
writemmtf(out_filepath, struc)


mmCIF to MMTF:

using BioStructures

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