Showing posts with label Molecular. Show all posts
Showing posts with label Molecular. Show all posts

Friday, February 15, 2019

Knots and Robots

I've made various promises to share some recent work, and it's high time I follow-up on that. Over the past few years, I've done a number of freelance animation and illustration jobs, mainly for Professor David Leigh, who runs a Chemistry laboratory at the University of Manchester.

On several occasions I've been privileged to be able to work alongside this research group, who perform intriguing research in the field of molecular robots and molecular knots (What are those? See below for some more explanation). My contributions have been primarily visual analogies of the science behind their work.

I designed editorial illustrations to generate interest in the research and for use as cover images of the journals in which the research is published. I shared one example in my previous post and here's another example on the subject of molecular knots:

An eight-crossing molecular knot and some ions
What's a molecular knot? And why tie one? It's essentially a looped molecule that isn't just a loop. So… it loops through itself at least a few times. There's an interesting (to me) mathematical field of knots, where different kinds of knots are classified based on numbers of crossings–and I probably shouldn't get too far down this rabbit hole. So why create a molecular knot? In my mind, it's about finding novel ways of chemically synthesizing new structures, which could be useful in materials science, manufacturing, and nanotechnology.

It seemed logical to depict this particular molecule as a knotted rope, and I went with a nautical theme, including a central chloride ion represented as a Japanese glass fishing float. To get the right feeling of a heavy, thick rope, I spent a long time working with displacement maps to get the right texture, and I scattered loose hairs with a MASH network.


The illustration didn't end up on the cover of Science, sadly (these choices are made by the publisher for various reasons), but it did show up on various sites, from Forbes to NPR and was an "Image of the Day" for The Scientist and apparently appears in the 2019 Guinness Book of World Records, for the entry "Tightest knotted structure".

Following the creation of an illustration, I was often tasked with developing short animations to be used in presentations of the research. This knot synthesis animation was a huge technical challenge, but a rewarding project.


If I remember correctly, I ended up using three or four different rope rigging setups to create the necessary behaviours as the lengths of rope assembled themselves.

A technical mess looking like the proverbial Gordian Knot
One of the hardest parts, as you might imagine, was the binding action and getting the rope "tendrils" to wrap around each other; I had to carefully measure how far each rope-end was from its neighbours to get the action correct.


In addition to the "knot" work, I also ended up doing a few "molecular robot" pieces. One robot that the lab developed was capable of moving a cargo molecule from one binding site to another, controlled purely by the addition of different chemicals, such as certain acids and bases.


But what does this robot actually look like? Well, we can't observe molecules of this size directly, but here's the chemical structure, showing all the atoms that comprise it.

You can see why I used a lot of hexagon motifs
The lab developed this concept further and designed a programmable molecular robot with a similar structure to the one above. This new molecule can synthesize different stereoisomers, driven once again by different chemical reagents. What are stereoisomers? They are sets of related molecules that differ only in the 3D orientation of atoms. So think of one molecule having an atom sticking out the front, and its "stereoisomer" partner has the corresponding atom sticking out the back.


I had an early concept for a delivery system for the atoms (shown as colored balls in the video), which I think is kind of fun, but we ended up with a simpler concept where the atoms just fly to the tables.


I also had fun designing the peripheral apparatuses (apparati?) to fit with the mechanical theme:

Substrate entry...
... and chemical product exit

I will conclude this lengthy post here (granted much has happened in the last couple years). Thanks for reading all the way down here. Next week I'll share some details about my new workstation, which may be of interest to some?

Finally, an optional "Call to Action": If you'd like to help me out tremendously, subscribing to my Biocinematics channel and liking the most recent two videos (if indeed that aligns with your feelings towards them) would be massively appreciated. If you have already have a Google account or Gmail account, you don't need to sign up for anything new or take any extra steps. If you'd like to go the extra mile, you could share this YouTube channel with friends or family who might be interested in educational science-y stuff.

Thanks again for reading and supporting me,

Stuart

Tuesday, August 23, 2016

Molecular Monday Mornings in Maya - and an Announcement

I've started a new series of Maya tutorials on YouTube. I'm not sure how long it'll last, but the first two installments are about using Molecular Maya to work with macromolecular structures.

