changing the colorscheme for ProfileFace heatmap

231 views
Skip to first unread message

Marco

unread,
Sep 1, 2011, 6:01:36 PM9/1/11
to eteto...@googlegroups.com
Hi everybody,
This is a really cool package, thanks for providing it!

I am trying to add a heatmap ProfileFace to a tree. I modified the code given in the ETE examples for this purpose and it seems to work fine. But now I would like to change the colors of the heatmap (currently it is blue to red and I look for the classical microarray green to black to red). The reference library states:
class ProfileFace(max_v, min_v, center_v, width=200, height=40, style='lines', colorscheme=2)

So I tried to give the colorscheme a different number, but nothing changes. Can anybody tell me what colorscheme number I have to use for green to black to red and how to apply the change?


Thanks a lot,
                                               Marco

 

Jaime Huerta Cepas

unread,
Sep 2, 2011, 5:23:17 AM9/2/11
to eteto...@googlegroups.com
Hello Marco, 

thanks for your support!

there are currently 3 colorschemes implemented: 
0=green and blue
1=green and red
2=red and blue (default)
In all the three cases, missing values are rendered in black and transition color (value = center) is white. 

Did you try any of the above values for the "colorscheme" argument with no success?
If so, please let me know your ETE version and, if possible, a little piece of code to reproduce the problem. I just tested it with some examples and everything seems to response correctly. 

P.S. I have just noticed that the "colorscheme" argument was not documented, so I have added some info to the new doc-site: http://packages.python.org/ete2/reference/reference_treeview.html#node-faces

Jaime

Marco

unread,
Sep 6, 2011, 2:19:39 PM9/6/11
to The ETE toolkit
Dear Jaime,
Thanks a lot. Now it works. I simply tried any other number (since
there was no documentation) and did not hit any valid value
apparently :-)
Is there a chance to implement a custom color scheme? The green is
pretty light for my purposes (I would like to publish these and the
reviewers should recognize this as expression data right away so you
are reminded of the classic representation of microarray data).

All the best,

Marco


On Sep 2, 5:23 am, Jaime Huerta Cepas <jhue...@crg.es> wrote:
> Hello Marco,
>
> thanks for your support!
>
> there are currently 3 colorschemes implemented:
> 0=green and blue
> 1=green and red
> 2=red and blue (default)
> In all the three cases, missing values are rendered in black and transition
> color (value = center) is white.
>
> Did you try any of the above values for the "colorscheme" argument with no
> success?
> If so, please let me know your ETE version and, if possible, a little piece
> of code to reproduce the problem. I just tested it with some examples and
> everything seems to response correctly.
>
> P.S. I have just noticed that the "colorscheme" argument was not documented,
> so I have added some info to the new doc-site:http://packages.python.org/ete2/reference/reference_treeview.html#nod...
>
> Jaime
>
>
>
>
>
>
>
> On Fri, Sep 2, 2011 at 12:01 AM, Marco <marco.he...@gmx.de> wrote:
> > Hi everybody,
> > This is a really cool package, thanks for providing it!
>
> > I am trying to add a heatmap ProfileFace to a tree. I modified the code
> > given in the ETE examples for this purpose and it seems to work fine. But
> > now I would like to change the colors of the heatmap (currently it is blue
> > to red and I look for the classical microarray green to black to red). The
> > reference library states:
> > *class *ProfileFace(*max_v*, *min_v*, *center_v*, *width=200*, *height=40*,
> > *style='lines'*, *colorscheme=2*)

Jaime Huerta Cepas

unread,
Sep 6, 2011, 6:46:42 PM9/6/11
to eteto...@googlegroups.com
Marco,

Color schemes are hard coded, so there is no simple way to change them... Unless you get into the ProfileFace source code.
I have written a small hack to bypass the problem (attached) and improve ProfileFace customization. Please try it and let me know how it goes.

best,
Jaime
profile_color_schemes.py

lel7...@gmail.com

unread,
Oct 20, 2014, 8:47:15 PM10/20/14
to eteto...@googlegroups.com, jhu...@crg.es
Hi Jaime,

i know this is an old post but thought Id see how i go with a reply. I've managed to get this add on to change the heatmap points. Thanks very much. Does this script also change the default black for missing values to a different colour?

Thanks again,
Lesley

Luiz Thiberio Rangel

unread,
Nov 2, 2015, 6:15:59 PM11/2/15
to The ETE toolkit
Sup, guys,

I don't know if it will be usefull for someone else, but I wrote a small function to be able to use matplotlib colorschemes.
The argument <colorscheme> should receive the name of a matplotlib colormap (cmap) instead of a number.


see ya,

Jaime Huerta Cepas

unread,
Nov 3, 2015, 12:52:32 AM11/3/15
to eteto...@googlegroups.com
sure is useful! thank you

--
You received this message because you are subscribed to the Google Groups "The ETE toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etetoolkit+...@googlegroups.com.
To post to this group, send email to eteto...@googlegroups.com.
Visit this group at http://groups.google.com/group/etetoolkit.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages