forked from scitran-apps/afq-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 3
/
run
executable file
·54 lines (37 loc) · 1.21 KB
/
run
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
#! /bin/bash
#
#
CONTAINER="[vistalab/rtp-pipeline]"
echo -e "$CONTAINER Initiated"
###############################################################################
# Built to flywheel-v0 spec.
FLYWHEEL_BASE=/flywheel/v0
OUTPUT_DIR=$FLYWHEEL_BASE/output
INPUT_DIR=$FLYWHEEL_BASE/input
###############################################################################
# DTIINIT
${FLYWHEEL_BASE}/run_dtiinit
exit_status=$?
if [[ $exit_status != 0 ]]; then
echo "$CONTAINER DTIINIT failure!"
exit $exit_status
fi
###############################################################################
###############################################################################
# AFQ
# Make AFQ DIRECTORY
ZIP_DIR=$INPUT_DIR/dtiInit_Archive
mkdir "$ZIP_DIR" && cp "$OUTPUT_DIR"/*.zip "$ZIP_DIR"
${FLYWHEEL_BASE}/run_afq
exit_status=$?
if [[ $exit_status != 0 ]]; then
echo "$CONTAINER AFQ failure!"
exit $exit_status
fi
###############################################################################
# Delete the working folders only if it has been succesful, otherwise the folders
# will remain in the input folder for debugging
rm -rf $INPUT_DIR/work
rm -rf $INPUT_DIR/dtiInit_Archive
echo "$CONTAINER DONE!"
exit 0