Thursday, April 11, 2013

Speeding up R

I've been programming in R for a while now. Whenever I've had performance problems, it almost always is due to data.frame usage. To check what's slowing down your R code, just use the Rprof command like so:

Friday, April 5, 2013

Changing Image Size in Tachyon in VMD

I always forget how to change the image size for rending molecular images in VMD using the (external) Tachyon rendering engine, so I thought I'd write down the steps here:

In the TCL console, get the aspect ratio correct for the image. So, for example to make a nice 1920x1080 image, we'll make the view at half of that:

 
display resize 960 540

Now, add simply add -res 1920 1080 to the end of the render command in the file render controls window. Here's an example of one of my render commands:
 
"$HOME/VMD/tachyon_LINUXAMD64" -aasamples 12 %s -format TARGA -o %s.tga  -res 1920 1080

Here's the result of one my renders:

Wednesday, April 3, 2013

Making nanoparticles in Blender

Today I made some nanoparticles in Blender. I used the node compositor to create the fluorophore effect. Making science in Blender is fun!


Saturday, March 23, 2013

Making Proteins and Polymer in Blender

I was messing around in Blender and decided to create some artwork related to a recent paper published in my current research group. The idea is to create a two layers of polymer. One layer is to make a biosensor resistant to noise from non-target molecules adsorbing on the sensor surface. A second longer layer of polymer is used to attach anti-body to the sensor. The anti-body allows the sensor to target very specific molecules. Here's the image I made using Blender's cycles render engine:


Wednesday, March 20, 2013

CDK QSARs of Peptides

I was doing some working in CDK and was pleasantly surprised at how easy it is to calculate descriptors on short peptides. The code to do this is actually only three lines! Adding in a bug fix though, it becomes four. Here's the code to calculate every QSAR descriptor on a peptide


Monday, March 11, 2013

Reading Command Line args in R

I'm writing this down in my blog because I keep forgetting my standard way for adding command line arguments to R. I like to use executable R scripts that don't require --vanilla --args etc. The syntax in the R script is:

Thursday, February 28, 2013

Markov Chains in JS — Part 1

I'm in the process of writing a new post or two on working with Markov Chains in javascrtipt. I created the javascript files already and I've decided to post them below for now. I'll write up more about it and hopefully use the code for something interesting in a future post. See below for the javascript Markov Chain Simulator! See the code here.