-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcombine_OSG_final.sh
executable file
·32 lines (27 loc) · 1.2 KB
/
combine_OSG_final.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
#!/usr/bin/env bash
ATMO_PATH=$1
for dir in $ATMO_PATH/*
do
workflow=${dir}/outputs
if [ -e $workflow/sim_values.txt ] ; then
echo $workflow
MODEL=$(head -2 $workflow/sim_values.txt | tail -1 | cut -d '/' -f1 | cut -d '_' -f4)
echo ${MODEL}
cut -f2- $workflow/results_sims.txt > $workflow/cut_results_sims.txt
if [ ${MODEL} == "M1" ] ; then
NSTATS=$(head -1 $workflow/results_sims.txt | tr '\t' '\n' | wc -l)
if [ -e input_ABC_OSG_${MODEL}_${NSTATS}.txt ] ; then
paste $workflow/sim_values.txt $workflow/cut_results_sims.txt | grep -v "Asc_NAF" >>input_ABC_OSG_${MODEL}_${NSTATS}.txt
else
paste $workflow/sim_values.txt $workflow/cut_results_sims.txt >input_ABC_OSG_${MODEL}_${NSTATS}.txt
fi
else
if [ -e input_ABC_OSG_${MODEL}.txt ] ; then
paste $workflow/sim_values.txt $workflow/cut_results_sims.txt | grep -v "Asc_NAF" >>input_ABC_OSG_${MODEL}.txt
else
paste $workflow/sim_values.txt $workflow/cut_results_sims.txt >input_ABC_OSG_${MODEL}.txt
fi
fi
rm $workflow/cut_results_sims.txt
fi
done