Skip to content

Commit b31e85e

Browse files
committed
added vignette for large datasets
updated readme installation instructions for vignettes
1 parent 50339a0 commit b31e85e

6 files changed

+53
-25
lines changed

NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ dendroNetwork 0.5.2 (development)
1313
* added pkgdown site: https://ronaldvisser.github.io/dendroNetwork/
1414
* moved some images to man/figures
1515
* added Vignette on Cytoscape use
16+
* moved information for using big datasett to seperate vignette
17+
* updated README: added more installion instructions
1618
### CONTINUOUS INTEGRATION
1719

1820
dendroNetwork 0.5.1 (2024-02-10)

README.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can install the development version of dendroNetwork from [GitHub](https://g
3939

4040
``` r
4141
# install.packages("devtools")
42-
devtools::install_github("RonaldVisser/dendroNetwork")
42+
devtools::install_github("RonaldVisser/dendroNetwork", build_vignettes = TRUE)
4343
```
4444

4545
## Usage {#usage}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ You can install the development version of dendroNetwork from
4646

4747
``` r
4848
# install.packages("devtools")
49-
devtools::install_github("RonaldVisser/dendroNetwork")
49+
devtools::install_github("RonaldVisser/dendroNetwork", build_vignettes = TRUE)
5050
```
5151

5252
## Usage

man/dendroNetwork-package.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/dendroNetwork_use.Rmd vignettes/dendroNetwork.Rmd

+3-23
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ plot(g_hol, vertex.color="deepskyblue", vertex.size=15, vertex.frame.color="gray
5858
vertex.label.color="darkslategrey", vertex.label.cex=0.8, vertex.label.dist=2)
5959
```
6060

61+
For large datasets of tree-ring series see also `vignette("large_datasets_communities")`
62+
6163
### Visualization in Cytoscape {#visualization_cytoscape}
6264

6365
After creating the network in R, it is possible to visualize the network using Cytoscape. The main advantage is that visualisation in Cytoscape is more easy, intuitive and visual. In addition, it is very easy to automate workflows in Cytoscape with R (using [RCy3](https://bioconductor.org/packages/release/bioc/html/RCy3.html)). For this purpose we need to start Cytoscape firstly. After Cytoscape has completely loaded, the next steps can be taken.
@@ -71,31 +73,9 @@ After creating the network in R, it is possible to visualize the network using C
7173

7274
![The network of Roman sitechronologies with the Girvan-Newman communities visualized.](images/g_hol_GN.png){width="800"}
7375

74-
## Usage for large datasets
75-
76-
When using larger datasets calculating the table with similarities can take a lot of time, but finding communities even more. It is therefore recommended to use of parallel computing for Clique Percolation: `clique_community_names_par(network, k=3, n_core = 6)`. This reduces the amount of time significantly.
77-
78-
The workflow is similar as above, but with minor changes:
79-
80-
1. load network
81-
82-
2. compute similarities
83-
84-
3. find the maximum clique size: `igraph::clique_num(network)`
85-
86-
4. detect communities for each clique size separately:
87-
88-
- `com_cpm_k3 <- clique_community_names_par(network, k=3, n_core = 6)`.
89-
90-
- `com_cpm_k4 <- clique_community_names_par(network, k=4, n_core = 6)`.
91-
92-
- and so on until the maximum clique size
93-
94-
5. merge these into a single `data frame` by `com_cpm_all <- rbind(com_cpm_k3,com_cpm_k4, com_cpm_k5,... )`
76+
A more complete description of using Cytoscape with this package can be found here: `vignette("large_datasets_communities")`
9577

96-
6. create table for use in cytoscape with all communities: `com_cpm_all <- com_cpm_all %>% dplyr::count(node, com_name) %>% tidyr::spread(com_name, n)`
9778

98-
7. Continue with the visualisation in Cytoscape, see the previous [section on visualization in Cytoscape](#visualization_cytoscape)
9979

10080
## Citation
10181

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: "Finding communities in large datasets"
3+
output: rmarkdown::html_vignette
4+
vignette: >
5+
%\VignetteIndexEntry{large_datasets_communities}
6+
%\VignetteEngine{knitr::rmarkdown}
7+
%\VignetteEncoding{UTF-8}
8+
---
9+
10+
```{r, include = FALSE}
11+
knitr::opts_chunk$set(
12+
collapse = TRUE,
13+
comment = "#>"
14+
)
15+
```
16+
17+
```{r setup}
18+
library(dendroNetwork)
19+
```
20+
21+
## Community detection in large datasets
22+
23+
When using larger datasets of tree-ring series, calculating the table with similarities can take a lot of time, but finding communities even more. It is therefore recommended to use of parallel computing for Clique Percolation: `clique_community_names_par(network, k=3, n_core = 6)`. This reduces the amount of time significantly.
24+
25+
The workflow is similar as described in the `vignette("dendronetwork")`, but with minor changes:
26+
27+
1. load network
28+
29+
2. compute similarities
30+
31+
3. find the maximum clique size: `igraph::clique_num(network)`
32+
33+
4. detect communities for each clique size separately:
34+
35+
- `com_cpm_k3 <- clique_community_names_par(network, k=3, n_core = 6)`.
36+
37+
- `com_cpm_k4 <- clique_community_names_par(network, k=4, n_core = 6)`.
38+
39+
- and so on until the maximum clique size
40+
41+
5. merge these into a single `data frame` by `com_cpm_all <- rbind(com_cpm_k3,com_cpm_k4, com_cpm_k5,... )`
42+
43+
6. create table for use in cytoscape with all communities: `com_cpm_all <- com_cpm_all %>% dplyr::count(node, com_name) %>% tidyr::spread(com_name, n)`
44+
45+
7. Continue with the visualisation in Cytoscape, see the relevant section in the `vignette("dendronetwork")`

0 commit comments

Comments
 (0)