-
Notifications
You must be signed in to change notification settings - Fork 5
/
Snakefile
161 lines (144 loc) · 4.23 KB
/
Snakefile
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
rule read_yaml:
input:
"scripts/scrape-packages.R",
"openpharma_included.yaml"
output: "scratch/yaml_repos.rds"
shell: "Rscript scripts/scrape-packages.R"
rule get_s3_old_data:
input: "scripts/scrape-s3.R"
output:
"scratch/commits_s3.rds",
"scratch/people_s3.rds",
"scratch/repos_s3.rds"
shell: "Rscript scripts/scrape-s3.R"
rule get_metacran:
input: "scripts/scrape-metacran.R", "scratch/yaml_repos.rds"
output: "scratch/metacran_repos.rds"
shell: "Rscript scripts/scrape-metacran.R"
rule get_riskmetric:
input: "scripts/scrape-riskmetric.R", "scratch/yaml_repos.rds"
output: "scratch/riskmetric.rds"
shell: "Rscript scripts/scrape-riskmetric.R"
rule get_github:
input:
"scripts/scrape-github.R",
"scratch/yaml_repos.rds",
"scratch/commits_s3.rds",
"scratch/people_s3.rds"
output:
"scratch/gh_commits.rds",
"scratch/gh_issues.rds",
"scratch/gh_people.rds",
"scratch/gh_repos.rds",
"scratch/gh_issues_help.rds"
shell: "Rscript scripts/scrape-github.R"
rule merge_data:
input:
"scripts/merge-data.R",
"scratch/yaml_repos.rds",
"scratch/gh_commits.rds",
"scratch/gh_issues.rds",
"scratch/gh_people.rds",
"scratch/gh_repos.rds",
"scratch/gh_issues_help.rds",
"scratch/metacran_repos.rds",
"scratch/commits_s3.rds",
"scratch/people_s3.rds",
"scratch/repos_s3.rds",
"scratch/riskmetric.rds"
output:
"scratch/repos.csv",
"scratch/people.csv",
"scratch/help.csv",
"scratch/help.rds",
"scratch/repos.rds",
"scratch/people.rds",
"scratch/commits.rds",
"scratch/commits.csv"
shell: "Rscript scripts/merge-data.R"
rule python_clean:
input:
"python_scripts/main_clean.py",
"scratch/repos.csv",
"scratch/people.csv",
"scratch/help.csv",
"scratch/commits.csv"
output:
"scratch/repos_clean.csv",
"scratch/help_clean.csv",
"scratch/pharmaverse_packages.csv"
shell: "python3 python_scripts/main_clean.py"
rule python_leaderboard:
input:
"python_scripts/main_leaderboard.py",
"scratch/people.csv",
"scratch/repos_clean.csv",
"scratch/pharmaverse_packages.csv",
"scratch/commits.csv"
output:
"scratch/gh_leaderboard.parquet",
"scratch/gh_leaderboard_pharmaverse.parquet",
"scratch/people_clean.csv",
"scratch/people_clean_pharmaverse.csv"
shell: "python3 python_scripts/main_leaderboard.py"
rule python_icon_readme:
input:
"python_scripts/main_icon_readme.py",
"scratch/gh_leaderboard.parquet",
"scratch/repos_clean.csv"
output:
"scratch/repos_clean_icon.csv"
shell: "python3 python_scripts/main_icon_readme.py"
rule generate_badges:
input: "scripts/generate-badges.R", "scratch/repos.rds"
output: "scratch/badges.csv"
shell: "Rscript scripts/generate-badges.R"
rule upload_data:
input:
"scripts/upload-data.R",
"scratch/repos.csv",
"scratch/people.csv",
"scratch/help.csv",
"scratch/badges.csv",
"scratch/commits.csv"
output:
"scratch/contents.rds"
shell: "Rscript scripts/upload-data.R"
rule generate_website:
input:
"index.Rmd",
"scratch/commits.rds",
"scratch/help.rds",
"scratch/badges.csv",
"scratch/repos.rds",
"scratch/people.rds"
output:
report("index.html")
shell:
"""
Rscript -e "rmarkdown::render(
'index.Rmd',
output_dir = '.'
)"
"""
rule os_health:
input:
"os-health.Rmd",
"scratch/repos.rds"
output:
report("os-health.html")
shell:
"""
Rscript -e "rmarkdown::render(
'os-health.Rmd',
output_dir = '.'
)"
"""
rule all:
input:
"index.html",
"os-health.html",
"scratch/contents.rds",
"scratch/repos_clean.csv",
"scratch/people_clean.csv",
"scratch/repos_clean_icon.csv"