Using molecular graphics software to create geometry

18 downloads 9502 Views 3MB Size Report
By default, Maya is able to open/import .obj, .fbx, .mel, .ma and .mb files ... Plugins can be installed to import a number of other 3d file types, .... resolution at the default, 8. ... 5. We'll use wrl2ma to convert the sigma1 representation to a .ma file.
Using molecular graphics software to create geometry Several PDB viewers, including Chimera and Pymol, are able to export molecular representations as VRML files. VRML files can then be converted to a file type that can be imported directly into the 3D application of your choice. By default, Maya is able to open/import .obj, .fbx, .mel, .ma and .mb files (among others). Plugins can be installed to import a number of other 3d file types, but as of yet there is no direct way to import VRML files into Maya. First, we’ll explore the functionality of Chimera and export VRML files of the reovirus attachment protein sigma1, then we’ll use the ‘multiscale model’ option in Chimera to export the reovirus core as VRML. We will then use PyMOL to create a cartoon protein representation and export it to VRML.

Using Chimera to Export VRML Surfaces & Ribbons: Open PDB ID ‘1KKE’ using Chimera’s ‘Fetch by ID’ command under the File menu. To download any PDB directly, you can go to http://www.rcsb.org. Chimera can also be downloaded for free from the UCSF Chimera website (http://www.cgl.ucsf.edu/chimera/). By default, the molecule is seen as a wire model. You can tumble the model using the left mouse button (LMB). The right mouse button (RMB) allows use to zoom in, and the middle mouse button (MMB) pans. Play around a little with different atomic representations. Go to: Actions > Atoms/Bonds > sphere. You can also view the model as stick or ball & stick representations. The default: wire model of Sigma1.

To view the model as a ribbon, go to Actions > Ribbon > show. The ribbon model is now overlayed over the wire model (or whatever atomic representation you were last trying out). To hide the atomic model, go to Actions > Atoms/Bonds > hide. By default, the ribbon appears flat. You can change the look of the ribbon by going to Actions > ribbon > rounded (or edged). Note that it is very difficult to change how the ribbon looks after it's exported! Next, view the solvent-exposed surface by going to Actions > Surface > show. You can see the ribbon underneath if you change the transparency of the surface (Actions > Surface > transparency).

Surface/ribbon model with rounded ribbon and surface transparency.

We can export this model (including both the ribbon and surface). Select File > Export Molecular Graphics Software to Export PDB Geometry 1

Scene… and select ‘VRML’ from the pulldown File Type menu. Make sure you save your VRML file to someplace where you can find it later, and name it something like ‘sigma1_trimer_surfaceRibbon.vrml.’ Note that if you haven't hidden the atomic representation, this will also get exported in the VRML file. An important thing to note is that the surface that we just created is for a trimer. We won’t be able to pull this trimer surface apart in Maya, however! We will need to save another surface for an individual monomer if we want to later play with just the monomer in Maya. To delete the extra polypeptides, go to Select > Chain. Note that there are 3 chains, one for each polypeptide, and also water. We want to leave behind just the ‘A’ chain. Select the 'B' chain (it should be outlined in green when selected) and delete it (Actions > Atoms/Bonds > delete. Repeat this for chain ‘C.’ Note that the waters don’t appear in either the ribbon or surface models, so it isn’t necessary to delete them if you don’t wish to.

Surface/ribbon model of Sigma1 monomer with extra chains deleted.

Export the monomer surface and ribbon as VRMLs and name them something like ‘sigma1_monomer_surfaceRibbon.vrml.’ Note that saving models as ball/stick or any other representation can also be done in the same manner.

Multi-Scale Models: The “multi-scale model” option in Chimera is useful for creating low-polygon versions of molecules. This is especially useful for models with many subunits, such as protein complexes and polymers, or for proteins where atomic resolution is not desirable. Open PDB ID# 1EJ6 using Chimera’s Fetch by ID (under File menu). What you should see are 5 polypeptides. Switch to ribbon shading, and color each chain a different color. Another way to select chains is to control click on part of chain (you will see a green outline on the very small section you just chose). Then press the up arrow to select the entire chain. You may have to press the up arrow more than once, and Colored ribbon model of revirus core. pressing it after the chain is selected will select the entire model. You can press the down arrow to undo this. After selecting a chain, color it by Molecular Graphics Software to Export PDB Geometry 2

