-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvillage.sh
executable file
·40 lines (34 loc) · 1.42 KB
/
village.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
#!/bin/bash
<<<<<<< HEAD
export R_HOME="/usr/local/lib64/R"
export LD_LIBRARY_PATH=$R_HOME/lib:$LD_LIBRARY_PATH
VILLAGE=$1
TREE_FILE=/home/rmcclosk/pangea/data/February2015/Village/newick/Vill_${VILLAGE}_Feb2015_5yr.nwk
SETTINGS_FILE=/home/rmcclosk/pangea/settings/pangea_V${VILLAGE}.json
=======
export R_HOME="/usr/local/lib/R"
VILLAGE=$1
TREE_FILE=/home/rmcclosk/Documents/pangea/data/February2015/Village/newick/Vill_${VILLAGE}_Feb2015_5yr.nwk
SETTINGS_FILE=/home/rmcclosk/Documents/pangea/settings/pangea_V${VILLAGE}.json
>>>>>>> a34445f7503d49eed68fc708c18efb8b019f84d9
LOG_FILE=V${VILLAGE}.log
KAMPHIR_ARGS="-delimiter _ -ncores 5 -nthreads 5 -nreps 5 -tscale 52.0 -tol0 0.03 -mintol 0.01 -prior"
while ((1)); do
if [[ -f ${LOG_FILE} ]]; then
echo "Restarting ${LOG_FILE} at `date`"
LAST_LOG=`ls -1 ${LOG_FILE}* | sort -n -k 3 -t '.' | tail -n 1`
python kamphir.py PANGEA ${SETTINGS_FILE} ${TREE_FILE} ${LOG_FILE} ${KAMPHIR_ARGS} -restart ${LAST_LOG}
else
python kamphir.py PANGEA ${SETTINGS_FILE} ${TREE_FILE} ${LOG_FILE} ${KAMPHIR_ARGS}
fi
LAST_LOG=`ls -1 ${LOG_FILE}* | sort -n -k 3 -t '.' | tail -n 1`
if [[ `wc -l < ${LAST_LOG} ` -le 7 ]]; then
echo "Removing unsuccesful log file ${LAST_LOG} at `date`"
rm ${LAST_LOG}
rm $(echo ${LAST_LOG} | sed s/log/trees/)
fi
<<<<<<< HEAD
=======
break
>>>>>>> a34445f7503d49eed68fc708c18efb8b019f84d9
done