Eduardo’s Guide for 3D Printing Proteins
Eduardo da Veiga Beltrame – email@example.com - www.munfred.com
The content of this tutorial is now part of a video article openly available at: www.jove.com/video/55427/3d-printing-of-biomolecular-models-for-research-and-pedagogy
UCSF Chimera is a free and open source molecular visualizer. In this tutorial we’ll show how Chimera can be used to generate 3D printable molecular models for FDM/FFF desktop 3D printers. You can download Chimera at https://www.cgl.ucsf.edu/chimera/.
First, you need the coordinate file of the molecule you want to print. The files containing the atomic coordinates for a molecule are called .pdb files (for protein data bank). These structures are determined using an array of techniques such as x-ray crystallography and nuclear magnetic resonance, and when they are published they are also deposited into databases and become freely available for download. The biggest such database is the Protein Data Bank, and if you are interested it's worth a visit: www.rcsb.org
If you’re looking for cool structures and some explanations, the molecule of the month PDB articles at http://pdb101.rcsb.org/ are a good way to start browsing. They are written by the awesome David Goodsell
If you can’t find your molecule on the PDB it's probably because nobody knows it's structure yet. If what you want is some small molecule, you can try searching for the structure online, or you can draw it using Avogadro, a free and open source molecule editor you can get at www.avogadro.cc.
Once you have your PDB file, you can render it on a molecular visualizer. I’m using Chimera here, but the workflow is virtually the same if you use something else like PyMol or VMD.
When trying to visualize molecules, it is important to keep in mind that there is no "right" image for them, we can represent atoms in a variety of manners that best present the features we want to convey. There are 4 different representations that are commonly used:
Guide for Chimera representations: https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/representation.html
For FDM 3D printing, surface representation is the easiest one to print successfully. If you want to print ribbons or lines, you must make sure that your model features are not too small, otherwise it will not print properly or will be too fragile. We’ll discuss several tips to address that, and once the ribbons have been thickened and extra bonds added, ribbon models will print well at an enlargement between 200% to 300%.
Once you have the representation that you want, you need to export an STL model by going to File > Export Scene, selecting STL as the file type, and then naming and saving your model.
In addition to the STL, it’s a good idea to save your Chimera Session often by going to File > Save Session As. This is especially important because chimera has no undo button, and sometimes it takes several steps to revert an undesirable one click change.
A nice thing about Chimera is that it generates models at a consistent 10^7 magnification. This means that if you print at 100% scale, your model amplification is 10 million times. If you print at 300%, it’s 30 million times.
Finally, sometimes you want to use the Chimera command line to type commands instead of clicking around (often because there is no button for doing what you want). To access the Chimera command line, go to Favorites > Command Line, and it will appear at the bottom of the screen.
When making selections, you can name and save your selection by going to the menu Select > Name Selection, and then choosing a name for your selection. This way, you can always access that selection using the command sel name, where name is the name of your selection.
Chimera standard STL rendering resolution is fine for most representations, but when printing surface models in a larger scale than the standard output, it's a good idea to bump up the amount of vertices to obtain a smoother model. The standard surface vertex density is 4, and 10 is a good amount if you want to enlarge your model by several times.
The easiest way to render the surface representation in high quality is to go to Actions > Surface > Show, or go to Presets > Interactive 3 (hydrophobicity surface). Then hit Presets > Publication (any of the 4 options work, the silhouettes and shadows don't affect STL quality).
To do the same thing using command lines, just type surf to render the model surface. You can adjust the surface vertex density using the command setattr s density x (set attribute), where x is the density. For example, to set the density to 10, type
setattr s density 10.0
Below you can see the differences between a surface density of 4 and 10.
Chimera calculates a molecules surface by considering that each atom has a certain radius, and then seeing the depth that is accessible to a sphere of arbitrary radius. The default radius of that sphere is 1.5 angstrom, but you can change it using the command setattr s probeRadius x, where x is the new radius you want. So for example
setattr s probeRadius 0.5
would set the probe radius to 0.5 angstrom. Below you can see examples of a surface rendered with the probe radius at 0.5 and 0.1. If you make the probe radius very small, you end up with the same shape as the spheres representation.
Another way to generate a surface (if the above fails) is use the surf command via command line. Include the model # to generate a surface for only that model. The grid argument is required, it specifies the resolution of the exported STL. A grid value of 0.5 gives a result that is not too large but can still be scaled without showing the individual faces in the print.
surf #0 grid 0.5
Sometimes your model is composed of various chains, and you just want to render the surface of one of them. One way you can do that is to use the split command, which separates the chains and generates a surface for each one.
For generating surfaces on arbitrary selections, use the command:
split atoms selected
The other way is to delete the atoms of the sections you don’t want to render. If you merely hide them, your surface will appear broken, and not good for rendering a printable model. Below is an example of a broken surface.
Sometimes the surface calculation for large molecules will fail (sometimes even changing computers affects the success or failure). This is a known bug, and one of the workarounds is to use the split command to separate your models into several smaller surfaces. Other workarounds are described here: http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/surfprobs.html
Change the ribbons appearance and make them as fat and thick as possible, by going to Tools > Depiction > Ribbon Style editor and changing the thicknesses. You want to make them as thick as possible, between 0.7 and 1. Keep an eye to make the sizes of the different elements match so that it looks good. You can also save your new ribbon style as a preset so you can readily reuse it. Check the official documentation for more info: https://www.cgl.ucsf.edu/chimera/current/docs/ContributedSoftware/ribbonstyle/ribbonstyle.html
Below you can see the original ribbon and the fat one.
The other trick that I use to make the ribbons more stable is to show the hydrogen bonds. this makes beta sheets and alpha helixes super stable, and if the ribbon breaks, the whole model is less likely to fall apart. To do this, go to Tools > Structure Analysis > Find H bond, and you can make it show the H bonds.
Then make them thick by selecting the whole model, going to Actions > Inspect. Select pseudobonds in the inspect option, and for bond style select stick.
Finally, you can make your bond thicker by altering the radius. The default is 0.2, and I’d suggest bumping it up to something about 0.5, so that they print fine and make the model sturdier, but are not too big. The end result will look as below.
One picture shows the default ribbon thickness, the other shows a thickened ribbon, necessary for printing.
It is important to keep in mind that H bonds will be shown for all atoms that are visible. For example, if you make all atoms visible, including crystallographic water molecules, there will be a lot of spurious H bonds. As shown below, just hiding the water molecules will do away with most bonds that might be undesirable.
It is also important to note that if you render atoms as wires, they will not appear in your STL model, but a 3D H bond between them will appear. This can be useful if you’d like to show bonds between surfaces for example, but you don’t want to render the individual atoms. When rendering models with hydrogen bonds, it’s especially important to run the generate STL through Netfabb, because the STL mesh outputted by Chimera is not solid.
A quick way to achieve the result described here from the command line is using the following commands:
hbond color white
setattr p drawMode 1
setattr g stickScale 2.5
Chimera offers a quick way to automatically add struts to a model using the strut command, and to also fatten the ribbon at the same time using the option fattenRibbon
For example, to create blue struts of radius 0.8 Å in the carbon alpha of every 30 residues no further than 7 Å apart, and also fatten the ribbon, type:
struts @ca length 7 loop 30 color blue rad 0.8 fattenRibbon true
Below you can view a model before and after this command. For more information on how to use the strut command,check the official documentation at: https://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/struts.html
You can add a fake bond between two atoms by adding a distance measure, and making it a cylinder. Go to Tools > Structure Analysis > Distances, and you can create a distance between any two atoms you have selected (you need to have only two atoms selected).
In the figure below I have an oxygen and nitrogen atom selected. Note that Chimera also highlights the residue to which the selected atom belongs.
Then make them thick by selecting the whole model, going to Actions > Inspect. Select pseudobonds in the inspect option, and for bond style select stick.
Finally, you can make your bond thicker by altering the radius. The default is 0.2, and I’d suggest bumping it up to something between 0.5 and 1, if you want this fake bond to hold the model together. This is how your Inspect Selection menu will look like:
Such fake bonds can be added to the atoms of the protein backbone, so that their flat face don’t show. In order to see and select the backbone atoms, you must turn the ribbon representation off. After adding the fake bond, you can turn the ribbon on again, and hide the atoms, and the fake bond will look great.
Instead of distance, one can also create actual bonds. This is how it works:
If you are using the licorice representation and want to print a group of atoms as part of a larger protein, such as a sidechain or a ligand, you can easily thicken them so that they will print better. Here I’ve selected a residue, which also selects the atoms from the sidechain. As with H bonds and distances (both of which are pseudobonds in chimera), you can change real bonds thickness by going to Actions > Inspect. Select Inspect: Bond, and increase the radius.
If you’d like to use the spheres representation, you can alter the size of individual atoms or bonds, or all the atoms of a given type. Just go to Actions > Inspect. Select Inspect: Atom, and increase the radius. If you want to change the radius of all atoms of a given type, first select all of them by going to Select > Chemistry > Element, and choosing the atom type.
This can be very useful in certain cases. For example, consider the model of a triple base pairing below (which occurs in tRNA). In it I have changed the atom sizes to be much smaller that the default. This highlights the spacing between the base pairs and make it easier to see how they are bonded. I also made each atom type a different size, so that even if printed in a single colour, it would be easy to recognize different atoms. With the printed model we used sharpies to color H bonds, oxygen, nitrogen and phosphorus atoms.
Note: Chimera had a bug with the spheres representation that was fixed in version 1.11, released on May 31 2016. I suggest you get the newest release, so you don’t have to worry about this. When you export your STL, Chimera versions earlier than 1.11 would render each sphere with a huge number of faces, and if you have many atoms rendered as spheres your final file will be enormous. You can get around this problem by exporting to other 3D file format, such as X3D, and then converting that to STL. A way to perform this workaround is described here: http://www.cgl.ucsf.edu/pipermail/chimera-users/2014-June/010045.html
Another way to get around this is to render your molecule as a surface, but make the probe radius very small with the command setattr s probeRadius 0.01. Chimera calculates a molecule's surface by considering that each atom has a certain radius, and then seeing the depth that is accessible to a sphere of arbitrary radius. So if you make the probe radius very small, you end up with the same shape as the spheres representation. Don’t forget to increase the quality of the rendered surface using the command setattr s density 10.0, or even a quality higher than 10 if you want to enlarge your model a lot.
Using all the tips above, 3D printable models can be successfully prepared using any representation. This becomes especially powerful when different representations are mixed together to highlight different aspects of a model. My favourite example is the zinc finger model shown below. The DNA is rendered as spheres, the protein as ribbons, the residues interacting with the zinc atoms are shown as licorice, while the zinc atom itself is shown as a sphere. The hydrogen bonds and interactions of the zinc atoms have also been rendered, making the model sturdier.
When working with models containing both protein and DNA, rendering the protein as ribbons and the DNA as spheres or surface is a straightforward way to highlight structural motifs and distinguish between protein and DNA. The cro434 model shown below is another example of this trick.
This is of course not the only possible way to do things - you have to be creative, and think through what you want to highlight in each model. For example, take a look at the model of RNA polymerase active site shown below. The nucleic acid backbone has been rendered as a thick coil, highlighting the strands conformation, and the nucleic acids are shown as sticks, which allows us to understand how each piece of the strand is interacting and held together. A large chunk of protein is shown as ribbons, and the residues of the active site are also shown. A lot is going on. The entire model is made sturdy not only by rendering the hydrogen bonds, but also manually adding several thick fake bonds, shown in pink. Despite its complexity, this model printed very reliably, and is also sturdy.
Before slicing any STL model you create with Chimera, it’s very important that you run it through Netfabb. This is because the STL mesh generated by Chimera is not a solid object, and will thus not slice properly, and your print will fail.
In June 2016, Netfabb modified their landing page because they had been acquired by Autodesk. The new page doesn’t seem to have any link to the cloud service, but it’s still working at this address: https://modelrepair.azurewebsites.net/
Update: Because Autodesk is awesome, they offer free educational licenses of their software, which means you can get the full version of Netfabb on your desktop. It’s called Netfabb standard, and it will fix ANYTHING. Really. I’ve fixed models over 900mb, it took 20 mins and Windows thought Netfabb had crashed, but if you just keep waiting it’s going to spit the fixed file.
To obtain a free educational license for Netfabb Standard, go to www.autodesk.com/education/free-software/netfabb. Download and install Netfabb Standard using an educational license.
Open Netfabb Standard. Import the STL file to be repaired. If there are problems with the mesh, Netfabb will display a warning sign.
Go to Extras > Automatic Part Repair, or click on the red cross icon on the bottom right of the screen. This will bring up the Automatic Repair menu.
Select Extended Repair, and wait while Netfabb processes the file. For small models this will take seconds, but for large models it may take minutes.
Right click on the model and select Export Part > As STL or go to Project > Export Project as STL to save your repaired model. Netfabb adds (repaired) to the filename to distinguish it from the original file.
Because molecular models are always irregular and have lots of overhangs, they will always need a lot of supports when printing. However, by orienting your model properly, you can reduce the amount of supports used, reduce the print time, save material, and minimize your chances of failure. You can sometimes tell by looking at the model what is roughly the best orientation to print it, and you can change it in the slicer. If you can’t, however, you can use an awesome free software from Autodesk called Meshmixer to do it.
You can download Meshmixer at http://www.meshmixer.com/. It can do a LOT of things, but we’re only interested in it for this tutorial because it can orient a model so as to minimize overhangs with just a few clicks. To do this, import your STL file, select Analysis > Orientation, accept the calculated orientation, and export the model again as an STL (be sure to choose binary STL format, not ASCII, which will make your file much bigger).
Meshmixer by default shows your object with a preview of the printer bed plane, but when you export the STL the plane is not exported. If you want to disable it for better visualization, just go to View > Show Printer Bed and toggle it.
“Slicing” is the process of converting a 3D model file into instructions for a 3D printer. To do this, the 3D shape is sliced into a stack of horizontal layers with sequential printer commands. The slicer software is used to define parameters for printing like object location and orientation, printing temperature, layer height, printing speed, interior fill, and supports. These instructions called G-code, and .gcode is a common file type used by many desktop 3D printers. Then you can stream instructions directly to the printer, or save a .gcode file onto an SD card for the printer.
Having rendered your molecule on Chimera, fixed the mesh on Netfabb and oriented it on Meshmixer, it is now time to slice it with the one slicer to rule them all: Simplify 3D. I’m not kidding, Simplify is seriously the best slicer out there by far. It also costs $149 for two licenses, and you can try it for two weeks. But I guarantee you will not want your money back after seeing the difference it make. The price is nothing compared to how much better your prints are going to look, the failed-print frustration you’re going to avoid, and the significant amount of material you’re going to save.
In addition to generating the best toolpaths and having oficial printer profiles for almost every FDM desktop printer out there (and if not you can easily create and tweak one), Simplify is also the only slicer that allows you to customize supports. You can add or remove individual supports, which is fundamental for printing something as irregular as a molecule. It also means that you can tell it to not add supports in a place where you’d never be able to remove them, even if that means the print may droop a little in that spot. If you couldn’t take the supports off there in the first place then it’s not an exposed location and the droop will be mostly unnoticeable.
Printing can take anything from 1 hour to 50 hours. It takes so long because they have a lot of surface area and at the perimeter the speed is reduced to get a quality finish. For a small volume, the print takes a while,usually between 3 and 16 hours.
For comprehensive tutorials about slicing and Simplify3D settings for obtaining good prints, please visit https://www.simplify3d.com/support/. Here I will only elaborate on tips for getting supports right when printing molecular models. Other settings are general for all sorts of models and well covered in the Simplify3D official tutorials.
It’s advisable to always print with a raft, in order to ensure all the supports will adhere and not be knocked off, so that all overhangs will print properly.
Please read the official Simplify3D tutorial on support structures at: https://www.simplify3d.com/support/tutorials/adding-and-modifying-support-structures
Also view the official video tutorial at: https://www.youtube.com/watch?v=6tlrCpwAV4M
When adding supports with Simplify, a good rule of thumb is to first generate support structures automatically using anything between 45° to 60°, depending on how well your printer does overhangs. The support generator will miss some sharp bottom angles no matter what the resolution is used. You should always inspect the support placement to and add extra supports where needed. Below is an example of a section of the model where you’ll need to add supports at both 4 mm and 1 mm resolutions.
If your model has lots of crevices, sometimes it is preferable to leave some regions unsupported, as it might be very hard to pick supports off (if you’re not printing with dissolvable supports). The example belows shows a model ATP synthase, where many of the supports within the crevices are hard to remove.
To have a better idea of where Simplify is adding supports, try using the cross section tool. It also makes it easier to remove supports within crevices when you don’t have a direct line of sight from outside the model. An example of this is shown below.
Another important thing to keep in mind is that when you have a bridging section (an overhang supported from both sides), you can get away with no supports. So for example, inside alpha helixes (where it can be annoying to pick off supports) most supports can be eliminated, as shown below.
Once all supports are in place, the last step before saving your G-code and printing is to preview the generated trajectory. This allows you to catch a lot of problems with the model without going through the frustration and waste of starting a print that fails due to a bad toolpath. With molecular models, a common issue is that the model mesh is broken or not watertight, which can be fixed by running the model through netfabb. The example below shows a problem that occurs with the model hydrogen bonds generated by Chimera before being run through Netfabb, and how it looks after.
Finally, you should preview the trajectory to inspect whether there might be any features that are too small to print properly. Generally it’s desirable that the features are large enough so that both the external shell (previewed in dark blue below ) and one internal perimeter shell (previewed in light blue below) can be printed. In the example below the hydrogen bonds are so small they don’t have internal shells, so it would be desirable to enlarge the model by 50-100% for better reliability when printing.