Archive for the ‘howto’ Category

More testing with VMD and Tachyon

Tuesday, May 6th, 2008

I’m still testing out some of the advanced features of using Tachyon to render nice images of biological macromolecules. I came across these beautiful images of bacteria which are able to consume radioactive waste, and decided to tinker a bit to see if I could get something similar out of VMD.

First of all I loaded in my molecule and set it up similar to the exercises from the other day: white background, surface representation, diffuse material. I also added the Depth Cue feature of VMD, which adds a fog which increases in density with depth. This helps to add a bit of a 3D feel to the representation. I also played around with the various lights, settling on having lights 0 & 2 on.
I rendered the image with:

"/usr/local/lib/vmd/tachyon_LINUX" -aasamples 4 -rescale_lights 0.3 -add_skylight 0.9 %s -format TARGA -o %s.tga

Note: this takes about 8 minutes to render on my laptop at about 700×700 resolution.
If my understanding is correct, this should give a scene that is dominated a fair bit by the skylight parameter, and this is more or less the case. The image, while interesting in some ways, is far too bright!
Let’s drop the skylight down then:

"/usr/local/lib/vmd/tachyon_LINUX" -aasamples 4 -rescale_lights 0.3 -add_skylight 0.6 %s -format TARGA -o %s.tga

Well that darkened the shadows a bit, but the overall image is still way too bright. How about dropping the lights?

"/usr/local/lib/vmd/tachyon_LINUX" -aasamples 4 -rescale_lights 0.1 -add_skylight 0.6 %s -format TARGA -o %s.tga

Well, still far too light. What’s happening is that the depth cue fades the image to the background color (in this case white) as it goes. Let’s drop the depth cue density in order to cut back on the lightening. This setting is found in Display–>Display Settings. I adjusted it to a value of 0.15, still using the Exp2 function for the density. When I rendered this (using the same settings as the last one above, it looked OK, but not fantastic. Mostly it was just “flat”, if that makes sense - not a lot of visual appeal. I rescaled the lights back up to 0.3, and this was better.

Something still isn’t “there”, though. To be sure, the tachyon renders look nice, but I just don’t feel like this is the best that can be done. I’ll have to keep toying with it.

Hold the phone here, Tachyon looks pretty nice

Wednesday, April 30th, 2008

In the last post, I went over some of the POV-Ray basics. The toughest part of actually using POV-Ray to render figures of proteins is importing the structure into the rendering package - the complex geometry of the macromolecule has to be translated to the system of simple objects understood by POV-Ray.

As I was looking into some software packages that can output .pov files, I came across another raytracing program called Tachyon which is included (sort of) in the latest version of VMD.  The example images made using the ambient occlusion lighting capability of Tachyon made my jaw hit the floor.  Instead of babbling on about ways to get POV-Ray to play nice, I’ll go over how to get and use VMD/Tachyon.
(more…)

Weekend Liveblog: Switching my home computer from Windows XP to Ubuntu

Saturday, April 19th, 2008

I’ve been using Ubuntu as my operating system at work for about 2 years now. I really love it. I’ve tinkered with making it the OS on my home computer, but since I do a bit of gaming I keep putting it off (as gaming support in Linux tends to lag behind Windows a bit).

I’ve been getting more and more fed up with Windows lately, however, so I’ve decided to give Linux another go. I’ll be liveblogging the changeover for you below.

(more…)

Some Python code for you to ridicule

Tuesday, April 1st, 2008

Mrs. PA is also working on her thesis, and she came to me with what sounded like a simple programming problem.  She has a lot of gels from different samples, with many bands in each sample’s lane.  What she wants to do is: given the sizes of the bands, place them into bins of a range of sizes.  There are so many samples and so many bins that this is very tedious to do by hand.

I thought that this would be no problem at all and sat down to work.  I decided right away that I’d use Python to do the chore, since I worked with it for my own project a while back and remembered that it was pretty good at this sort of thing.  Well, after a lot of cursing and tracebacks, I’ve managed to hack together something that works.

(more…)

Setting up a static front page/latest posts blog page

Sunday, March 2nd, 2008

There are instructions for doing this on the web, but for some reason it took me just a bit of tweaking to get them to work in Wordpress 2.3.3.

First create a new page (in my case I called it “Home”) and include the static content. For this site it’s the welcome message you see on the front page.

Next create an empty page (I called it “Blog”)

Now go to Options–>Reading and make it look like this:

Static Page

Now, http://yoursite.com/ will link to the static page, and http://yoursite.com/blog/ will go to the latest posts.