[Chimera-users] [chimera-dev] writing in b-factor field

Elaine Meng meng at cgl.ucsf.edu
Mon Dec 30 12:38:04 PST 2013

On Dec 29, 2013, at 8:43 AM, MARIA VITTORIA CUBELLIS <cubellis at unina.it> wrote:

> Dear sir/madam,
> I have a file that  associates to each amino acid of a protein A a given value v.
> I would like to transfer this value to the b-factor field of the protein A the value v. I have a single value for each aminoacid N1,N2... I would like to transfer the value to each atom
> let say
> N1 C  v1
> N1 CO v1
> N1 N  v1
> ....
> ....
> N2 C v2
> N2 CO v2
> N2 N  v2
> and so on
> is it possible to this withe chimera?
> thank you
> mvcubellis

Dear  M V Cubellis,
Yes, you can do it, but another question is why do you want to do it?  I'm guessing you want to color by those values.  In Chimera you can assign the values to the atoms or residues directly as "attributes" and then do coloring to show those values.  The B-factor from an input file is one atom attribute named bfactor, but you can create additional attributes with whatever names you wish, and color by any of them.

The main work for you is to create an "attribute assignment file" which is mostly tab-separated columns with the atom (or residue) specifiers and values.  The necessary format is described here, and there are also some example files:

Probably the trickiest part is how to specify the residues in the file, e.g. could be something like :12.a for residue 12 in chain A.  See instructions on atom/residue specification:

Once you have created that text file, you can read it in with Define Attribute (in menu under Tools… Structure Analysis) or command defattr.

Then Render by Attribute (which may automatically appear when you create the attribute, but also is in menu under Tools… Structure Analysis) can be used to show the values with colors and/or radii:

If you really wanted to write a PDB file with values in the B-factor column, you would still need to create an attribute assignment file as described above, but more specifically to assign an atom attribute named bfactor.  Then when you use the File menu or write command to output a PDB file, your values will be in the B-factor column.  

See also the Attributes tutorial for examples of coloring by attribute value.

I hope this helps,
Elaine C. Meng, Ph.D. 
UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
Department of Pharmaceutical Chemistry
University of California, San Francisco

More information about the Chimera-users mailing list