Question: Plotting Species Distribution Of Proteins
gravatar for Pappu
7.2 years ago by
Pappu1.9k wrote:

I am wondering how to make figure like this showing distribution of a few proteins among various species: Any suggestions are welcome. Thanks a lot.

I figured out how to do it using MEGAN which has a GUI.

python • 2.3k views
ADD COMMENTlink modified 6.1 years ago by Biostar ♦♦ 20 • written 7.2 years ago by Pappu1.9k
gravatar for jhc
7.0 years ago by
jhc2.8k wrote:

Just to complete Joseph's answer, this would be a basic example on how to do it with ETE.

from ete2 import (Tree, TreeStyle, add_face_to_node, ImgFace,
                  AttrFace, TextFace)

def tree_profile_layout(node):
    if node.is_leaf():
        add_face_to_node(AttrFace("name", fsize=20), node, 0, position="branch-right")
        for col, value in enumerate(name2profile[]):
            if value == 1:
                add_face_to_node(positiveFace, node, col, position="aligned")
                add_face_to_node(negativeFace, node, col, position="aligned")

 # lets use some random tree and data                
name2profile = {
    "a": [1, 0, 1, 0, 1, 1, 1],
    "b": [1, 0, 1, 0, 1, 0, 0],
    "c": [1, 1, 1, 0, 0, 0, 0],
    "d": [1, 0, 0, 0, 1, 0, 0],
table_header = ['col1', 'col2', 'col3', 'col4', 'col5', 'col6', 'col7']
t = Tree("((a,b), (c, d)):0;")

 # load images used for table visualization
positiveFace = ImgFace("positive.png")
negativeFace = ImgFace("negative.png")

 # configure basic tree drawing style 
ts = TreeStyle()
ts.show_leaf_name = False # we handle this in the layout function
ts.layout_fn = tree_profile_layout

 # set up table header. Text rotation is not available yet
for col, label in enumerate(table_header):
    labelFace = TextFace(label, fsize=20, fgcolor="steelblue")
    ts.aligned_header.add_face(labelFace, col)

tree profile example

ADD COMMENTlink written 7.0 years ago by jhc2.8k

I love E.T.E. This is beautiful!

ADD REPLYlink written 7.0 years ago by Joseph Hughes2.8k
gravatar for Joseph Hughes
7.0 years ago by
Joseph Hughes2.8k
Scotland, UK
Joseph Hughes2.8k wrote:

If you are confortable with python, I would recommend E.T.E.. You can draw trees many different ways and with different labels for the leaves and the nodes.

ADD COMMENTlink written 7.0 years ago by Joseph Hughes2.8k
gravatar for Abhiman
7.0 years ago by
Hyderabad, INDIA
Abhiman130 wrote:

I guess this figure was made with a drawing program like Inkscape or Adobe illustrator. The left-side is a species tree of a few selected species and I would guess that it is a composite or consensus from several gene trees or species trees published for a subset of species. The right-side is a heatmap like matrix, showing the presence/absence of certain proteins/genes in each organism. We produced a similar diagram using Inkscape here

ADD COMMENTlink written 7.0 years ago by Abhiman130
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1120 users visited in the last hour