This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_copycat
executable file
·78 lines (58 loc) · 1.77 KB
/
prepare_copycat
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
70
71
72
73
74
75
76
#!/bin/bash
progname=prepare_copycat
function usage () {
cat <<EOF
Usage: $progname -c code
$progname -h for help
EOF
exit 0
}
function guide () {
cat <<EOF
Usage: $progname [-d] [-j threads] -c code -f Dfilename
[-h] help displays this help menu
-c code *required field: a code value (can mix letters and numbers) so users can revisit their data later,
this becomes the run directory inside user_data/
must match the filename used next in run_copycat
EOF
exit 0
}
#-f Dfilename *required field: a name for the file a user uploaded from the web app
# must match the filename used next in run_copycat
code=0 # becomes the run directory inside user_data
Dfilename=D.txt
outdir=user_data/$code
while getopts ":hc:" opt; do
case $opt in
h)
guide;;
c )
code=$OPTARG
if [ ! -f user_uploads/$code ];then
echo "No such analysis--no uploaded file found"
exit 4
fi
outdir=user_data/$code
echo "-c: code=$code" >&2;;
#f )
# Dfilename=$OPTARG
# echo "-f: filename of input data: $Dfilename" >&2;;
\?) usage ;;
esac
done
if [ ! -d $outdir ]; then
mkdir $outdir
if [ $? -ne 0 ] ; then
echo "Error: could not create directory. Check permissions on user_data/"
else
echo "success"
fi
fi
echo Run directory: $outdir
D=$outdir/$Dfilename
######################## change this to move the user's file into their run directory ###############################
cp user_uploads/$code $D
#####################################################################################################################
touch $outdir/progress.txt
python -c "import deconvolve; deconvolve.check_file('$D','$outdir')"
echo finished prepare_copycat