-
Notifications
You must be signed in to change notification settings - Fork 1
/
2-build_graphs.sh
73 lines (51 loc) · 1.66 KB
/
2-build_graphs.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
# Script for preparing the Neo4j networks
# Prepares K versions
# number of cross validations
K=5
# max number of fold validations to do concurrently
MAX_FOLD=2
TOP=$(dirname "$PWD")
cd $TOP
echo "Preparing folder structure for $K fold cross validation"
for ((i=0; i<K; i++)); do
if [ ! -d "fold$i" ]; then
echo "Creating folder for validation fold $i"
mkdir "fold$i"
echo "$i" > "fold$i/crossval_idx.txt"
fi
done
echo "Cloning integrate repository"
for ((i=0; i<K; i++)); do
cd "fold$i"
if [ ! -d "integrate" ]; then
echo "Cloning integrate repository for fold $i"
git clone https://github.com/veleritas/integrate.git -b dev
fi
cd ..
done
#-------------------------------------------------------------------------------
echo "Activating runtime environment"
source activate integrate
# notebooks do not affect output files
echo "Preparing resources"
for ((i=0; i<K; i++)); do
cd "fold$i/integrate"
bash precompile.sh &
cd $TOP
done
wait
echo "Finished precompiling resources"
cd "$TOP/rephetio-coord"
echo "Running integration scripts"
for ((i=0; i<K; i++)); do echo $i; done | parallel --ungroup -j5 --no-notice bash 2.1-integrate.sh
for ((i=0; i<K; i++)); do echo $i; done | parallel --ungroup -j5 --no-notice bash 2.2-permute.sh
echo "Running neo4j imports"
for ((i=0; i<K; i++)); do echo $i; done | parallel --ungroup -j5 --no-notice bash 2.3-neo4j_import.sh
# run the neo4j csv importer
for ((i=0; i<K; i++)); do
echo "Running Neo4j CSV importer for fold $i"
cd "$TOP/fold$i/integrate"
bash neo4j-import.sh
done
source deactivate
echo "Done data integration for $K fold cross validation"