9
$\begingroup$

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?

$\endgroup$

5 Answers 5

2
$\begingroup$

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

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

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

$\endgroup$
1
  • 1
    $\begingroup$ Does this take into account biological assemblies, or simply convert e.g. MMTF to a PDB of the asymmetric unit? $\endgroup$
    – Harry
    Commented Aug 3, 2017 at 16:04
2
$\begingroup$

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

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

$\endgroup$
2
  • 2
    $\begingroup$ but how to use it to convert between MMTF and something else? $\endgroup$
    – marcin
    Commented Jun 13, 2017 at 21:56
  • 1
    $\begingroup$ There's also a C++ encoder/decoder available here: github.com/rcsb/mmtf-cpp $\endgroup$ Commented Apr 28, 2018 at 23:37
2
$\begingroup$

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
struc = read(in_filepath, PDB)
writemmtf(out_filepath, struc)

mmCIF to MMTF:

using BioStructures
struc = read(in_filepath, MMCIF)
writemmtf(out_filepath, struc)
$\endgroup$
2
$\begingroup$

You can use PyMol to change the PDB to mmtf or other format. First open the PDB file and then choose file->export molecule-> choose which format you want to save as

$\endgroup$
1
$\begingroup$

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

$\endgroup$
2
  • 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
    Commented Nov 27, 2019 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
    Commented Nov 27, 2019 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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