Answers.Body: <p>You looked at this <a href="https://github.com/rcsb/mmtf-python" rel="nofollow noreferrer">https://github.com/rcsb/mmtf-python</a> </p>
  
  <p>"The python implementation of the MMTF API, decoder and encoder."</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-13T21:56:16.187Z
Answers.Text: but how to use it to convert between MMTF and something else?
Answers.UserDisplayName: marcin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-28T23:37:29.870Z
Answers.Text: There's also a C++ encoder/decoder available here: https://github.com/rcsb/mmtf-cpp
Answers.UserDisplayName: Jose Duarte
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-13T18:55:36.833Z
Answers.LastActivityDate: 2017-06-13T18:55:36.833Z
Answers.UserDisplayName: Marcin Magnus
Answers.Body: <p>You can use PyMol to change the PDB to mmtf or other format. First open the PDB file and then choose file-&gt;export molecule-&gt; choose which format you want to save as</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-24T05:17:41.950Z
Answers.LastActivityDate: 2021-10-24T05:17:41.950Z
Answers.UserDisplayName: NingNing Chen
Answers.Body: <p>You can do this with <a href="https://github.com/BioJulia/BioStructures.jl" rel="nofollow noreferrer">BioStructures.jl</a> in Julia. All the 6 transformations between PDB/mmCIF/MMTF are possible.</p>
  
  <p>For example, PDB to MMTF:</p>
  
  <pre><code>using BioStructures
  struc = read(in_filepath, PDB)
  writemmtf(out_filepath, struc)
  </code></pre>
  
  <p>mmCIF to MMTF:</p>
  
  <pre><code>using BioStructures
  struc = read(in_filepath, MMCIF)
  writemmtf(out_filepath, struc)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-31T11:31:48.683Z
Answers.LastActivityDate: 2020-03-31T11:31:48.683Z
Answers.UserDisplayName: jgreener
Answers.Body: <p>This <a href="https://gist.github.com/sbliven/b7cc2c5305aa3652a75a580ae7c6ce33" rel="nofollow noreferrer">python script</a> uses <a href="https://biopython.org/" rel="nofollow noreferrer">Biopython</a> and does the job well even on large structures. For example:</p>
  
  <p><code>python cif2pdb.py 4ckh-assembly-1.cif 4ckh-assembly-1.pdb</code> </p>
  
  <p>This generates the structure below.</p>
  
  <p><a href="https://i.sstatic.net/wWiJG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wWiJG.png" alt="A large protein structure"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-27T13:50:52.690Z
Answers.Text: 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](https://github.com/project-gemmi/gemmi) which should be at least an order of magnitude [faster](https://github.com/project-gemmi/mmcif-benchmark) than BioPython and it also converts more fields (but I'm obviously biased).
Answers.UserDisplayName: marcin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-27T16:15:16.257Z
Answers.Text: @marcin Thanks for the heads up. Since this is probably a more common conversion, I've opened a new [question](https://bioinformatics.stackexchange.com/questions/10896/how-to-quickly-and-robustly-convert-between-mmcif-and-pdb).
Answers.UserDisplayName: James
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-27T12:46:55.427Z
Answers.LastActivityDate: 2019-11-27T12:46:55.427Z
Answers.UserDisplayName: James
Answers.Body: <p>I wrote a very quick and dirty script to handle conversion between file types using BioJava.</p>
  
  <p><a href="https://github.com/eedlund/Utils/tree/master/BioUtils" rel="nofollow noreferrer">https://github.com/eedlund/Utils/tree/master/BioUtils</a></p>
  
  <p>Download the jar file <a href="https://github.com/eedlund/Utils/raw/master/BioUtils/BioUtils.jar" rel="nofollow noreferrer">here</a></p>
  
  <p>To run: <code>java -jar BioUtils.jar $FILE $TYPE</code></p>
  
  <p>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].</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-03T16:04:14.843Z
Answers.Text: Does this take into account biological assemblies, or simply convert e.g. MMTF to a PDB of the asymmetric unit?
Answers.UserDisplayName: Harry
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-14T22:42:30.370Z
Answers.LastActivityDate: 2018-04-29T06:03:10.153Z
Answers.LastEditDate: 2018-04-29T06:03:10.153Z
Answers.UserDisplayName: Rosalind Was Robbed
Body: <p>I'd like to test <a href="http://mmtf.rcsb.org" rel="noreferrer">MMTF</a>, a new format for storing biomolecular structures which is promoted by RCSB as a more compact alternative to mmCIF and PDB.</p>
  
  <p>From <a href="http://mmtf.rcsb.org/faq.html" rel="noreferrer">MMTF FAQ</a>:</p>
  
  <blockquote>
    <ul>
    <li><p>How do I convert a PDBx/mmCIF file to an MMTF file?</p>
    
    <p>The BioJava library contains methods to read and write PDBx/mmCIF files and MMTF files.</p></li>
    </ul>
  </blockquote>
  
  <p>Can I do such a conversion, ideally from command line, but without writing my own Java program?</p>
  
Tags: <file-formats><pdb><3d-structure>
Title: Converter between PDB or mmCIF and MMTF
ThreadText: # Converter between PDB or mmCIF and MMTF
  
  (Asked by: username_0 on 2017-06-13)
  
  I'd like to test [MMTF](http://mmtf.rcsb.org), a new format for storing biomolecular structures which is promoted by RCSB as a more compact alternative to mmCIF and PDB.
  
  From [MMTF FAQ](http://mmtf.rcsb.org/faq.html):
  
  > * 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?
  
  **Tags:** file-formats, pdb, 3d-structure
  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_6 on 2017-06-14. Score: 2 | Accepted answer
  
  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](https://github.com/eedlund/Utils/raw/master/BioUtils/BioUtils.jar)
  
  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].
  
  > **Comments:**
  > **username_7**: Does this take into account biological assemblies, or simply convert e.g. MMTF to a PDB of the asymmetric unit?  
  
  ---
  
  ### Answer by username_1 on 2017-06-13. Score: 2
  
  You looked at this <https://github.com/rcsb/mmtf-python>
  
  "The python implementation of the MMTF API, decoder and encoder."
  
  > **Comments:**
  > **username_0**: but how to use it to convert between MMTF and something else?  
  > **username_2**: There's also a C++ encoder/decoder available here: https://github.com/rcsb/mmtf-cpp  
  
  ---
  
  ### Answer by username_3 on 2021-10-24. Score: 2
  
  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
  
  
  ---
  
  ### Answer by username_4 on 2020-03-31. Score: 2
  
  You can do this with [BioStructures.jl](https://github.com/BioJulia/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)
  
  ```
  
  
  ---
  
  ### Answer by username_5 on 2019-11-27. Score: 1
  
  This [python script](https://gist.github.com/sbliven/b7cc2c5305aa3652a75a580ae7c6ce33) uses [Biopython](https://biopython.org/) 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](https://i.sstatic.net/wWiJG.png)](https://i.sstatic.net/wWiJG.png)
  
  > **Comments:**
  > **username_0**: 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](https://github.com/project-gemmi/gemmi) which should be at least an order of magnitude [faster](https://github.com/project-gemmi/mmcif-benchmark) than BioPython and it also converts more fields (but I'm obviously biased).  
  > **username_5**: @username_0 Thanks for the heads up. Since this is probably a more common conversion, I've opened a new [question](https://bioinformatics.stackexchange.com/questions/10896/how-to-quickly-and-robustly-convert-between-mmcif-and-pdb).  
  
  ---
  
  