Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aheatmap: Line width of the tree #47

Open
sjackman opened this issue Jul 25, 2015 · 4 comments
Open

aheatmap: Line width of the tree #47

sjackman opened this issue Jul 25, 2015 · 4 comments

Comments

@sjackman
Copy link

Is it possible to set the line width of the tree of aheatmap? Any other tips for producing figures for publication?

@renozao
Copy link
Owner

renozao commented Jul 28, 2015

Which version are you using. Try the one on the devel branch on Github.
You will need to install the develop version of pkgmaker as well.
Have a look at the aheatmap vignette.

@sjackman
Copy link
Author

I've read the vignette, but I didn't see an option to change the line width of the tree. Does it require passing an option to the dendextend package?

@renozao
Copy link
Owner

renozao commented Jul 30, 2015

You can pass a pre-formated dendrogram to Rowv or Colv (top of page 5 in the vignettes, which I agree does not show the right plot. Will fix this).
Some formatting options are built-in aheatmap, but there is a lot of other neat things you can do with dendextend from @talgalili.

# data
x <- rmatrix(20, 10)
# extract clustering or create it externally
a <- aheatmap(x)
hc <- a$Colv
# hc <- as.dendrogram(hclust(dist(t(x))))

# pre-format
library(dendextend)
hc <- set("nodes_pch", c(19,1,4)) %>%
set("nodes_cex", c(2,1,2)) %>%
set("nodes_col", c(3,4))
hc <- hc %>% set("branches_lwd", c(4,1)) %>%
set("branches_lty", c(1,1,3)) %>%
set("branches_col", c(1,2,3))

# plot
aheatmap(x, Colv = hc, Rowv = FALSE, main = "Custom dendrogram")

@talgalili
Copy link

Dear @renozao ,
Thank you for letting me know. I now added a mention of using aheatmap with dendextend in its vignette:
talgalili/dendextend@9d75974

With regards,
Tal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants