Thursday, March 30, 2006

 

High resolution pictures in Pymol 0.99

Hi there, true believers!

Warren DeLano has shared with [ccp4bb] a simple way for creating publication apt images right from the Pymol 0.99 command line, skipping the use of image editing programs such as Gimp, Krita and so. I've found it to be very interesting and entertaining, so I'll reproduce it here:

# for OpenGL images:

draw 1200,900
png image1.png, dpi=300

# for ray-traced images:

ray 1200,900
png image2.png, dpi=300


Hope it's useful for you!

Friday, March 24, 2006

 

Introducing pdbsplit 0.3.1

Hi comrades,

I've finished version 0.3.1 of my handy utility called pdbsplit, which can right now split a single PDB file into several chains, domains, aminoacid groups, etc. You can now choose different ranges of aminoacids to be output, and there switches for ripping headers, ligands, waters, etc.

The download link (Unix sources) is here.

Enjoy!

Monday, March 20, 2006

 

Changing the codec for those incompatible videos in your presentation

The other day I was writing about how to compile some images into a movie, for using in a sexy protein streap-tease show. Well, if your results were not satisfying, maybe it was because you used the wrong codec. Don't misunderstand me, no codec is wrong at all, but let's face that there are ones that don't even meet the naiver compatibility tests (gates media video?).

If you want to change your codec, here's your command (again using ffmpeg):

ffmpeg -i inVideo -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 videoMpeg4.avi


This line forces the avi format (-f avi), uses mpeg-4 as the encoding standard (-vcodec mpeg4), sets a bitrate of 800kbps (-b 800), sizes GOP in 300, so it makes DivX compatible (-g 300), etc. Replace inVideo with your video name, and you're done.

Nice encoding!

Saturday, March 18, 2006

 

Reading a PDB file in C

Attempted to read a PDB file in C? Got frustrated? Hope not, but if so, here's a small key for reading the PDB's ATOM fields:


First and second line represent the positions of the array you have to access to read that field. For example:

char tempString[80];
for(fgets(tempString,80,pdbfile);!(strstr(tempString,"ATOM "));fgets(tempString,80,pdbfile)); //Search for the first ATOM card
x = atof(&tempString[31]); /* Scan the coordinates for the first atom */
y = atof(&tempString[39]);
z = atof(&tempString[47]);

Good luck!

Thursday, March 16, 2006

 

Molecular mass center calculator 1.0.2

Hi again,

this is the first public release (interesting thing: it's version 1.0.2!) of this little piece of code. It's only purpose is to calculate the mass center of:

* Each monomer present in a PDB file.
* The whole protein.
* A list of aminoacids.

It also displays the euclidean distances between every two aminoacids present in the list (if any is given).

Please execute it with no parameters for some examples. Feel free to use, share, modify and give back the changes, since this piece of code is Free Software.

You can download it (Unix sources) here. Any comment/suggestion/shout is welcome.

 

Problems choosing colour in Dino?

Some time ago I faced the problem of choosing some colours for a certain structure in Dino which is indeed a nice visualization program, but it still lacks some sort of interface for managing colours, views or even movement.

So, after searching for any kind of help in the manual, I found the only way to choose a certain colour was to refer it by the name ("is that olive green_3, or is it just emerald green_5?") or by the RGB tag (easy, huh?).

Googling, I found an interesting document featuring a visual representation of every colour, its name and its RGB tag, retrieved it using a web-archive (it had already disappeared by that time), and posted it at the Dino forums.

For your colouring pleasure, you can download it here!

Wednesday, March 15, 2006

 

Teaching model building with 'Coot'

Some weeks ago I was told to teach some biochemistry students *basic* model building concepts. Considering the fact that past year students experimented with O, I thought the best idea was to ask them about their experience with that marvellous piece of Fortran. The impressions: Nearly nobody knew what they were doing. There are several barriers stopping students from reaching to a minimum understanding of O, starting from the "console" concept, which remained unknown to a huge part of this windows-GUI-and-consumer-electronics generation, and the lack of user-friendliness (well, O helps me, so I can consider it my friend).

So, what should I do? With only 1h 30' to teach something useful, my only hope was Coot (Wincoot, to be more precise). So, I translated and adapted to spanish (OpenDocument format for your viewing *and* editing pleasure) Paul's tutorial, and gave it to them. Result? Yup, everybody performed mutations, refined the structure, downloaded and displayed several structures and maps from PDB and EDS, etc.

They found Wincoot to be lacking some minor features, as clearing the tags displayed on screen, but none of them were critical, so I can tell you that the overall results were excellent.

Tuesday, March 14, 2006

 

Finding out which 'glibc' version you are running

Some image processing suites like automar are very dependant on the 'glibc' version present in your system. In the particular case of automar, the licensing system does not even work due to a gethostbyname() call, which is part of 'glibc'. Unfortunately, 'glibc' releases are not backwards compatible.

The software authors are usually aware of that, and provide you with different versions compiled against various 'glibc' versions. To find out which 'glibc' version you are running on a Debian System, type:
dpkg -l | grep libc6
Similarly, on a rpm-based system, you can type:
rpm -q glibc

Friday, March 10, 2006

 

Compiling images into a movie

Want to compile your "supreme quality" snapshots into a single, handy and portable movie file? With 'mencoder' and 'ffmpeg', this is as simple as calling this command:

mencoder mf://*.jpg -mf w=800:h=600:fps=10:type=jpg -ovc lavc -lavcopts vcodec=divx:mbd=2:trell -oac copy -o outputDivx.avi

You can easily change the parameters in bold. For example, if you want to encode a video using several PNG files at 640x480 resolution, and xvid compression, with a framerate of 30 fps, the command should look like this:

mencoder mf://*.png -mf w=640:h=480:fps=30:type=png -ovc lavc -lavcopts vcodec=xvid:mbd=2:trell -oac copy -o outputXvid.avi

Links: Mencoder (part of Mplayer project), Ffmpeg

This page is powered by Blogger. Isn't yours?