-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.qmd
225 lines (185 loc) · 5.15 KB
/
README.qmd
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
---
format: gfm
---
# Software development coordination
This repository is used for coordinating all the software development activities by the ForeSITE group.
```{r}
#| label: load-data
#| echo: false
#| warning: false
library(yaml)
library(data.table)
existing_software <- list.files(
"data", pattern = "ya?ml$", full.names = TRUE
) |>
lapply(FUN = yaml.load_file, as.named.list = TRUE) |>
lapply(as.data.table) |>
rbindlist()
writexl::write_xlsx(x = existing_software, path = "data/software.xlsx")
# Renaming relevant columns
cnames <- c(
Tool = "tool_name",
Description = "tool_description",
Languages = "languages",
Repo = "github_link",
Contact = "contact_name",
Email = "contact_email",
Links = "docs_link",
Type = "tool_type",
Diseases = "relevant_diseases"
)
setnames(existing_software, cnames, names(cnames))
# For the moment, we are only keeping tools that have a url under Links
# or Repo
total_software <- nrow(existing_software)
existing_software <- existing_software[
grepl("http", Links, ignore.case = TRUE) |
grepl("http", Repo, ignore.case = TRUE)
]
```
The list includes `r nrow(existing_software)` tools. A complete list featuring completed and work-in-progress tools holds `r total_software` entries. We will be updating this list as we progress.
```{r}
#| label: some-stats
#| echo: false
existing_software[, table(Type)] |>
as.data.frame(responseName = "N") |>
setorder(-N) |>
knitr::kable(caption = "Number of software packages by type")
```
```{r}
#| label: languages
#| echo: false
allowed_languages <- c(
"R", "C++", "C", "Java", "Python", "Julia", "Matlab", "JavaScript",
"cli", "sas", "Stata", "AnyLogic"
) |> tolower()
listed_languages <- existing_software[, tolower(Languages)] |>
strsplit(",") |>
unlist() |>
trimws() |>
gsub(pattern = "[.]$|and ", replacement = "")
listed_languages[!listed_languages %in% allowed_languages] <- "Other"
table(listed_languages) |>
as.data.table() |>
setnames(c("Language", "N")) |>
setorder(-N) |>
knitr::kable(
caption = "Number of software packages by programming language."
)
```
# Existing software packages
List of existing software packages that are being used by the ForeSITE group. This list was last updated on `r Sys.Date()`.
```{r}
#| label: existing_software
#| echo: false
# Adding link to GitHub (if it exists)
existing_software[, Repo := fifelse(
grepl("github", Repo, ignore.case = TRUE),
sprintf(
"**GitHub:** [![GitHub last commit](https://img.shields.io/github/last-commit/%s)](%s)",
gsub(".+github\\.com/", "", Repo),
Repo
),
""
)]
# Creating a slug for the link
existing_software[, slug := gsub(" ", "-", tolower(trimws(Tool)))]
existing_software[, slug := gsub("[^a-z0-9-]+", "-", slug)]
existing_software[, slug := gsub("-+", "-", slug)]
existing_software[, slug := gsub("^-|-$", "", slug)]
existing_software[, Description2 := sprintf(
"%s<br>([Learn more...](profiles.md#%s))",
Description,
slug
)]
dat <- existing_software[, .(
Tool = sprintf("%s (%s)", Tool, Languages),
Description = sprintf(
"%s<br>%s",
Description2,
Repo
)
)]
# Adding a number
dat[, N := 1:.N]
dat <- dat[, c("N", "Tool", "Description")]
knitr::kable(dat)
```
```{r}
#| label: create-profiles
#| echo: false
unlink("profiles.md", force = TRUE)
writer <- \(x) {
cat(x, file = "profiles.md", append = TRUE)
}
writer("# Profiles\n\n")
# Adding a line that specifies that this file (profiles.md)
# is automatically generated and should not be edited manually
writer(
sprintf(
"This file is automatically generated and should not be edited manually. Last updated on %s.\n\n",
Sys.Date()
)
)
for (i in 1:nrow(existing_software)) {
# Header
writer(
sprintf(
"## %s\n\n",
existing_software$Tool[i]
))
# Description
writer(
sprintf("%s\n\n", existing_software$Description[i])
)
# Contact
writer(
sprintf(
"Contact: %s (email: %s)\n\n",
existing_software$Contact[i],
existing_software$Email[i]
)
)
# Link
writer(
sprintf(
"Links:<br> %s\n\n",
existing_software$Links[i]
)
)
}
```
```{r}
#| label: wordcloud
#| echo: false
#| fig-dpi: 400
#| fig-width: 8
#| fig-height: 8
tool_names <- dat$Tool
# Removing the part in parentheses
tool_names <- gsub("\\s*\\([^)]+\\)$", "", tool_names)
tool_names <- strsplit(tool_names, " ")
tool_names <- sapply(tool_names, function(tool) {
nletters <- nchar(tool) |> cumsum()
nletters <- nletters %/% 20 |> diff()
tool[which(nletters == 1)] <- tool[which(nletters == 1)] |> paste0("\n")
paste(tool, collapse = " ")
})
plot.new()
set.seed(331)
tool_xy = list(
x = runif(nrow(dat), 0, 1),
y = runif(nrow(dat), 0, 1),
cex = 1.5 - runif(nrow(dat), 0, 1),
col = sample(colors(), nrow(dat))
)
plot.window(xlim = c(-.25, 1.25), ylim = c(-.25, 1.25))
text(
x = tool_xy$x,
y = tool_xy$y,
labels = tool_names,
cex = tool_xy$cex,
col = tool_xy$col,
font = 2,
)
```