Question: How to plot a dendrogram with images of RNAstructure at the leaves/tips?
0
gravatar for Michael Dondrup
2.2 years ago by
Bergen, Norway
Michael Dondrup46k wrote:

Background: we are clustering some (~500) ncRNAs based on their secondary structure. 2D structure is computed by RNAfold. Then, we compute a distance matrix of RNA structures by RNAdist and cluster it in R using hclust. We would like to plot the dendrogram in a way where the MFE secondary structures generated as .ps files by RNAfold are plotted as small icons at the tips of the dendrogram, to get a visual impression of the similarity of the various shapes. To my surprise, we were unable to find out how to achieve this in R/ggplot, ETE, or iTol. FigTree does not seem to be able to render leaf images either.

Could someone help us out with a recipe to do this?

ADD COMMENTlink modified 2.2 years ago • written 2.2 years ago by Michael Dondrup46k

You can add jpg images to existing plots, see second answer here: http://stackoverflow.com/questions/9543343/plot-a-jpg-image-using-base-graphics-in-r

However, it is not very convenient, maybe the magic wand in Photoshop would be a better solution?

ADD REPLYlink written 2.2 years ago by Benn6.9k

Thank you. Even if I manage to render a single image, the remaining task is really close to 'magic'. MAybe the question can be further broken down:

  • Given a rendered dendrogram, how do we get the coordinates of all tips?
  • given the coordinates, how do we add an image at exactly these to the plot?
ADD REPLYlink written 2.2 years ago by Michael Dondrup46k

I remember that you can manually get coordinates with locator() function. But with a dendrogram of 500 it is practically not feasible I think. Then, in theory, you could feed these coordinates in the plot_jpeg() function.

Maybe there are better solutions though...

ADD REPLYlink written 2.2 years ago by Benn6.9k
Please log in to add an answer.

Help
Access

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