1. Introduction to ePMV in C4D
IN PROGRESS:
will contain screen grabs to guide many key steps by December 3, 2012
Click Here for PDF version for now
ePMV: INTRODUCTORY TUTORIALS July 2012 AMI Workshop
Graham Johnson & Fabian de Kok
Made possible by Ludovic Autin, Graham Johnson, Michel Sanner & Arthur Olson
http://epmv.scripps.edu Download free | Install | Tutorials | Gallery | Forum
embedded Python Molecular Viewer (ePMV) runs free molecular modeling software directly inside of professional 3D animation applications (hosts) to provide simultaneous access to the capabilities of these newly connected systems. Uniting host and molecular toolkit functionalities into a single interface, allows illustrators to quickly create common representations of molecular models and to perform computational simulations, like molecular dynamics, directly inside of a host’s viewport with relative ease.
If you have experience with 3D software, especially with Cinema 4D, this tutorial should take about 2 hours and it will turn you into an intermediate ePMV user. If you are new to 3D software, the tutorial could take you anywhere between 3 and 12 hours. It introduces you slowly and methodically to the Cinema 4D interface as you learn how to generate and work with molecules in the ePMV GUI.
Quickstart Activities
Basics 1: Build a PDB file representation in a Professional 3D application with 2 mouse clicks
Start C4D
Open ePMV GUI
C4Dmenu: Plugins > ePMV (one click-n-drag)
Get a Molecule using the ePMV GUI
Click [Fetch] to get 1crn (box comes filled with this 4-digit PDB code by default)
(second click)
You have a ribbon model of the protein Crambin (PDB ID code 1crn)
Zoom in on scene
Hover mouse over viewport & type H on keyboard
Build Atoms
1. Check [√]Atoms radio box
a) See all of the atoms in the PDB file with their canonical IUPAC colors
F. Study model
1. Click & drag upper right viewport icons to rotate camera, pan, zoom, etc.
a)
2. Turn Atoms on and off as you explore to compare to the underlying ribbon.
a) Check & uncheck [√]Atoms. Leave Atoms on when you’re done.
G. Align view to defaults to match instructor screen
1. ViewportMenu: Edit>Frame Default
2. Hover over viewport & type H to center and zoom again
H. Render the molecule (⌘R)
I. Expand to 4 panel view
1. Click upper right viewport icon
a)
2. Zoom each of 4 panels
a) Hover mouse over each panel & hit H each time
3. Render all four panels
a) ⌘R while mouse hovers over each panel one at a time
J. Experiment with each of the different Color by scheme: <options>
1. In the Object Manager:
a) Unfold 1crn
b) Unfold 1crn:A
c) Unfold 1crn:A_cpk to expose the instances of each atom on the molecule and to understand the hierarchy format
2. In the ePMV GUI:
a) Unfold >Color by
b) Try every menu pulldown to witness changes to the molecule and to the material manager. Depending on the molecule, Domains may have no effect
K. Beautify
1. Open Render Settings
a) Click Effects>AmbientOcclusion
b) Render to see results
2. Speed up
a) Set Acc = 20% | Min = 8 | Max = 32
b) Render
3. Uncheck [ ]Specular for all materials
a) Double-click the first material to open the Material Editor
b) Hover mouse over Material Manager
c) Hit ⌘A to select all materials
d) Uncheck [ ]Specular in the Material Editor
e) Render
L. Save your Cinema 4D file
1. C4D menu: File>Save file as…
a) 1crnSpaceFillAO1.c4d to a new folder you make on the desktop
M. Add a doodle object signature and consider a white background
1. C4D menu: Tools>Doodle>DoodleEraser
a) Click once in the scene
2. Select Doodle Object in Object Manager
3. Attributes Manager>Options Tab
a) Set size to 800x600 or greater
b) Load Bitmap
c) Import your signature PNG
4. C4Dmenu>Create>Environment>Environment
a) Select Environment in the Object Manager
b) Check [√]Enable Fog
Render a JPG
5. Render settings:
a) Output>Preset: 800x600
b) Output>Frame Range: Current Frame
c) Save>File: Browse to the folder you created for the file to create a new file path with .jpg name
d) Save>Format: JPG
6. Render with PictureViewer to save a file (Click Center Clapboard)
N. Share your signed creation with the world
1. Upload JPG to ePMV gallery by following instructions
2. Add a caption to your online gallery image with a description and credits
O. Save this final incarnation of your C4D file
1. File>Save (⌘S)
II. Basics 2: model a ribbon representation
A. Turn atoms off
B. Build a Basic PMV-style Ribbon
C. Unfold Backbone Representation
D. Check [√] Ribbon to build (you may already have a ribbon that was built by the new default when you first loaded 1crn)
E. Explore color options
1. Try all o f the color options
a) Many schemes either don’t work in this beta version or are meaningless on a ribbon representation.
2. When finished exploring, choose Color by scheme: [rainbow]
a) Some schemes, like rainbow, currently work with limited functionality on ribbons, coloring from N term to C term in reverse ROYGBIV
F. Choose Color by scheme: [secondary structure]
G. We will now work with molecules in a familiar interface
1. Change a default color:
a) Double click the first hot pink material in the Material Manager
b) Change the blasted pink to a blue of your choosing
c) Unfold the hierarchy to expose the coils, strands, and helices in 1crn:A_ss
d) Material Manager>Function>Render All Materials
e) See in the Object Manager how this changes the applied material
2. Override a default color
a) Create a new material in the material manager
b) Change it from white to green
c) Drag the new green material onto the other pink helix in the viewport
d)
e) Note in the Object manager how this retains the original pink material, but overrides it with a second green material on top of it (to the right).
H. Add a point light to the scene
1. Drag it up on Y to about 50 (show them how to grab the green handle and pull up)
2. Set Z to -20
3. ⌘R to render viewport
I. Add a fill light and an ambient light
1. Create>Light
a) Do this twice, or duplicate the light by control dragging in the Object Manager to make two lights
2. Select one of the lights
a) Double click to rename it Key Light
b) Move it to your favorite Key Light position
3. Select the other light
a) In the attributes manager, check [√] Ambient Illumination
b) Reduce intensity to ~30
4. Render to test your lights
5. Tinker with the lights and colors for 5 minutes
J. Render a JPG and post it to the gallery
III. Quickstart Basics 3: Upgrade to a Fancy Ribbon Model
A. Uncheck [ ]Ribbons
B. Check [√]Beaded Ribbons
C. Click [Options] (right of beaded ribbon)
D. Experiment with huge palette of settings for 5 minutes
1. Use your glossary as a guide if you want
E. Render a JPEG and post to the gallery
IV. Quickstart basics 4: Add a transparent surface
A. With fancy ribbon still visible
B. Make an MSMsurface
1. Unfold Surface representations
2. Check [√] MSMSurf
C. Experiment with Surface Colors
1. Unfold Color by
a) Try all of the colors.
2. Set Pulldown to Scheme: Atoms using CPK
3. Render view to see result
4. Set Pulldown to Scheme: AtomsDG (polarity/charge)
5. Render view to see result
D. Make the AtomSurface coloring transparent
1. Double Click the first Material named “_Blue” to open the Material Editor
2. Shift select the “_Red” and “_Green”
3. In Material Editor check [√]Transparency
4. Scroll 20% up to 60
E. In RenderSettings>AmbientOcclusion, click evaluate transparency
1. Render
V. Quickstart basics 5: Animate a Ribbon-in-Surface Turntable Rotation
A. In Object Manager, select 1crn (topmost parent null)
B. Set playback head to zero using VCR controller
C. Uncheck Translate, Scale and Parameter Key record options next to Key button so only Rotate is blue
D. Click the [Key] button
E. Set VCR to end at frame 90
F. In Coordinate Manager in H box type 360-360/90
1. Make sure H says 356, then hit [Apply]
G. Click the [key]
H. Hit VCR play
I. Linearize the anchors to make a clean rotation
1. Open timeline
2. Select all keyframes (⌘A)
3. Right Click on a Keyframe and select linear
J. Set up to render an animation in the RenderSettings
K. Render the movie as a quicktime with H264 60% compression
L. Post to the gallery when it finishes and meanwhile work on next project.
M. Save file
VI. Build the Biological Unit representation of a protein file:
A. Restart C4D and then ePMV
B. ePMV menu>Edit>Options:
1. uncheck [ ] Center molecule
2. Change [Secondary structure] in the pulldown to [CMS]
C. Get Molecule: enter the 4 digit ID 2plv and click [Fetch]
1. We are fetching the asymmetric unit instead of downloading the all-atoms biological unit, which could unnecessarily bring 60x more data into your scene.
D. ePMV menu>Edit>Biological Unit
E. Type 2plv in the box and click OK (Type the exact name of your molecule, which is visible in the object manger)
1. Wait patiently
2. 60 copies of the original asymmetric unit have been replicated to form the entire viral capsid for polio virus- an icosohedral (soccer ball) sphere
F. Unfold > Surface Representations
1. Adjust the settings for coarseMolSurf to Isovalue= 10, Resolution= -0.15, Grid Size= 20
G. Unfold > Color By:
1. Select [Chains] from the drop down
H. Adjust Color by Chain Settings (there is a bug in 0.5.2 that prevents color palette edits from sticking – update to 0.5.3 as soon as its available)
1. ePMV menu Edit > Color Palettes
2. Unfold > Chains
3. See in object manager that there are 4 chains labeled 1-4, so click to adjust those colors as desired
4. Click [Set To]
5. In the main ePMV GUI, set Color by [Chains] form the drop down menu
I. Color by pentamers
1. Delete the textures of the parent geometry
a) In the C4D object manager unfold 2plv
b) Delete all but the phong tag from the CoarseMS_2plv mesh object (your virus should turn gray)
2. Unfold 2plvbioMT
a) In the Material Manger, make 12 new materials colored as you see fit
b) Under 2plvbioMT, color 5 instances at a time
c) From top to bottom, select the top 5 monomers that make a pentamer 2plv_60 to 2plv_56
d) Adjust viewport to see them clearly
e) In the Material Manager, select the material you want to apply to the pentamer then click Function > Apply
f) Repeat steps fo 2plv_55 to 2plv_51, etc. eleven times
J. Backbone Worm Model (loft)
1. Under > Surface Representations uncheck [ ] coarsMolSurf
2. Unfold > Backbone Representations
a) Check [√] Loft
b) In the object manager under 2plv, unfold each of the chain parent nulls e.g., unfold 2plv:4 to 2plv:1 so you can see the loft object children.
c) Unfold each loft object
d) To speed up your viewport, simplify the loft objects by selecting the circle under each loft at once and in the attributes manager for the four circles set Intermediate points= Uniform, Number= 1, Set radius to 1 or any thickness for the backbone trace you like
e) Remove linear interpolations by updating the settings in the attributes manger for the four spline objects. Set intermediate points= Uniform, Number= 1, Change type form [Cubic] to [Linear] and then back to [Cubic]
3. Unfold > Color By:
a) Select [Chains] from the drop down
b) ePMV menus Edit > Color Palettes (note, there is a bug in 0.5.2 that prevents color palette edits from sticking – update to 0.5.3 as soon as its available)
c) Unfold > Chains, see in the object manger that there are 4 chains labeled 1-4, so click to adjust those colors as desired
d) Click [Set To], in the main ePMV GUI set Color By to [Chains] from the drop down
4. Take a peak inside:
a) Select 5 monomers that make a pentamer and hit ‘Option + G’ to group them
b) Move the parent of the group to pull the pentamer aside or hide it to take a peak inside the empty virus
c) Turn on ambient occlusion effect under render settings and crank the Maximum Ray Length to >400 to make it dark inside
VII. Full To-Scale Tobacco Mosaic Virus Particle (TMV)
A. Under ePMV options (edit menu), deselect 'center molecule', and set 'representation at loading' to none, press ok
B. Fetch: 2om3
C. Create Coarse Molecular Surface and set isovalue to 3 and grid size to 7
D. Select biological unit in ePMV edit menu. Type in 2om3 and hit OK
E. Create cloner object and set mode to 'linear.' Set x to 70cm, y and z to 0cm and count to 43 (Virions are ~300 nm in length and ~18 nm in diameter, these parameters are approximately to scale)
F. Rotate cloner object -90 degrees on Z axis
G. Place 2om3bioMT into the cloner object
H. Enable ambient occlusion in render settings and set color scheme in ePMV gui
I. Create a background object and set color ‘Use Color’ to ‘On’ in the attributes panel, default color should be white
J. Play with materials and lighting if time permits. Increase grid size in small increments for more detail.
K. Render out scene and save file
VIII. Different Representations for RNA and Coat Protein for TMV
A. Under ePMV options (edit menu), deselect 'center molecule' and set 'representation at loading' to none, press ok
B. Fetch: 2om3
C. Expand 2om3 in the object manager, there should be two chains (R=vRNA, and A=Coat Protein)
D. Make sure 2om3 is selected in the ‘Current Selection’ drop down menu
E. Select 'chain' under the 'Add selection set using string or...' drop down menu in the ePMV gui
F. Type in R after chain (it should read 'Chain R')
G. Hit the ‘save set’ button. You should have another selectable object under the 'Current selection' drop down menu named '2om3_selection0.' This is the RNA.
H. Repeat for chain A, but make sure to reselect 2om3 under the 'Current selection' drop down menu. 2om3_Selection1 will be the Coat protein.
I. Create biological unit for 2om3
J. Select 2om3_selection1 (Coat protein) and apply MSMsurf or CoarseMolSurf
K. Select 20m3_ selection0 (vRNA) and select atoms. The Coat protein and vRNA should be visually distinct at this point
L. Play with different representations for each chain and render out scene and save file
IX. NMR 2kzy
A. Restart C4D
B. ePMV menu>Edit>Options:
1. deselect [ ] Center molecule and [ ] Remove water
2. Click OK and close the options window
C. Fetch 2kzy
D. Check [√] Lines
E. Unfold Data Player
F. Click the pulldown that says 2kzy.mo… and drag to 2kzy.model to reinitialize the data player
1. The Grey slider bar below should move to zero at the left
G. Scroll back and forth to see the different states (represented by your line model) in the viewport… there are 20 possible states (the last two of the 21 states are redundant)
H. Don’t try to animate this with simple interpolation- your teacher will explain why.
X. Bake Texture to Surface
A. Restart C4D
B. Fetch 1crn
C. Build a molecular surface by checking [√] MSMSurf
D. Render
E. Color by <Per Residue>
F. Save the File
G. Make a new Light and check [√] Ambient Illumination
1. Your scene will appear dark, but this is fine- render the viewport if you want
H. Apply a Bake Texture Tag on the object MSMS-MOL1crn in the Object Manager
I. In the Attribute Manager for the Bake Tag:
1. Tag:
a) Filename= 1crnPerResMat
b) Format = jpg
c) Options > Select Surface Color > Click Bake and be patient
J. In the Material Manager, create a new material
1. Double click to open your new material in the Material Editor
2. In the Color Channel, click the […] button to the right of Texture to set a path to the jpg you just created
3. Drag this material onto your MSMS-MOL1crn object
4. Turn off your light and you should see a fully textured object that looks like your rendered version, directly in your viewport
a) This step is not necessary for Blender and Maya which now have Vertex rendering directly in the viewport
XI. Represent DNA in a Variety of Styles
A. Restart Cinema 4D
B. Open ePMV
C. In the ePMV menu at top, click Extension>BuildDNA(w3DNA). In the Build DNA palette:
1. In the box enter a name (i.e. test.pdb): type AMInews.pdb
2. In the box enter a sequence: paste or type: GCC ATG ATT AAC GAG TGG AGT (you can repeat it three or four times to make a longer DNA strand, but its wise to keep it simple for this tutorial)
3. Choose a type [M4>B-DNA (generic)]
4. Click [Build] and wait for a few seconds (time depends on the length of your strand and any traffic on the Rutgers server)
a) The widget sends users a sequence to the w3DNA server (http://w3dna.rutgers.edu/index.php/rebuild) to generate a straight PDB file of the specific sequence that automatically gets constructed into the scene
5. Create different representations
a) Unfold > Backbone representations and uncheck [ ] Ribbons
b) Under Atoms/Bonds check [√] Sticks under Color by: choose [Per Residue] then uncheck
c) Under Atoms/Bonds check [√] Atoms and under Color By: choose [Per Residue] then uncheck
d) Under Surface Representations check [√] MSMSurf. Change the probe radius to 0.01 and Color by: choose [Per Residue]
e) Leaving [√] MSMSurf checked, change the probe radius to 1.4 and under Color By: choose [Chain]
6. Adjust the default colors of the Color By Chain settings (note, there is a bug in 0.5.2 that prevents color palette edits from sticking)
a) ePMV menu, Edit > ColorPalettes
b) Unfold > Chains
c) See in object manager that there are 4 chains labeled 1-4, so click to adjust those colors as desired
d) Click [Set Color]
e) In the main ePMV GUI set ColorBy to [Chains] from the drop down
f) Uncheck [ ] MSMSurf
7. Under Surface Representations check [√] CoarseMolSurf. Set Iso= 0, res= -0.15, and Grid Size= 60, then under Color By: choose [Chain]
a) You can adjust the default colors of the color By Chain settings as described in the MSMS step if desired
XII. Loading a volumetric file (3D density map) derived from single-particle Electron Microscopy
A. Visit the Electron Microscopy Data Base
1. Click Basic Search
2. Type nuclear into the Title box on the search page and hit the [start search] button
3. Click on entry 1097
4. Click Map Information
5. Click to download then unzip emd_1097.map.gz
B. CHANGE emd_1097.map to emd_1097.ccp4 (bug in PMV doesn't recognize the .map tag)
C. Open ePMV
D. Load a molecule, e.g., 1crn to trigger needed functions (temporary glitch we'll fix soon)
1. This dummy molecule need not be visible, but its good to leave on to get an idea of the major scale differences between a tiny protein like 1crn (crambin) and your relatively large Nuclear Pore Complex
E. Unfold DataPLayer
F. In Data Player panel, Browse to your .ccp4 file to load it
1. Since the file is formatted with proper headers, the map will load at a correct scale compared to any molecules in the scene (often shockingly large)
G. Zoom out to see your nuclear pore complex surface map
1. Hover over viewport and Type H… you’ll be shocked by the size difference.
H. Adjust your data slider to approximately 2.6 (better to type then to slide, but play around since this is a large file)
I. Now you can center the molecule to the origin, generate a large sphere to mock up a nucleus, and I'll show you how to map the nuclear pore to your fake sphere nucleus in a separate tutorial for Cinema 4D.
XIII. Apply the nuclear pore to a mock nucleus
(These Cinema4D-specific instructions are generalizable to skilled users of other host software like Maya and Blender)
A. Generate a 3D isocontoured surface model using ePMV in the 1st part of this tutorial
B. Reduce the Polygon Count on your molecule
1. C4D top menu Object>Deformer>PolygonReduction
2. In the Object Manager panel, drag the new PolygonReduction deformer onto 'yourLoadedDummyMoleculeName'IsoSurface to make it a child of yourLoadedDummyMoleculeName'IsoSurface
3. Right click on 'yourLoadedDummyMoleculeName'IsoSurface and select Current state to object
4. After the new object is created below the original, delete the original (and its child Polygon Reduction Deformer
C. Center your nuclear pore complex to the origin of the scene.
1. Select your reduced polygon mesh in the Object Manager
2. Click on the PointTool button (in the left-most palette in C4D's default layout)
3. Hover in the viewport and Select all of the points ⌘A on a mac, Cntrl A on a PC
4. In the Coordinates manager, set all values to zero and click [Apply]
5. In the Coordinates manager, type -90 in the H box and -300 in the Y box and click [Apply]
D. C4D top menu Object>Primitive>Sphere
E. With the sphere selected, in the attributes manager, change Radius=8000, Segments=3, and Type=Icosohedron
F. Double click the sphere in the object manager to change its name to mockNucleusOuterMembrane
G. C4D top menu Mograph>Cloner
H. With Cloner selected, set Mode=Object and drag mockNucleusOuterMembrane sphere from the object manager into the Object box in the Cloner attribute manager
I. In the object manager, drag your LoadedDummyMoleculeName'IsoSurface onto the Cloner to make it a child of the cloner.
J. Click on Cloner and change Distribution=Surface
K. Click on mockNucleusOuterMembrane and change segments=24
L. Create a new material and drag it onto mockNucleusOuterMembrane
M. Hack a hole into the outer membrane
1. Double click the material name to change it to Nuc
2. Double click the mockNucleusOuterMembrane material icon to open the Material Editor
3. Check the [√] Alpha box and in the Alpha box details:
4. Check [√] Invert
5. Set the Texture pulldown menu to Effects>Proximal
6. Click Proximal (spherical gradient box) to edit its details in the Material Editor Alpha
7. Drag Cloner from the object manager into the big Objects area box
8. Set Start Distance=410 and End Distance=500
N. Render your scene
O. Play with adding bump maps with noise and transparency, etc.
P. Try adding a Displacer Deformer as a child of mockNucleusOuterMembrane with noise scaled to ~3000 and height to ~200 to make the sphere more organic.
1. This works fine for mocking up a nuclear membrane, from outside of the nucleus, but recall that its actually a double membrane (like a continuous spherical Endoplasmic Reticulum that is fenestrated by the nuclear pores.
2. If you plan to fly close to or inside of your nucleus you may need to temporarily replace your pores with cylinders, duplicate the sphere and reduce that spheres radius to mock the inner bilayer, then boolean to remove the spheres, etc.