-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmy_fba_av_response.sh
executable file
·69 lines (49 loc) · 1.15 KB
/
my_fba_av_response.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
#!/bin/bash
source `which my_do_cmd`
echo working on `hostname`
for tissue in wm gm csf
do
av_response=${FBA_DIR}/average_${tissue}_response.txt
if [ -f $av_response ]
then
echo " [INFO] Average response function exists: $av_response"
continue
fi
isOK=1
for s in $FBA_DIR/*
do
if [ ! -d $s ]
then
continue
fi
subj=`basename $s`
if [[ "$subj" = "logs" ]]
then
continue
fi
if [[ "$subj" = "template" ]]
then
echo " [INFO] Not including the template in this step, of course."
continue
fi
this_response=${FBA_DIR}/${subj}/${tissue}_response.txt
if [ ! -f $this_response ]
then
if [ -f ${FBA_DIR}/${subj}/exclude ]
then
echo " [INFO] Subject excluded: $subj"
else
isOK=0
echo " [ERROR] Cannot find response function for subject $subj"
fi
else
echo " [INFO] Found response function: $this_response"
fi
done
if [ $isOK -eq 0 ]
then
echo " [ERROR] Cannot compute average response function. See above."
exit 2
fi
my_do_cmd responsemean ${FBA_DIR}/*/${tissue}_response.txt $av_response
done