Re: [PyMOL] RE: gradually changed colors with b-factor colum

2014-04-29 Thread Sampson, Jared
Hi Yeping -

It doesn’t look like Spectrumbar supports additional labeling, but you could 
add labels at each end by using pseudoatoms at the positions where you want the 
labels to appear (see the second example at 
http://pymolwiki.org/index.php/Pseudoatom).

For the 2D gradient box, you can create whatever intermediate labels you like, 
just keep the same scale.  For example, if your bar covers data values from 
-0.3 to +2.3 and you make it 260 pixels wide, then each 10px accounts for 0.1 
unit.  So “0.0” will be 30px from the left side, “+0.5” will be at 80px, and so 
forth.  After you create it at that scale, you can resize it as you wish and 
the relative positions will remain the same.

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Xiangpeng Kong Lab
NYU Langone Medical Center
http://kong.med.nyu.edu/






On Apr 28, 2014, at 10:20 PM, sunyeping 
mailto:sunyep...@aliyun.com>> wrote:

Dear Jared,

Thank you for the reply. But I still have a couple of questions:

 As for the spectrumbar script, 
how could I assign a particular data value to a particular color?  By using the 
command:

spectrumbar blue, white, red

I can get a spectrumbar. If the range of my data is -0.3~2.3, maybe I can label 
two end of the bar with -0.3 and 2.3 manually, respectively. But if I want to 
label more data to the bar? How shold I do?

  As you suggest, I can simplely get a 2D box with a linear gradient fill. 
But the question is the same with above: how could I correctly label the bar 
according my data set?

Best regards,


Yeping

--
发件人:Sampson, Jared mailto:jared.samp...@nyumc.org>>
发送时间:2014年4月29日(星期二) 04:36
收件人:孙业平 mailto:sunyep...@aliyun.com>>
抄 送:pymol-users 
mailto:pymol-users@lists.sourceforge.net>>
主 题:Re: [PyMOL] gradually changed colors with b-factor colum

Hi Yeping -

I was about to suggest Sean Law’s new 
spectrumbar script, but I see he 
beat me to it.  You’ll have to adjust the positioning of the bar with some 
trial and error.  Also, in case you get a “NameError: global name 're' is not 
defined” error, simply change the 4th line from:

from re import *

to

import re

I’ve just submitted a pull 
request with this 
fix, but if you download the script before it’s accepted, you'll have to make 
the change yourself.

Alternatively, you could fairly easily create a simple 2D box with a gradient 
fill in e.g. Inkscape or Illustrator with the appropriate colors and add the 
labels manually.  So long as you specify a linear gradient, it should be fairly 
consistent with the PyMOL values.

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Xiangpeng Kong Lab
NYU Langone Medical Center
http://kong.med.nyu.edu/


On Apr 27, 2014, at 8:50 AM, sunyeping 
mailto:sunyep...@aliyun.com>> wrote:

Dear proessor Holder and pymol users,

I previously tried to color a protein structure accord to a set of customer 
data. I replaced the b factor of individual Ca atoms and colored the structure 
with the command:

spectrum b, blue_white_red, byres=1

But I think I need a color scale bar to show the range of the data set. 
According to PymolWiki 
(http://www.pymolwiki.org/index.php/Advanced_Coloring#Creating_a_Color_bar), 
this can be done with the following steps:

  1.  Create a pdb-file which contains CA positions only, whereas the numbers 
correspond to your wanted increments of colors. Make CA's to be separated by 5 
Angstroem.
  2.  Load this new pseudobar-pdb file into PyMOL, make bonds between increment 
1 and increment 2 [increment 2 and increment 3 and so on...], define/assign a 
smooth color for each increment (copy colors definition from automatically 
created colors made by b-factor script) and show the b-factor bar as lines (or 
sticks).

Could you tell me how to assign blue_white_red color for these increment? And 
if the range of my data set is -0.8 to 2.3, how to make the color gradient 
reflect this range? Thank you very much.




Yeping Sun

Institute of Microbiology, Chinese Academy of Sciences

--
发件人:Thomas Holder 
mailto:spel...@users.sourceforge.net>>
发送时间:2013年12月11日(星期三) 12:49
收件人:孙业平 mailto:sunyep...@aliyun.com>>
抄 送:pymol-users 
mailto:pymol-users@lists.sourceforge.net>>
主 题:Re: [PyMOL] 答复: gradually changed colors with flexibility

Hi Yeping,

the spectrum command has a "byres" argument to operate on the residue level:

PyMOL>spectrum b, blue_white_red, byres=1

There is no white_blue color ramp, but there is a script which provides this:
http://pymolwiki.org/index.php/Spectrumany
It doesn't have the byres argument. If you only show cartoon, just limit the 
selection to CA atoms:

PyMOL>run path/to/spectrumany.py
PyMOL>spectrumany b, white blue, name CA

If you want to show all atoms, you can map the CA atom

[PyMOL] RE: gradually changed colors with b-factor colum

2014-04-28 Thread sunyeping
Dear Jared,Thank you for the reply. But I still have a couple of questions:
     As for the spectrumbar script, how could I assign a particular data value 
to a particular color?  By using the command:spectrumbar blue, white, redI can 
get a spectrumbar. If the range of my data is -0.3~2.3, maybe I can label two 
end of the bar with -0.3 and 2.3 manually, respectively. But if I want to label 
more data to the bar? How shold I do?
      As you suggest, I can simplely get a 2D box with a linear gradient fill. 
But the question is the same with above: how could I correctly label the bar 
according my data set?Best regards,
Yeping--
发件人:Sampson, Jared 
发送时间:2014年4月29日(星期二) 04:36
收件人:孙业平 
抄 送:pymol-users 
主 题:Re: [PyMOL] gradually changed colors with b-factor colum






Hi Yeping - 



I was about to suggest Sean Law’s new spectrumbar script, but I see he beat me 
to it.  You’ll have to adjust the positioning of the bar with some trial and 
error.  Also, in case you get a “NameError:
 global name 're' is not defined” error, simply change the 4th line from:



    from re import *



to 



    import re



I’ve just submitted a pull request with this fix, but if you download the 
script before it’s accepted, you'll have to make the change yourself.



Alternatively, you could fairly easily create a simple 2D box with a gradient 
fill in e.g. Inkscape or Illustrator with the appropriate colors and add the 
labels manually.  So long as you specify a linear gradient, it should be fairly 
consistent with the
 PyMOL values.



Hope that helps. 



Cheers,
Jared


--

Jared Sampson

Xiangpeng Kong Lab

NYU Langone Medical Center

http://kong.med.nyu.edu/







On Apr 27, 2014, at 8:50 AM, sunyeping  wrote:




Dear proessor Holder and pymol users,





I previously tried to color a protein structure accord to a set of customer 
data. I replaced the b factor of individual Ca atoms and colored the structure 
with the command:





spectrum b, blue_white_red, byres=1 







But I think I need a color scale bar to show the range of the data set. 
According to PymolWiki 
(http://www.pymolwiki.org/index.php/Advanced_Coloring#Creating_a_Color_bar),
 this can be done with the following steps:


Create a pdb-file which contains CA positions only, whereas the numbers 
correspond to your wanted increments of colors. Make CA's to be separated by 5 
Angstroem.Load this new pseudobar-pdb file into PyMOL, make bonds between 
increment 1 and increment 2 [increment 2 and increment 3 and so on...], 
define/assign a smooth color for each increment (copy colors definition from 
automatically
 created colors made by b-factor script) and show the b-factor bar as lines (or 
sticks).



Could you tell me how to assign blue_white_red color for these increment? And 
if the range of my data set is -0.8 to 2.3, how to make the color gradient 
reflect this range? Thank you very much.   











Yeping Sun
Institute of Microbiology, Chinese Academy of Sciences




--

发件人:Thomas Holder 

发送时间:2013年12月11日(星期三) 12:49

收件人:孙业平 

抄 送:pymol-users 

主 题:Re: [PyMOL] 答复: gradually changed colors with flexibility




Hi Yeping,



the spectrum command has a "byres" argument to operate on the residue level:



PyMOL>spectrum b, blue_white_red, byres=1



There is no white_blue color ramp, but there is a script which provides this:

http://pymolwiki.org/index.php/Spectrumany

It doesn't have the byres argument. If you only show cartoon, just limit the 
selection to CA atoms:



PyMOL>run path/to/spectrumany.py

PyMOL>spectrumany b, white blue, name CA



If you want to show all atoms, you can map the CA atom b-factor to all residue 
atoms with this script:

http://pymolwiki.org/index.php/AlphaToAll



Hope that helps.



Cheers,

Thomas



On 10 Dec 2013, at 01:04, sunyeping  wrote:



> Hi, professor Holder,

> 

> Thank you for the reply, but how can I do this on the level of individual 
> amino acids in stead of atom? I have two homolog stuctures and I want to map 
> the difference between the b factors of the corresonding residues of these 
> two stuctures rather than individual
 atoms. And I want to use gradually deepened color from white to blue. Could 
you explain more in detail? Thanks.


> 

> Yeping Sun

> 

> Institute of Microbiology, Chinese Academy of Sciences

> 

> 

> --

> 发件人:Thomas Holder 

> 发送时间:2013年12月10日(星期二) 04:50

> 收件人:孙业平 

> 抄 送:pymol-users 

> 主 题:Re: [PyMOL] gradually changed colors with flexibility

> 

> Hi Yeping,

> 

> use the spectrum command:

> 

> PyMOL> spectrum b, blue_white_red

> 

> http://pymolwiki.org/index.php/Spectrum

> 

> Cheers,

> Thomas

> 

> On 09 Dec 2013, at 11:30, sunyeping  wrote:

> 

> > Dear all,

> > 

> > I want to show amino acids in a structure according to their flexibility (B 
> > factor) by g