talgalili / dendextend

Extending R's Dendrogram Functionality
153 stars 29 forks source link

Add support for variable lwds in tanglegram? #27

Open jayelm opened 8 years ago

jayelm commented 8 years ago

Hi Tal,

Right now, tanglegram supports assigning any desired colors to the connectors of two dendrograms by simply making a sufficient-length vector. This allows for some super interesting graphics to highlight differences in the tree like this

image

I wonder if it's possible to do the same with the connector edge weights as well, to even further highlight interesting connections (lwd parameter)?

After poking around in the tanglegram.dendrogram function, it seems like for colors, you check to see if the argument supplied is a single color, in which case you repeat it as many times as needed, or you treat the list of colors as a vector and index through it as you draw your arrows.

https://github.com/talgalili/dendextend/blob/master/R/tanglegram.R#L897 https://github.com/talgalili/dendextend/blob/master/R/tanglegram.R#L906

I'm sure something similar could be done with lwd, right?

Perhaps if I have some time I can look through and try to implement this.

talgalili commented 8 years ago

Hi Jesse, It should not be hard to implement. I can look at it in three weeks after I return from useR2016. :)

With regards, Tal