Bio.PDB.SCADIO module

SCADIO: write OpenSCAD program to create protein structure 3D model.

3D printing a protein structure is a non-trivial exercise due to the overall complexity and the general requirement for supporting overhang regions while printing. This software is a path to generating a model for printing (e.g. an STL file), and does not address the issues around converting the model to a physical product. OpenSCAD <http://www.openscad.org/> can create a printable model from the script this software produces. MeshMixer <http://www.meshmixer.com/>, various slicer software, and the 3D printer technology available to you provide options for addressing the problems around physically rendering the model.

I suggest generating your initial model using the OpenSCAD script provided here, then modifying that script according to your needs. Changing the atomScale and bondRadius values can simplify the model by removing gaps and the corresponding need for supports, or you may wish to modify the hedronDispatch() routine to select residues or chain sections for printing separately and subsequently joining with rotatable bonds. During this development phase you will likely have your version include only the data matrices generated here, by using the includeCode-False option to write_SCAD(). An example project with modifications of the script generated here is <https://www.thingiverse.com/thing:3957471>.

Bio.PDB.SCADIO.write_SCAD(entity, file, scale=None, pdbid=None, backboneOnly=False, includeCode=True, maxPeptideBond=None, handle='protein')

Write hedron assembly to file as OpenSCAD matrices.

This routine calls both internal_to_atom_coordinates() and atom_to_internal_coordinates() due to requirements for scaling, explicit bonds around rings, and setting the coordinate space of the output model.

Output data format is primarily:

  • matrix for each hedron:

    len1, angle2, len3, atom covalent bond class, flags to indicate atom/bond represented in previous hedron (OpenSCAD very slow with redundant overlapping elements), flags for bond features

  • transform matrices to assemble each hedron into residue dihedra sets

  • transform matrices for each residue to position in chain

OpenSCAD software is included in this Python file to process these matrices into a model suitable for a 3D printing project.

Parameters
  • entity – Biopython PDB structure entity structure data to export

  • file – Bipoython as_handle filename or open file pointer file to write data to

  • scale – float units (usually mm) per angstrom for STL output, written in output

  • pdbid – str PDB idcode, written in output. Defaults to ‘0PDB’ if not supplied and no ‘idcode’ set in entity

  • backboneOnly – bool default False Do not output side chain data past Cbeta if True

  • includeCode – bool default True Include OpenSCAD software (inline below) so output file can be loaded into OpenSCAD; if False, output data matrices only

  • maxPeptideBond – Optional[float] default None Override the cut-off in IC_Chain class (default 1.4) for detecting chain breaks. If your target has chain breaks, pass a large number here to create a very long ‘bond’ spanning the break.

  • handle – str, default ‘protein’ name for top level of generated OpenSCAD matrix structure