Plotting Species Distribution Of Proteins
3
3
Entering edit mode
11.7 years ago
Pappu ★ 2.1k

I am wondering how to make figure like this showing distribution of a few proteins among various species: http://jcs.biologists.org/content/123/9/1407/F1.expansion.html Any suggestions are welcome. Thanks a lot.

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

python • 3.2k views
ADD COMMENT
10
Entering edit mode
11.5 years ago
jhc ★ 3.0k

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[node.name]):
            if value == 1:
                add_face_to_node(positiveFace, node, col, position="aligned")
            else:
                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)

t.show(tree_style=ts)

tree profile example

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
6
Entering edit mode
11.5 years ago
Joseph Hughes ★ 3.0k

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 COMMENT
2
Entering edit mode
11.5 years ago
Abhiman ▴ 130

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 http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3396428/figure/F3/

ADD COMMENT

Login before adding your answer.

Traffic: 2072 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6