My software notes

November 27, 2007

[pymol] example– coloring surface by b-factor

Filed under: pymol/ molmol — kpwu @ 9:16 pm

I want to make a model that represents protein surface with some features and use b-factor column to draw a color gradient. I searched online a while and had steps showing here, also, an picture showing my result.

Steps.

1. download data2bfactor.py (http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/)

2. make a file that have such information:
(res chain AA(capitalized) b-factor) <– skip this line
1 A MET 0.0
2 A GLU 0.1
3 A LYS 0.2
……………………

3. open pymol, load the PDB, and draw some residues in surface

4. import the b-factor into the PDB by typing:
data2b_res ‘selection’, ‘b-factor file’

5. use “spectrum” to draw the color gradient:
spectrum b, yellow_blue,resi 10-130,minimum=0, maximum=1

6. The example is showing here:

the combinations of color gradient provided by pymol are:
blue_green
blue_magenta
blue_red
blue_white_green
blue_white_magenta
blue_white_red
blue_white_yellow
blue_yellow
cbmr
cyan_magenta
cyan_red
cyan_white_magenta
cyan_white_red
cyan_white_yellow
cyan_yellow
gcbmry
green_blue
green_magenta
green_red
green_white_blue
green_white_magenta
green_white_red
green_white_yellow
green_white_red
green_white_yellow
green_yellow
green_yellow_red
magenta_blue
magenta_cyan
magenta_green
magenta_white_blue
magenta_white_cyan
magenta_white_green
magenta_white_yellow
magenta_yellow
rainbow
rainbow2
rainbow2_rev
rainbow_cycle
rainbow_cycle_rev
rainbow_rev
red_blue
red_cyan
red_green
red_white_blue
red_white_cyan
red_white_green
red_white_yellow
red_yellow
red_yellow_green
rmbc
yellow_blue
yellow_cyan
yellow_cyan_white
yellow_green
yellow_magenta
yellow_red
yellow_white_blue
yellow_white_green
yellow_white_magenta
yellow_white_red
yrmbcg

November 20, 2007

[gnuplot] make a multiplot (3 stacked plots)

Filed under: softwares and scripts — kpwu @ 9:57 pm

Here is an example I made to generate a multiple plots by gnuplot. I don’t want that the 3 plots have space in between the x-axis. So the trick thing is: set the margin (r, l, t,b) very smaller,e.g. 0.01. Then the output looks “like” 3 stacked plots. You can modify it by 3 connected plots in a row (left, middle, right).

The plot is shown here:
data.png

The scripts is pasting here:
=========================
set terminal postscript
set output “data.ps”
unset key
NX=1; NY=3
DX=0.01; DY=0.01; SX=0.85; SY=0.25
set bmargin DX; set tmargin DX; set lmargin DY; set rmargin DY
## set the margin of each side of a plot as small as possible
## to connect each plot without space
set size SX*NX+DX*1.5,SY*NY+DY*1.8
set multiplot
##—— First Figure–bottom
set size SX,SY
set xrange [0:140]
set yrange [-0.9:0.9]
set ytic -0.6,0.3,0.6 ### from -0.6 to 0.6 with 0.3 interval
set origin DX,DY;
plot sin(x)
###——Second Figure—middle
set origin DX,DY+SY;
unset xtics
plot sin(x**2)
##——- Third Figure—-top
set origin DX,DY+SY*2
plot cos(x)
unset multiplot

November 14, 2007

making movie of molecular motions by VMD 1.8.5

Filed under: pymol/ molmol — kpwu @ 7:21 pm

I haven’t used VMD for a long time. Instead, I use pyMOL and MOLMOL to make most of the figures for presentation.

This week, I found that VMD  has a very good extension that help you to generate movies quickly as long as your  linux  machine  has  imagemagic or other tools installed. See VMD official site to get more detailed  instruction.
(e.g. http://www.ks.uiuc.edu/Research/vmd/plugins/vmdmovie/)

Here is an example I use protein GB1 to generate a 10 seconds movie. PDB code is 1GB1 which is a NMR ensemble structure with 60  models. This video put in youtube show you how flexible of the  GB1 protein is by looking at the 60 models.

November 2, 2007

NMRView NvJ 8.0a7 now available (solves Leopard arrow key problem)

Filed under: NMRPipe and NMRview — kpwu @ 1:02 pm

Bruce Johnson just released the latest version of NMRViewJ.

— original message in the mailing list—–

Some Leopard users have noted that the Up/Down/Left/Right  keys no
longer work for moving up down planes in 3D/4D spectra.

This is now fixed in nvjinstall8_0_a7.jar

Note this should also fix a  similar problem that users of non-
English localized version operating systems.

For script writers, here is why this broke:

When you setup key bindings you can give a “%K” argument for the
script that will be executed.  For example,

bind Spectrum <Down> “NvNavigate %W %K”

When you click the down arrow key in a window the NvNavigate
procedure will receive two arguments, the name of the window (from
the %W arg) and the text associated with the key you pressed.  In
previous Mac versions (and other operating systems) pressing the Down
key would send the string “Down”.  In Mac OS 10.5, this key now sends
the Unicode character that corresponds to a down arrow (and similarly
for Up, Left and Right).  In the NvNavigate code, I explicitly test
what key has been pressed by looking for the text Up, Down, Left or
Right.  This test now fails because the argument is the unicode
character (not the corresponding words).

I’ve fixed this by changing the bindings to:

bind Spectrum <Down> “NvNavigate %W Down”

This should also fix the problem if you’re using, for example, a
French localized operating system.

I haven’t had much time to look for other Leopard problems.  The only
other thing I’ve noticed is that by default the Middle Mouse button
is set to activate Dashboard.  You can turn this off in the Expose/
Spaces system preferences dialog.

cheers,

Bruce

Create a free website or blog at WordPress.com.