going to Actions > Color and selecting a color. Color is included in the VRML, and will be useful for us later once we import the model into Maya. Export the colored ribbon model as 'reovirus_Core_coloredRibbon.vrml.' To view the entire virus core, go to Tools > Higher-Order Structure > Multiscale Models. A new window will appear. At the top of the window, under 'Select chains' press on the 'All' button. This ensures that your multiscale model will use all of the polypeptides. An important option to note is the 'Resolution' button in the middle section of the window. This determines how smooth or bumpy your model will be. Higher numbers result in smoother models with less molecular detail, but correspondingly smaller polygon counts. For a model as large as the reovirus, we want a relatively smooth surface, so keep the resolution at the default, 8.

The multiscale model controls window.

Next, at the bottom of the window, make sure 'Multimer' is set on 'Biological oligomer.' This tells Chimera to use the coordinates in the PDB file that pertain to higher order structures. Usually if this information is included in a PDB, this selection is on my default. Press on the 'Make models' button. Be patient this model is quite large! Chances are good that you'll need to zoom out quite a lot (right mouse button). If you zoom in and out, you might notice that you're only looking at a relatively thin cross-section of the core. To see the entire core, you need to change the camera's clip plane.

Slicing through the core using the camera clip plane

Go to Tools > Viewing Controls > Camera. By default the window opens in the “Camera” tab where you can change the near and far clip values manually (in the fields at the bottom). For a more ‘interactive’ experience, you can also go to the “Side View” tab and click-drag the yellow lines framing your model. If you place one on either side of the model, you should now be looking at the entire capsid from the outside, and it should appear as a solid surface. Playing around with the clip plane can allow you to look inside the virus core as well.

The core, in full 3D.

Molecular Graphics Software to Export PDB Geometry 3

Now go back to the Multiscale Model window and play around with the resolution level. Make sure all of the chains are selected, then change the resolution to 2 or 3, and the press 'Resurface.' Try higher numbers as well. Go back to a medium resolution, around 8. Export the multiscale model in the same way that we did before (File > Export Scene...). Save the model, making note of its resolution in its name, such as 'reovirus_core_res8.vrml.'

Using Pymol to Export VRML: Open the PyMOL application and go to File  Open to load the same reovirus sigma1 trimer file (1KKE.pdb). In the right-hand column on the interface, you’ll notice a layer called 1KKE with boxed letters A, S, H, L, and C. These letters correspond to the menus for the “Actions” “Show” “Hide” “Label” and “Color” commands respectively.

PyMOL’s default ‘lines’ representation

As with Chimera, if you want to see the molecule in only one representation at a time, you will need to turn off the default (or any previouslyselected) representations. On the “1KKE’ layer, click on H and select ‘everything’ (this hides the default ‘lines’ representation). On the same layer, click S and select ‘cartoon.’ You can also modify the cartoon look by going to the horizontal drop-down menu at the top and select Setting  Cartoon  Smooth Loops or Fancy Helices. To color the chains differently, click C  by chain  by chain. To export your model, simply go to File  Save Image As  VRML 2…, and name it appropriately. The model has n ow been switcvhed to ‘cartoon’ representation, and colored in chain mode.

Converting VRML to a Maya-Compatible File Format wrl2ma There are several ways to convert VRML files to something that Maya can read. Maya comes installed with a command-line executable, called wrl2ma that can create Maya .ma files from .wrl or .vrml files. Molecular Graphics Software to Export PDB Geometry 4

We'll use wrl2ma to convert the sigma1 representation to a .ma file. Note that this is not a very efficient program, so it is not recommended to use this for large files (like the reovirus multiscale model) unless you're desperate. Let's use wrl2ma to convert our colorful ribbon models of the reovirus core section and for the sigma1 protein models we made in Chimera and PyMOL. Make sure you know the file path for wrl2ma in the 'run' window. your VRML files. To make this easier on yourself, place all VRML files into the C:\ directory. Open the 'Run' window (Start menu > Run...). Alternatively, you can open the Windows terminal (Start menu > All Programs > Accessories > Command prompt). If you are using the windows terminal, you can find more information on wrl2ma by simply typing 'wrl2ma' at the prompt.

