dendextend icon indicating copy to clipboard operation
dendextend copied to clipboard

Can I remove tip labels from tanglegram?

Open TreeT2 opened this issue 7 years ago • 7 comments

Is is possible to have no tip labels when plotting a tanglegram?

TreeT2 avatar Jun 29 '17 16:06 TreeT2

There is no official parameter, but this can be done using the margin_inner parameter.

Here is an example:

## Not run: 
set.seed(23235)
ss <- sample(1:150, 10 )
dend1 <- iris[ss,-5] %>% dist %>% hclust("com") %>% as.dendrogram
dend2 <- iris[ss,-5] %>% dist %>% hclust("sin") %>% as.dendrogram
dend12 <- dendlist(dend1, dend2)

dend12 %>% tanglegram

tanglegram(dend1 , dend2, margin_inner = 0.5)

image

talgalili avatar Jul 01 '17 18:07 talgalili

Thanks Tal.

TreeT2 avatar Jul 03 '17 11:07 TreeT2

Only got about to trying this out lately and margin_inner = 0.5 does not work, but dLeaf=1 worked for me.

TreeT2 avatar Jul 26 '17 14:07 TreeT2

Could you please share the fig you got and the sessionInfo() ?

talgalili avatar Jul 26 '17 17:07 talgalili

The is similar as above Ill try to make a reproducible example later. but for sessionInfo() gives: Ive a few other phylo packages in my session.

R version 3.4.0 (2017-04-21) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

attached base packages: [1] stats4 parallel stats graphics grDevices utils datasets methods base

other attached packages: [1] data.table_1.10.4 plyr_1.8.4 dplyr_0.7.1 gtools_3.5.0
[5] tidyr_0.6.3 DECIPHER_2.4.0 RSQLite_2.0 Biostrings_2.44.1
[9] XVector_0.16.0 IRanges_2.10.2 S4Vectors_0.14.3 BiocGenerics_0.22.0 [13] dendextend_1.5.2 phangorn_2.2.0 ape_4.1 ggtree_1.8.1
[17] treeio_1.0.2 ggplot2_2.2.1

loaded via a namespace (and not attached): [1] mclust_5.3 Rcpp_0.12.11 mvtnorm_1.0-6 lattice_0.20-35 class_7.3-14
[6] assertthat_0.2.0 digest_0.6.12 R6_2.2.2 zlibbioc_1.22.0 rlang_0.1.1
[11] lazyeval_0.2.0 diptest_0.75-7 whisker_0.3-2 blob_1.1.0 kernlab_0.9-25
[16] Matrix_1.2-9 labeling_0.3 igraph_1.0.1 bit_1.1-12 munsell_0.4.3
[21] compiler_3.4.0 pkgconfig_2.0.1 nnet_7.3-12 tibble_1.3.3 gridExtra_2.2.1
[26] quadprog_1.5-5 viridisLite_0.2.0 MASS_7.3-47 grid_3.4.0 nlme_3.1-131
[31] jsonlite_1.5 gtable_0.2.0 DBI_0.7 magrittr_1.5 scales_0.4.1
[36] viridis_0.4.0 flexmix_2.3-14 bindrcpp_0.2 robustbase_0.92-7 rvcheck_0.0.8
[41] fastmatch_1.1-0 tools_3.4.0 fpc_2.1-10 bit64_0.9-7 glue_1.1.1
[46] trimcluster_0.1-2 DEoptimR_1.0-8 colorspace_1.3-2 cluster_2.0.6 prabclus_2.2-6
[51] memoise_1.1.0 bindr_0.1 modeltools_0.2-21

TreeT2 avatar Jul 26 '17 18:07 TreeT2

Thanks, I see you're using the latest dendextend version. A reproducible example will help. I can also think of adding a "show_labels" parameter to control this more directly. Once you get the example ready, I'll add this feature and we can see how it looks.

Cheers, Tal

talgalili avatar Jul 26 '17 19:07 talgalili