diff --git a/NEWS b/NEWS index 25c3b53..1606bd1 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ dendroNetwork 0.5.2 (development) ### NEW FEATURES ### MINOR IMPROVEMENTS ### BUG FIXES + * corrected bug in cyto_clean_styles() ### DEPRECATED AND DEFUNCT * dev-folder removed, since this was not needed (created by biocthis) ### DOCUMENTATION FIXES @@ -11,6 +12,7 @@ dendroNetwork 0.5.2 (development) * corrected text of documentation in cor_mat_overlap() * added pkgdown site: https://ronaldvisser.github.io/dendroNetwork/ * moved some images to man/figures + * added Vignette on Cytoscape use ### CONTINUOUS INTEGRATION dendroNetwork 0.5.1 (2024-02-10) diff --git a/R/cyto_clean_styles.R b/R/cyto_clean_styles.R index a1ed874..5efd90d 100644 --- a/R/cyto_clean_styles.R +++ b/R/cyto_clean_styles.R @@ -70,7 +70,7 @@ cyto_clean_styles <- function() { # nocov start # import style with grey nodes if ("GreyNodesLabel" %in% RCy3::getVisualStyleNames() == FALSE) { - RCy3::importVisualStyles(filename = system.file("extdata", "NetworkStyles.xml", package = "DendroNetwork")) + RCy3::importVisualStyles(filename = system.file("extdata", "NetworkStyles.xml", package = "dendroNetwork")) } message("All default styles are removed and some new ones are added") } # nocov end diff --git a/paper/paper.Rmd b/paper/paper.Rmd index d55f915..29488b1 100644 --- a/paper/paper.Rmd +++ b/paper/paper.Rmd @@ -41,7 +41,7 @@ Dendrochronological analyses are often based on the comparison of tree-ring seri # Statement of need -There are several packages available in R for dendrochronological research [@guiterman2020; @jevsenak2018; @campelo2012; @bunn2008; @shi2019; @vandermaaten-theunissen2015; @reynolds2021; @altman2014; @rademacher; @campelo2019; @alday2018]. An overview with links to these packages can be found online (). These R-packages in dendrochronology all fill different needs, but the nice thing is that these are all interconnected in some way in depending on each other, or that they build further into different avenues. Apart from depending on dendrochronological packages, various packages from the Tidyverse [@wickham2019] are often also needed. The various relations can easily be visualised using a network, with the edges based on the dependency of two packages on each other, and and arrow indicating the direction of the dependency. +There are several packages available in R for dendrochronological research [@guiterman2020; @jevsenak2018; @campelo2012; @bunn2008; @shi2019; @vandermaaten-theunissen2015; @reynolds2021; @altman2014; @rademacher; @campelo2019; @alday2018]. An overview with links to these packages can be found online (). Some packages are specifically creates to obtain measurements [@campelo2019; @shi2019], while others are written for crossdating [@reynolds2021]. There are also various for analysing tree-ring data [@alday2018; @alday2018; @altman2014; @bunn2008; @campelo2012; @guiterman2020]. These R-packages in dendrochronology all fill different needs, but the nice thing is that these are all interconnected in some way in depending on each other, or that they build further into different avenues. Apart from depending on dendrochronological packages, various packages from the Tidyverse [@wickham2019] are often also needed. The various relations can easily be visualised using a network, with the edges based on the dependency of two packages on each other, and and arrow indicating the direction of the dependency. ```{r, out.width="50%", fig.cap = "The interdependent relations between existing R-packages related to dendrochronology", echo=FALSE} g_dendro_packages <- igraph::graph( c("dplR", "dfoliatR", "tidyverse", "dfoliatR", diff --git a/paper/paper_files/figure-html/unnamed-chunk-1-1.png b/paper/paper_files/figure-html/unnamed-chunk-1-1.png index 633670d..ae5a328 100644 Binary files a/paper/paper_files/figure-html/unnamed-chunk-1-1.png and b/paper/paper_files/figure-html/unnamed-chunk-1-1.png differ diff --git a/paper/paper_files/figure-html/unnamed-chunk-2-1.png b/paper/paper_files/figure-html/unnamed-chunk-2-1.png index 2021ade..74a6906 100644 Binary files a/paper/paper_files/figure-html/unnamed-chunk-2-1.png and b/paper/paper_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/paper/paper_files/figure-html/unnamed-chunk-2-2.png b/paper/paper_files/figure-html/unnamed-chunk-2-2.png index 51316f2..bd7beed 100644 Binary files a/paper/paper_files/figure-html/unnamed-chunk-2-2.png and b/paper/paper_files/figure-html/unnamed-chunk-2-2.png differ diff --git a/paper/paper_files/figure-html/unnamed-chunk-8-1.png b/paper/paper_files/figure-html/unnamed-chunk-8-1.png index 7af69b5..c1c03c7 100644 Binary files a/paper/paper_files/figure-html/unnamed-chunk-8-1.png and b/paper/paper_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/vignettes/cytoscape.Rmd b/vignettes/cytoscape.Rmd new file mode 100644 index 0000000..182c624 --- /dev/null +++ b/vignettes/cytoscape.Rmd @@ -0,0 +1,86 @@ +--- +title: "Cytoscape visualization" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{cytoscape} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>" +) +``` + +```{r setup} +library(dendroNetwork) +``` + +# Required Software + +dendroNetwork uses RCy3 () to connect with Cytoscape and visualize networks. You will need to install and launch Cytoscape: + +- Download the latest Cytoscape from + +- Complete installation wizard + +- Launch Cytoscape + +To check if Cytoscape if completely loaded please run: + +``` +cytoscapePing() +``` + +# Creation of networks + +The creation of dendrochronological networks is done in R using the dendroNetwork package (see readme or the vignette [dendroNetwork: how to use it](dendroNetwork_use.html). + +```{r} +library(dendroNetwork) +data(hol_rom) # 1 +sim_table_hol <- sim_table(hol_rom) # 2 +g_hol <- dendro_network(sim_table_hol) # 3 +g_hol_gn <- gn_names(g_hol) # 4 +hol_com_cpm_all <- find_all_cpm_com(g_hol) # 5 +``` + +After the networks are created, the next step would be to visualize these in Cytoscape. + +# Networks in Cytoscape + +To visualise a dendrochronological network in Cytoscape: + +``` r +cyto_create_graph(g_hol, CPM_table = hol_com_cpm_all, GN_table = g_hol_gn) +``` + +This results in Cytoscape as the following: + +![Network g_hol in Cytoscape.](images/cytoscape_g_hol.png){width="800"} + +The next step would be to add styles for visualisation. However, Cytoscape comes with a lot of default styles that can be confusing. Therefore it is recommended to use once in each session: + +``` r +cyto_clean_styles() +``` + +It is not possible to visualize the styles for example for the Girvan Newman Algorithm: + +``` r +cyto_create_gn_style(g_hol) +``` + +This results in Cytoscape as the following: + +![The network g_hol with the Girvan Newman communities visualized in Cytoscape](images/cytoscape_g_hol_GN.png){width="800"} + +Visualizing the Clique Percolation communities in Cytoscape for the network could be done using + +``` r +cyto_create_cpm_style(g_hol, k=3, com_k = hol_com_cpm_all) +``` + +However, this would make not much sense in this example, since there is only one full clique with k=3 . diff --git a/vignettes/images/cytoscape_g_hol.png b/vignettes/images/cytoscape_g_hol.png new file mode 100644 index 0000000..953d228 Binary files /dev/null and b/vignettes/images/cytoscape_g_hol.png differ diff --git a/vignettes/images/cytoscape_g_hol_GN.png b/vignettes/images/cytoscape_g_hol_GN.png new file mode 100644 index 0000000..da45bd9 Binary files /dev/null and b/vignettes/images/cytoscape_g_hol_GN.png differ