The first deals with the challenge of importing very large molecular weight structures.


The second is more visually interesting, because we get to render some beautiful atoms.


The main problem I anticipate will prevent me from continuing this series is the fact that I have a NEW JOB! That's right, I will soon be leaving the academic world for the first time since I was a wee tot, and entering the... industry sector? That doesn't quite sound like the right term, but in any case, I will be joining the fine AXS studio. I may have mentioned them quite a while ago on this same blog. I will be employed as a 3D Biomedical Technical Artist, which means I'll get to work in Maya on the things I most enjoy creating.

So how might this prevent future tutorials? Well, so far I've used an educational license for tutorials that I've had access to through my institutional affiliation. But after I leave, I expect I will occasionally get a monthly license for freelance jobs, but mostly I may not have Maya at home. Which is very sad. Maybe an anonymous benefactor could finance a continued subscription for my home use. Anyone?

This also reminds me that I should post some of the freelance work that I've done over the past year. How remiss of me.

Thanks for reading (and watching),
Stuart

Saturday, June 27, 2015

Molecular Visualization Principles #1-3

As a part of my research work, we are developing some principles, guidelines, or considerations for visualizing molecules in biological systems. It's hard to know exactly how to phrase and frame these, because they are not hard and fast rules; however, they may be helpful in creating more accurate depictions of biomolecules.

Each principle is presented as a short pair of animations. The Treatment A's do not adhere to the principle whereas the Treatment B's do. So far, I have created examples to demonstrate three of the principles, with more coming.

Principle 01 is "Leave some behind". It conveys the idea that typically not all molecules are consumed in a process. For example, there may be more subunits present in the environment than ultimately bind together in a biological complex. This example shows a virus capsid assembling. Note that many of the actual mechanics of capsid assembly (i.e. ideas that may constitute other principles) are ignored or simplified for the sake of clarity. One might declare some irony or hypocrisy here, however it is important that we build the framework for the principles individually before considering how they might be combined in real-world visualization cases.





Principle 02 is "Use Random Walks". It conveys the idea that molecules move randomly due to collisions in a crowded environment. For example, an Arp2/3 complex moves erratically before binding to an actin filament.





Principle 03 is "Add Non-binding Collisions". It conveys the idea that molecules might encounter each other with unproductive orientations and conformations multiple times before a successful binding event occurs. For example, Sos and Ras might collide a number of times before their orientations result in tight binding.



I'll be announcing an exciting new set of content very soon, so check back in a couple of days for that.

Later,
Stuart

Saturday, May 30, 2015

Molecular shading

Finally some biomedical visualization, right? These images are work in progress for a few animations I am working on to demonstrate in a simple way some important concepts of molecular behaviour. This is from my work, as opposed to a personal project.



When creating the molecular shaders, I had two important ideas to consider. The first was that the form of the individual molecules was not very important. They should be treated simply and cleanly. I considered going as far as flat shading or toon shading, but decided against it in favor of a softer representation with a slight indication of form.

The second was that contact between molecules and their spatial relationship should be clear. Ambient occlusion is a great candidate for this, but I didn't want the AO to show form within the molecule, so I resolved this dilemma using an miLabel attribute on the objects, separate AO shaders on molecules, and using the idnonself attribute of the mib_amb_occlusion shader.

Finally I wanted to add just a bit of aesthetic interest to the molecules, so I gave them a slight sheen of a different color using a samplerInfo.facingRatio to ramp to lambert.color to achieve the effect. I'm rendering each of these components of the overall look in different render layers so I can play with the strengths of each.

For the lighting, I used a single very large area light with soft shadows and final gather that employed an IBL sphere mapped with a colored ramp. See if you can figure out the ramp colors.

Later,
Stuart

Friday, July 11, 2014

Contour render test - Ribosome

This is a quick render test of a molecular complex (50S subunit of the 70S ribosome) that I decimated in ZBrush and then added a contour shader to, with a bit of post-processing in Photoshop. It's part of a larger piece that I will hopefully be able to share with you soon.



Later,
Stuart

Thursday, May 8, 2014

Adding variation to objects using a single shader

I'm working on a scene with many (potentially hundreds) of objects which are pretty much the same. In fact there are many instances with the same shape node. I wanted some subtle variation in the color of the objects, not over the surface of an object, but on an object to object basis.


After doing some research, I encountered a method described here which uses a triple switch node. I've used shading switch nodes a little bit in Maya before so this seemed feasible. The biggest problem, however, was that the method doesn't work with instanced objects out of the box. So I set out to develop a "better" system that works even with instanced objects and combinations of instanced and non-instanced objects.

The idea is that you create a ramp that is piped into any attribute you want to vary. The ramp shows a range of colors and each object gets a random value which corresponds to a single location on the ramp. If you're not able to get a ramp looking random enough for the extent of variation you want, you can always play with the HSV Color Noise attributes or plug something else into the ramp.

1) The image below shows how to setup the initial shading network. Plug a V ramp into the attribute of choice in your material and then create a Single Switch which gets plugged into the place2Dtexture node (output > vCoord).

Edit Dec 2015: Probably simpler to skip the place2dTexture and plug the singleShadingSwitch.output directly to the vCoord of the ramp.



2) Then assign your material to everything you want to exhibit the variation.

3) Then open the AE for your shading switch and press the Add Surfaces button.

4) Then run this code. Just paste it into the script editor, select it all and "execute" or hit enter on the numpad.
string $switch = "singleShadingSwitch1"; //change this name to the switch you want
string $connectedAttr[] = `listConnections -c true -d false -t "shape" $switch`;
//print $connectedAttr; //DEBUG

for ($i = 0; $i < (size($connectedAttr)/2); $i++){
 
 string $obj = $connectedAttr[($i*2)+1];
 //string $parent[] = `listRelatives -p $obj`; //get parent transform for instanced transforms
 // $obj = $parent[0]; //change object relationship to parent
 //print $obj + "\n"; //DEBUG
 if (!`attributeExists "randVCoord" $obj`){ //checks if attribute exists
  addAttr -at "float" -ln "randVCoord" -keyable true -hidden false -min 0 -max 1 $obj;
 }
 float $randCoord = rand(0,1);
 setAttr ($obj + ".randVCoord") $randCoord; //set random number to custom transform attribute
 if (!`isConnected ($obj + ".randVCoord") ($switch + ".input[" + $i + "].inSingle")`){
  connectAttr ($obj + ".randVCoord") ($switch + ".input[" + $i + "].inSingle");
 }
}
You may have to edit the name of the singleShadingSwitch in the script. I was thinking making a custom input dialog but getting the functionality was difficult enough and I didn't want to delve into the whole GUI aspect.

5) Because this is all about visible connections, you can always tweak the ramp or even tweak the random values for individual objects. To do that, adjust the attribute called Rand VCoord to any value from 0–1. The effects probably won't show up in the viewport, but if you hit render the values should appear.

Here are a couple of examples:
Red to Blue ramp into the color
Fractal noise into the bump channel with shader switch controlling amplitude
 I was particularly concerned about instanced objects working with this and so I tested it on my molecular geometry. The first test only gave two different random values because it was the transform node that was itself instance above the coiled coil level of the hierarchy. So I pulled everything out of the hierarchy (not ideal, but works as a quick last step) which resulted in transform1 transform 2... transform 96 each with an instanced transform as a child. In order to put the random attribute on the proper transform, I just added two lines of code that changed the focus from the child to the parent (those are the two commented lines other than the debug print statements). Then I got the middle image, which is a bit extreme, but it works! So I tweaked my ramp a few times and got the image on the right in no time at all.


You can also use this method to add things other than random variation. Instead of a random value, you could assign the distance to the camera (mapped to 0–1 with setRange) or any other per-object transform info.

Later,
Stuart

Monday, April 28, 2014

Random Molecular Motion

Here are a few visualizations of a random molecular walk and binding event that we showed to some undergraduate science students. They were pretty clever about understanding and interpreting the motion, but it's still difficult to tell whether they are able to translate that to the rest of their understanding of molecular biology. Unfortunately because of the high complexity and speed, the vimeo compression does a poor job of displaying the motion even in HD. Apologies for this. I contacted the vimeo staff and they are not able to push the compression settings as far as I'd like because delivery apparently slows down.

Later,
Stuart