Information on wrl2ma command in windows terminal.

Enter the following, replacing 'filename' with the name of your file: wrl2ma -i C:\filename.vrml -o C:\filename.ma You should see a new Maya file appear in your C:\ directory.

Cinema 4D Using an application such as Cinema 4D purely for file conversion purposes is a bit overkill! However, since you are also likely to be using the application to explore its metaball capabilities, it is convenient to use it as a vrml converter as well.

Opening the virus file in Cinema 4D

Simply open the application, go to File  Open and select your reovirus_Core_res8.vrml (or .wrl) file. It will open in the model in the main viewport. You’re now ready to export your model to Maya by going to File  Export  Wavefront (.obj) (or “FBX”). Repeat this for ‘reovirus_Core_coloredRibbon.vrml’

Deep Exploration Deep Exploration (Right Hemisphere) is an application specializing in 3D file format conversion, and can both import and export a wide variety of 3d formats.

Opening the virus file in Deep Exploration

Molecular Graphics Software to Export PDB Geometry 5

Open the virus multiscale model vrml file with Deep Exploration. Export the model using File > Save As... and select either as Maya Ascii (.ma) or Maya Binary (.mb). Save any other VRML files that you have remaining as Maya files at this point.

Viewing and Optimizing Molecular Models in Maya Opening converted VRML files for the first time When you first open a molecular model in Maya, it is inevitably (1) very big and (2) very far from where your default camera is looking. So don't be alarmed it you don't see anything after opening a file! In addition, the model may be imported in lots of little pieces. Open the virus multiscale model in Maya (reovirus_Core_res8.obj exported from Cinema4D), and frame the virus by going to Window > Frame Selection in All Views. Alternatively, simply press 'f' when your mouse is over the Perspective view. If you still can't see the virus, or perhaps you just saw it fly by as the camera was moving, you probably need to adjust the camera's clip plane, similar to what we did in Chimera. Changing the far clip plane for the perspective camera in the attribute editor.

Open the Outliner (Window > Outliner) and select the Perspective camera ('perp'). Press ctrl A to open the attribute editor, or double click on 'persp' in the Outliner to open the camera's Attribute window. Change the Far Clip Plane to something big, like 10000. Now take a look at how the virus is organized in the Outliner. Depending on how you chose to convert the VRML file, you could have a single grouped object or hundreds of ungrouped shapes. Grouping objects will allow us to move and scale all of the surfaces together. Select all of the Object shapes in the outliner (blue squares) and group them by going to Edit > Group or press ctrl+g.

Scale reovirus_group in the attribute editor

Molecular Graphics Software to Export PDB Geometry 6

Rename the group something meaningful, like 'reovirus_group.' by double clicking on the group name in the Outliner. Scale the virus down to 0.010 in the attribute editor. Keep in mind how much you're scaling since you should try to stay consistent with all of the structures you import! When you're zooming in to see the scaled virus, if your perspective camera starts acting funny, you can reset it by going to View > Predefined Bookmarks > Perspective in the Camera view panel. This resets the camera to its default settings. Select the reovirus_group, if it isn't already selected, and switch to the 'move tool' by pressing 'w' or selecting the move icon in the Tool menu. Notice that the pivot point of the virus group is not centered in the virus. Press 'e' to switch to the rotate tool, and try rotating the virus.

Notice that the virus group's pivot point (yellow box) is not in the middle of the virus.

To move the pivot point to the center of the virus, go to Modify > Center Pivot. Now try rotating and scaling the virus group. Be cautious about selecting objects in the camera view! It's easy to accidentally select things at the shape level when you really mean to be selecting the group level. To take a better look at this, select the virus in the camera view panel by creating a selection box that encompasses the entire virus (using the left mouse button). Next, with the virus pieces selected, scale and/or rotate the selection. Notice that everything get's scaled and rotated on their individual pivot points. Undo these changes. If you want to select the group, press the up arrow, which will go to the next highest rung in the hierarchy. Now try rotating and scaling again. Save the virus file.

