How to plot a dendrogram with images of RNAstructure at the leaves/tips?
0
0
Entering edit mode
7.1 years ago
Michael 54k

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?

dendrogram visualization structure • 1.9k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 3199 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