Alexander, * alexander.paut...@bc.boehringer-ingelheim.com wrote: > > > > I would like to color my protein according to B-factor with a self-defined > > spectral palette (In this case I have put sequence conservation into the > > Bfactor this column). I found that > > spectrum b, blue_white_red, minimum=0, maximum=100 > > would do part of the job with a predefined pallette > > > > - I could not find out how to define my own new color palette like > > "white_red". > > - Is there a way to "visualize" the color palettes before applying it to > > an object? > >
* Seth Harris <set...@gmail.com> [2005-12-31 09:54] wrote: > This is more half an answer than the real deal, but when I had the same > issue I opted for the quick work around of setting the range from -100 to > 100 for the blue-white-red palette which effectively made 0-100 correspond > to white to red only since there were no negative B factors/conservation > scores. > e.g. > spectrum b, blue_white_red, minimum=-100, maximum=100 > > I am curious for better answers, as you are, but haven't delved into the > code to look for it myself, either. But perhaps this or some fine tuning of > the range or other pre-defined palettes will get done what you desire. I have a script, color_b.py, available on my website that allows one to colour based on the value of the B-factor or occupancy columns. It currently has the following colour gradients: 'bgr': blue -> green -> red 'rgb': red -> green -> blue 'bwr': blue -> white -> red 'rwb': red -> white -> blue 'bmr': blue -> magenta -> red 'rmb': red -> magenta -> blue 'rw' : red -> white 'wr' : white -> red 'gw' : green -> white 'wg' : white -> green 'bw' : blue -> white 'wb' : white -> blue 'gy' : green -> yellow 'yg' : yellow -> green 'gray' : black -> white 'reversegray' : white -> black It isn't too difficult to add more gradients by following the recipes in the "make_gradient" function in that script. It is also possible to set the minimum and maximum values to tune the exact gradient limits as well as to set the saturation and brightness (value) of the colours, via the command options. Hope this helps. Cheers, Rob -- Robert L. Campbell, Ph.D. <r...@post.queensu.ca> Senior Research Associate phone: 613-533-6821 Dept. of Biochemistry, Queen's University, fax: 613-533-2497 Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2