Scaling and rotating individual surface nodes rather than the group node can give you unexpected results.

Working with Ribbons Open the reovirus core colorful ribbon file in Maya (reovirus_Core_coloredRibbon.obj). If you exported this model using Chimera and converted it to a Maya file using the wrl2ma program, you should have something called Molecular Graphics Software to Export PDB Geometry 7

'root' in your outliner. If you open each group, you'll eventually find that your ribbon model is made up of many tiny polygons named something arbitrary. In addition, choosing each polypeptide individually is difficult! If you remember, we went out of our way to label each subunit a different color, which comes in handy now! Using the hypershade, we can select objects based on their shader and then group them together in a neat and organized manner. Open the Hypershade (Window > Rendering Editors > Hypershade). There should be a different shader for each subunit. Right-click on a shader and keep the right mouse button depressed. You should see a pop-up menu appear. Select the option to the right, called "Select Objects with Material." Alternatively, with one of the shaders selected, go to the Hypershade menu's Edit > Select Objects with Material. You should see that the entire ribbon is now selected. Group the surfaces together by pressing Ctrl+g or Edit > Group. If you scroll around in the Outliner, you should find your new group. Rename it something meaningful.

Looking at a ribbon model in Maya. The selection in the outliner corresponds to a tiny chunk of one of a ribbon.

Repeat this for each of the five subunits.

Selecting objects based on their Material can be a useful way of organizing ribbons.

Note that if you used Pymol to export ribbons, you will already have a single mesh.

Optimizing Polygon Counts and Smoothness No matter what resolution you used to export your multiscale model, there are times when you may notice that some of the surfaces look like they have sharp edges or points. To smooth a model while still keeping polygon counts down, a nice trick is to use mesh smoothing (in polygons menu, go to Mesh > Smooth) and mesh reduction (in polygons menu, go to Mesh > Reduce) in combination. Try this on one of the virus subunits (NOT on the whole virus unless you want to crash Maya). With the single surface selected, zoom in on your selection (‘f’ key), then go to the Polygons menu and try reducing the number of polygons (this is expressed as a percentage you would like to reduce) using Mesh > Reduce. Then try smoothing using Mesh > Smooth.

A polygon mesh (from top to bottom) in its default state, smoothed, with polys reduced by 50%, and smoothed after having polys reduced.

Molecular Graphics Software to Export PDB Geometry 8

Note that this technique is best for smaller models since it's computationally intensive. For big models like the virus, it's best to try to optimize as much as possible in Chimera before exporting as VRML.

Note on Flipped Normals In the process of going from PDB to a Maya file format, sometimes surfaces get flipped, which can cause rendering problems and can look pretty funny in the camera view. Typically, only one side of a surface is rendered, determined by the surface normal. If the surface normal is In this example, the normals are flipped in the protein on facing the wrong way, it results in an inside-out the right, resulting in an inside-out look to the protein. look to the surface. It's often most noticeable when you're rotating or tumbling the object. To view the normal direction on a polygon surface, select one of the virus subunits, then select Display > Polygons > Face Normals. You should see a lot of green lines appear, perpendicular to the polygon faces. To flip normals, go to the Polygons menu. Select Normals > Reverse.

PDBReader Plugin Viewing the normals of the models. The inside-out model is the one on the right.

You can import PDB files directly into Maya using a handy plugin called pdbReader, written by Tom Doeden. This plugin (and many other Maya plugins) can be downloaded from Highend3d (http://www.highend3d.com). Instructions are included with the download. This plugin reads atomic coordinates from PDB files and creates NURBs spheres for each atom, coloring them according to CPK rules. Note that this shouldn’t get used for very big models unless you want to crash Maya. You can use the PDBReader in combination with particles to get some interesting effects. Check out this tutorial at Highend3d by Eric Keller:http://www.highend3d.com/maya/tutorials/ dynamics_fx/138.html

Molecules imported using pdbReader, made of NURBS spheres.

Molecular Graphics Software to Export PDB Geometry 9

Suggest Documents