My software notes

March 14, 2007

color by b-factor values

Filed under: pymol/ molmol — kpwu @ 6:51 pm

Usually, people have to draw the protein structure according to folding, titration or relaxation experiments; especially for NMR people. PyMOL supports this function by using less “used” b-factor column of the PDB file. Robert Campbell has a color_b.py python script on his PyMOL homepage that you can use.

However, I am showing another way to color the structure without using any scripts. I found it from PyMOLWIKI (http://www.pymolwiki.org/index.php/Color#Reassigning_B-Factors_and_Coloring)

The steps are copied to this blog and the example I made is also showing here. I use 1XQ8.pdb to show it’s hydrophobicity (by Kyte-Doolittle’s method).
1xq8-b-factor.png

The updated B-factors can be saved by saving a new molecule.
The hydrophobicities were saved for CA b-factors, here is the example:
cat 1XQ8.pdb |grep CA
ATOM      2  CA  MET A   1     250.631  34.877   0.809  1.00  0.67           C
ATOM     21  CA  ASP A   2     246.860  35.394   1.143  1.00  0.02           C
ATOM     33  CA  VAL A   3     246.085  36.822  -2.313  1.00  0.61           C
ATOM     49  CA  PHE A   4     243.374  38.718  -0.399  1.00 -0.29           C
ATOM     69  CA  MET A   5     245.745  40.728   1.827  1.00 -0.99           C
ATOM     86  CA  LYS A   6     247.572  41.993  -1.282  1.00 -1.24           C
ATOM    108  CA  GLY A   7     244.331  43.152  -2.944  1.00 -0.34           C
ATOM    115  CA  LEU A   8     243.551  44.864   0.384  1.00  0.17           C
ATOM    134  CA  SER A   9     246.922  46.620   0.797  1.00 -0.06           C
ATOM    145  CA  LYS A  10     246.614  47.601  -2.883  1.00  0.23           C
ATOM    167  CA  ALA A  11     243.302  49.441  -2.385  1.00  0.87           C
ATOM    177  CA  LYS A  12     244.578  51.340   0.678  1.00  0.28           C
----------------------------
# load the protein
cmd.load("protA.pdb")

# open the file of new values (just 1 column of numbers, one for each alpha carbon)
inFile = open("newBFactors", 'r')

# create the global, stored array
stored.newB = []

# read the new B factors from file
for line in inFile.readlines(): stored.newB.append( float(line) )

# close the input file
inFile.close()

# clear out the old B Factors
alter protA, b=0.0

# update the B Factors with new properties
alter protA and n. CA, b=stored.newB.pop(0)

# color the protein based on the new B Factors of the alpha carbons
cmd.spectrum("b", "protA and n. CA")

predict random coil relaxation (R2) values

Filed under: softwares and scripts — kpwu @ 6:24 pm

Recently, I’ve made a shell script that can generate a gaussian distribution-like random coil relaxation R2 values. The result is shown in the following figure. The script is kind of dirty hack, so I won’t paste the code at here. I’ll post it later when I have time to organize the code and make it more user-friendly.

Reference:

  1.  Protein Sci. 2006 Jun;15(6):1397-407.
  2. J Biomol NMR. 2006 Jul;35(3):175-86.
  3. Science. 2002 Mar 1;295(5560):1719-22.
  4. Biochemistry. 1997 Jul 22;36(29):8977-91. (Original paper)

rc-r21.png

NMRViewJ 7.0.10 is out!

Filed under: NMRPipe and NMRview — kpwu @ 6:15 pm

Copy news from NMRViewJ mailing list:
Enjoy using it ^_^
——-
As previously mentioned, I’ve been working almost entirely on moving
NvJ to support BMRB STAR version 3 so as to have better support in
NvJ for features like RunAbout.  I’m nearly, but not quite, done with
the transition.  While working on this I have fixed a few bugs so I
thought I would provide a release now.

I think I’ve got everything in this version to start moving ahead
with RunAbout with the STAR3 code, but I’ve got some testing to do
before I’d say it’s really ready.  I expect to do some testing over
the next few days and have another version available by Monday.  I’ve
got a personal deadline to have a new version of the video on using
RunAbout to assign Ubiquitin ready by then so I’ll be working hard on
it.

There is one more pernicious bug that occasionally manifests itself
with the error that some command, which you know exists, doesn’t
exist.  I think I know the cause of this and hope to stomp it before
Monday as well.

I’ve also done some updating of the One Moon Web site.  The NvJ
section of the home page now lists the latest version of NvJ so you
can tell at a glance if you’re running the latest.  More improvements
are on their way.

Listed below are the changes in this version.

Bruce

* Many changes to allow compatability with the new BMRB STAR format
(version 3.x)
NvJ will still read and write STAR 2 files.  New STAR3 code has
not been made
available in menu form yet as it is still a work in progress.

* When vectors are extracted and displayed any existing phase in the
Vector display window is
applied to them (thanks to Mike Summers).

* A residue library with residues using the IUPAC naming convention
is now in reslib_iu.
This is not yet used automatically, but you could copy it over to
reslib to use it.

* Peaks are now folded to display properly if their chemical shift is
outside the range of the
displayed spectrum.  (This doesn’t permanently change their
chemical shifts, just displays
them properly.

* A new “nv_win wait” command has been added.  Sometimes you want to
ensure that a window has
been completely drawn before doing something else in the script.
“nv_win wait” will not return
until drawing is complete.

* Bug in crosshair display is fixed.  Sometimes the black crosshair
would be displayed but was
not selectable.

* nvj batchfile now will take a command line arguments to specify
files  to be loaded during startup.
Files will be loaded in a manner consistent with their extension
(.nv, .str, .tcl).
Filenames should appear after –files on the command line:
./nvj –files mystarfile.str hsqc.nv hnco.nv startup.tcl

* Sequence display code changes so that if a residue is not standard
then draw an X for the single letter code

Blog at WordPress.com.