-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReadme.Rmd
More file actions
117 lines (86 loc) · 3.54 KB
/
Copy pathReadme.Rmd
File metadata and controls
117 lines (86 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
title: "Readme"
output: github_document
date: "`r Sys.Date()`"
---
# Juselius_backdoor

**Juselius_backdoor** is an R pipeline for constructing and analyzing coauthorship networks of **Sigrid Juselius Foundation** grantees using **OpenAlex author IDs**. It extracts authors from a text file, resolves their OpenAlex IDs, retrieves their publications, and builds a weighted coauthorship network.
[View Interactive version of this plot](https://jafarilab.github.io/Juselius_backdoor/interactive_plot.html)
---
## Features
- Extracts grantee names from text files.
- Resolves authors to **OpenAlex IDs**.
- Collects publication data for each author.
- Builds a weighted coauthorship network.
- Computes network metrics:
- Degree (number of collaborators)
- Weighted degree
- Betweenness (key connectors)
- Eigenvector centrality (influence)
- Detects communities using the **Louvain algorithm**.
- Generates visualizations:
- Network graph with community coloring
- **Scatter plot of one-time vs. total coauthorship**
- Histograms of centrality measures
- Exports networks for **Gephi** analysis (`.gml` format).
---
## Installation
```{r, echo=T, eval=FALSE,warning=FALSE}
# Install required packages
install.packages(c(
"httr", "jsonlite", "dplyr", "igraph", "ggraph",
"tidygraph", "ggplot2", "ggrepel", "viridis"
))
```
---
## 🚀 Usage
1. Place your grantee text file in the project folder (e.g., `jus2026adult.txt`).
2. Run the pipeline R scripts in order:
* Extract author names
* Search OpenAlex IDs
* Retrieve papers
* Build the coauthorship network
* Compute network metrics
* Visualize results
## 📊 Output
* Weighted coauthorship network (`.gml`) for Gephi
* Network metrics per author (`netSummary`)
* Visualizations of network structure and centrality
Top 10 Researchers (by weighted degree):
```{r, echo=F}
library(knitr)
netSummary <- read.csv("netSummary.csv")
top10 <- netSummary[order(-netSummary$wdegree), ][1:10, ]
top10_display <- top10[, c("author", "degree", "wdegree", "betweenness", "community", "primary_neighbor_MaxW")]
kable(top10_display, format = "markdown")
```
Top 3 Researchers per Community:
```{r, echo=F}
library(knitr)
if(file.exists("top3_per_community.csv")){
top3_per_community <- read.csv("top3_per_community.csv")
top3each <- top3_per_community[order(top3_per_community$community), ]
top3each <- top3each[, c("author", "wdegree", "community")]
kable(top3each, format = "markdown")
} else {
cat("File top3_per_community.csv not found. Run the pipeline first.")
}
```
[View Interactive Co-authorship Network](https://jafarilab.github.io/Juselius_backdoor/network.html)
---
## ⚠️ Notes & Limitations
- Author matching is based on name search and may introduce minor errors
- OpenAlex data is continuously updated → results may vary between runs
- API rate limits and connectivity can affect data retrieval
- Some manual validation was performed, but results are not error-free
## 📌 Interpretation Notes
- High degree + low wdegree → broad but shallow collaboration
- Low degree + high wdegree → deep collaboration with few partners
- Primary neighbor → strongest collaboration link (potential entry point into a research cluster)
## License
MIT License – free to use and modify.
```
This is a fully self-contained **R Markdown README**.
If you want, I can also add a **“Quick Start” code chunk** at the top so users can generate the scatter plot in **one go**, which is very handy for GitHub. Do you want me to do that?
```