forked from rjzupkoii/chemsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·52 lines (41 loc) · 1.01 KB
/
run.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
#!/bin/bash
# Check for expected parameter
if [ -z "$1" ]; then
echo "Usage: ./run.sh [pathway]"
exit 1
fi
REACTIONS=$1
# Note the inputs
#experiment=experiment/experiment.csv
chemicals=experiment/chemicals.csv
reactions=experiment/$REACTIONS.csv
path=../data
zip=../$REACTIONS.zip
# Clean-up the data directory
rm -rf data
mkdir data
# Note we are preventing sleep
echo "Preventing sleep during simulations"
caffeinate &
# Run the simulation
for ndx in {1..1}
do
java -javaagent:lib/SizeOf.jar -Xms4G -XX:+UseG1GC -jar ChemSim.jar -n $ndx -r $reactions -c $chemicals -l 1.0E+05
done
# Move the results, last console
mkdir data/molecules
mv data/results-* data/molecules
mkdir data/mols
mv data/molar-* data/mols
mv console.txt data
# Make a copy of the experimental inputs
cp $reactions data
cp $chemicals data
# Generate the plots
./analysis.R
# Compress the raw data
cd data; zip -r -X "$zip" * -x "*.DS_Store"
# Restore sleep
killall caffeinate
# Notify user
osascript -e 'display notification "Model complete!"'