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 <Jared.Sampson@nyumc.org>
发送时间:2014年4月29日(星期二) 04:36
收件人:孙业平 <sunyeping@aliyun.com>
抄 送:pymol-users <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 <sunyeping@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 <speleo3@users.sourceforge.net>
发送时间:2013年12月11日(星期三) 12:49
收件人:孙业平 <sunyeping@aliyun.com>
抄 送:pymol-users <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 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 <sunyeping@aliyun.com> 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 <speleo3@users.sourceforge.net>
> 发送时间:2013年12月10日(星期二) 04:50
> 收件人:孙业平 <sunyeping@aliyun.com>
> 抄 送:pymol-users <pymol-users@lists.sourceforge.net>
> 主 题: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 <sunyeping@aliyun.com> wrote:
>
> > Dear all,
> >
> > I want to show amino acids in a structure according to their flexibility (B factor) by gradually changed colors. Can pymol do this? Thanks.
> >
> > Yeping Sun
> >
> > Institute of Microbiology, Chinese Academy of Sciences

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================