środa, grudnia 24, 2008

Human Adenovirus 2

During the holidays I wanted to try something out that was longer on my mind - remote rendering. At the university I have a pretty plain-desktop machine with Archlinux installed on it. It's not much. Integrated Intel graphic card and 64 bit 2GHz CPU. Nothing unusual, but I was curious how do the limits of the machine look if it comes to render some bigger models. Let's say virus capsids. My previous experiments with my home pc on this field failed on more complicated then ball representations. To say it simply - I run out of memory. It doesn't really matters if it's Linux or Windows, because on a 32 bit machine you have only maximum 4 GB of memory available. On a 64 bit system, however there's theoretically 16 EB of memory available so rendering viruses shouldn't be a problem. I went to VIPERdb and picked the first interesting looking virus I found. It was the Human Adenovirus 2. It's a medium-sized (90–100 nm) virus which is responsible for upper respiratory infections in children. I've downloaded both the half and full size capsid models, uploaded them to the remote machine and extracted the content. After that I went first for some low resource rendering gradually increasing the load of computation needed to be done. Here is how a ball model of the HAd2 capsid with b-factor colouring looks like:
It took about 5 minutes to render. By changing the representation mode from spheres to surface the render time increased to about half an hour. Surface representation also requires significant more memory so I added to the systems 3GB (1GB RAM + 2GB of swapspace) another 8GB by creating a swap file.
# cd /
# dd if=/dev/zero of=swapfile bs=1024 count=8388608
# chmod 600 swapfile
# mkswap swapfile
# swapon swapfile
As it showed up later this still wasn't enough. I've ended up with creating a second swapfile during the rendering and a total of 22 GB memory.
#free -m
             total       used       free     shared    buffers     cached
Mem:           994        843        151          0        118        410
-/+ buffers/cache:        314        680
Swap:        21295          2      21292
This is how a half capsid looks after rendering with surface (also b-factor colouring but this time with a different colour scheme):
And here's the full one with a better surface quality:
It took almost 45h to render and consumed ~19GB of memory. So far it was the longest and most resource consuming rendering I have ever done, but I think there's pretty much room for improvement ];) All the render was done by writing a render script and then run in the background on the remote machine by using the unix nohup command. nohup pymol -c render.py & This is necessary to prevent the application from receiving a hangup signal after logout. The "-c" flag turns pymol to command-mode so it wouldn't use any GUI.
Last but not least here's a small animation of the full capsid.
[Update] I'm starting to hate blogger for what he is doing with the quality of the uploaded movies.

wtorek, grudnia 23, 2008

Building Pymol SVN on Archlinux

Lately I've been neglecting my blog for the sake of my work as a Ph.D. student (programming in Fortran). I'm going to catch up on this. Writing some Fortran code isn't that hard even if you are starting to learn the language from scratch like I do, but definitely it isn't the type of "coding is fun" programming language like Python for example. Speaking of Python, since 3rd of December your python scripts are getting old, because Python 3.0 is out. The new version brings major changes in the language that make you previous HelloWorld.py program stop working (print is now a function and should be called out print("Hello World!") instead of print "Hello World!"). Many programs I use require Python 2.4 or 2.5, some like OpenOffice.org Python 2.6 and soon some will require Python 3.0. Keeping compatibility on a system is getting problematic. Luckily I've installed Archlinux on my desktop at work which makes life easier if you know how to use it. I wanted to install the latest Pymol version from svn, but I've found it's incompatible with Python 2.6 which was required as I mentioned above for OO.o. So here's what I've done.

First I've installed a separate python version from the repositories - Python 2.4 # pacman -Sy python24
After this I needed Pmw for the GUI. It can be done by building from source like this:
# wget http://downloads.sourceforge.net/pmw/Pmw.1.3.2.tar.gz
# tar -xvzf Pmw.1.3.2.tar.gz
# cd Pmw.1.3.2/src
# python2.4 setup.py build
# python2.4 setup.py install
of by using a modified python-pmw PKGBUILD from the AUR. Just make sure it uses python 2.4 by changing in the build function the default python:
build() {
cd $startdir/src/Pmw.$pkgver/src
python setup.py build
python setup.py install --prefix=/usr --root=${startdir}/pkg
}
to python2.4:

build() {
cd $startdir/src/Pmw.$pkgver/src
python2.4 setup.py build
python2.4 setup.py install --prefix=/usr --root=${startdir}/pkg
}

After this you are ready to build pymol from the SVN:
# svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol
# cd pymol
# python2.4 setup.py install
# python2.4 setup2.py install
# cp ./pymol /usr/local/bin/pymol

Thats It!
Now an upgrade of Python to 3.0 will not mess up with your Pymol installation.

piątek, grudnia 19, 2008

Atatakasa1

- Węsołych świąt!

Tymi słowami Diaboł pożegnał się z Śmiertelniczką. Tak szybko jak się zjawił tak szybko też zniknął w mglistej dali. Upojony nie wiadomo czy winem, czy rozmową z bliską osobą maszerował niesiony rytmem melodii2 mając otaczający go świat gdzieś na czubkach swych różek. Nic dziwnego, że nim się obejrzał przemaszerował szmat drogi nie w tym kierunku w którym chciał. Przystanął na chwilę. "Hmm... Ci ludzie są naprawdę dziwni" - pomyślał spoglądając z półmroku w blask mieniących się dekoracji świątecznych. "Stroją, dekorują, kupują, sprzątają, pieką. A wszystko po to by DOBRZE przeżyć święta... A przecież to takie proste - Święta to po prostu osoba obok która sprawia, że czuje się to ciepło w sercu". Jeszcze przez chwilę mżawka moczyła jego kosmatą twarz zanim obrócił się na kopytku i w kilku żwawych podskokach zniknął w jakiejś czarnej jamie.

[1] jap. Atatakasa - wesołość, czułość, ciepło serca.
[2] Autor ma tu na myśli utwór NemesisTheory pt. Don't Give a Damn