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.


  • 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.


Download the jar file here

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].

  • 1
    $\begingroup$ Does this take into account biological assemblies, or simply convert e.g. MMTF to a PDB of the asymmetric unit? $\endgroup$ – 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."

  • 2
    $\begingroup$ but how to use it to convert between MMTF and something else? $\endgroup$ – marcin Jun 13 '17 at 21:56
  • 1
    $\begingroup$ There's also a C++ encoder/decoder available here: github.com/rcsb/mmtf-cpp $\endgroup$ – 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.

A large protein structure

  • 1
    $\begingroup$ 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). $\endgroup$ – marcin Nov 27 '19 at 13:50
  • $\begingroup$ @marcin Thanks for the heads up. Since this is probably a more common conversion, I've opened a new question. $\endgroup$ – James Nov 27 '19 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.