This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plotting Species Distribution Of Proteins

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 answers

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

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

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.

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/

Log in to answer this question.