-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_analysis_and_notebooks.sh
executable file
·156 lines (139 loc) · 3.72 KB
/
run_analysis_and_notebooks.sh
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
#!/bin/sh
set -e
echo -n "Install requirements? (y/n)"
read REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
pip install -r requirements.txt
fi
export PYTHONPATH=$PYTHONPATH:$(pwd)
cd analysis
for i in "$@"
do
echo "STARTING ANALYSIS STEP $i"
case $i in
1)
for COUNTRY in us de
do
python _01_basic_statistics.py $COUNTRY
echo "DONE: _01_basic_statistics $COUNTRY"
done
;;
2)
for COUNTRY in us de
do
python _02_connectivity.py $COUNTRY
echo "DONE: _02_connectivity $COUNTRY"
done
;;
3)
for COUNTRY in us de
do
python _03_family_evolution.py $COUNTRY --labels
echo "DONE: _03_family_evolution $COUNTRY"
done
;;
4)
for COUNTRY in us de
do
python _04_structures.py $COUNTRY
echo "DONE: _04_structures $COUNTRY"
done
;;
5)
for COUNTRY in us de
do
python _05_structure_statistics.py $COUNTRY
echo "DONE: _05_structure_statistics $COUNTRY"
done
;;
15)
python _si_05_variance_between_infomap_runs.py
echo "DONE: _si_05_variance_between_infomap_runs"
;;
16)
python _si_06_variance_impact_of_consensus_clustering.py
echo "DONE: _si_06_variance_impact_of_consensus_clustering"
;;
17)
python _si_07_citation_extraction_quality.py
echo "DONE: _si_07_citation_extraction_quality"
;;
esac
done
cd ../notebooks
for i in "$@"
do
echo "STARTING NOTEBOOK STEP $i"
case $i in
1)
jupyter nbconvert --inplace --to notebook --execute 01-basic-statistics.ipynb
echo "DONE: notebooks/01-basic-statistics"
;;
2)
jupyter nbconvert --inplace --to notebook --execute 02-connectivity.ipynb
echo "DONE: notebooks/02-connectivity"
;;
3)
jupyter nbconvert --inplace --to notebook --execute 03-family-evolution.ipynb
echo "DONE: notebooks/03-family-evolution"
;;
4)
jupyter nbconvert --inplace --to notebook --execute 04-structures.ipynb
echo "DONE: notebooks/04-structures"
;;
5)
jupyter nbconvert --inplace --to notebook --execute 05-structure-statistics.ipynb
echo "DONE: notebooks/05-structure-statistics"
;;
11)
jupyter nbconvert --inplace --to notebook --execute si-01-missing-volumes-in-cfr.ipynb
echo "DONE: notebooks/si-01-missing-volumes-in-cfr"
;;
12)
jupyter nbconvert --inplace --to notebook --execute si-02-community-sankey-plot.ipynb
echo "DONE: notebooks/si-02-community-sankey-plot"
;;
13)
jupyter nbconvert --inplace --to notebook --execute si-03-tfidf-cluster-family-inspection.ipynb
echo "DONE: notebooks/si-03-tfidf-cluster-family-inspection"
;;
14)
jupyter nbconvert --inplace --to notebook --execute si-04-variance-for-preferred-number-of-clusters.ipynb
echo "DONE: notebooks/si-04-variance-for-preferred-number-of-clusters"
;;
15)
jupyter nbconvert --inplace --to notebook --execute si-05-variance-between-infomap-runs.ipynb
echo "DONE: notebooks/si-05-variance-between-infomap-runs"
;;
16)
jupyter nbconvert --inplace --to notebook --execute si-06-variance-impact-of-consensus-clustering.ipynb
echo "DONE: notebooks/si-06-variance-impact-of-consensus-clustering"
;;
17)
jupyter nbconvert --inplace --to notebook --execute si-07-citation-extraction-quality.ipynb
echo "DONE: notebooks/si-07-citation-extraction-quality"
;;
18)
jupyter nbconvert --inplace --to notebook --execute si-08-profile-extensions.ipynb
echo "DONE: notebooks/si-07-profile-extensions"
;;
esac
done
cd ../graphics
python prettify-tables.py
cd ../notebooks
echo -n "Clear notebooks? (y/n)"
read REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
python clear_metadata_from_notebooks.py
jupyter nbconvert --clear-output --inplace $(ls *.ipynb)
fi
cd ../writing/figures
latexmk -pdf figure*.tex
latexmk -c -pdf figure*.tex
cd ..
latexmk -pdf main.tex si.tex
latexmk -c -pdf main.tex si.tex
python merge_tex_files.py