-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProcessplate.sh
executable file
·93 lines (72 loc) · 2.38 KB
/
Processplate.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
if [ $# -ne 2 ]; then
echo 1>&2 "Usage: $0 <platedir> <outdir>: process the plate in directory <platedir>. Generate outout in <outdir>"
exit 2
fi
PLATEDIR=$(readlink -f $1)
BASEOUT=$(readlink -f $2)
echo "Platedir: $PLATEDIR"
echo "Output: $BASEOUT"
BARCODE=`basename $PLATEDIR`
CSVDIR=$BASEOUT/csv
ILLUMDIR=$BASEOUT/illum
OUTPUTRAW=$BASEOUT/output_raw
OUTPUTNORMALIZED=$BASEOUT/output_normalized
rm -rf OUTPUTRAW
mkdir -p $CSVDIR
mkdir -p $ILLUMDIR
mkdir -p $OUTPUTRAW
mkdir -p $OUTPUTNORMALIZED
rm -rf /scratch/images
rm -rf /scratch/csv
rm -rf /scratch/illum
rm -rf /scratch/output_raw
rm -rf /scratch/output_normalized
ln -f -s $PLATEDIR /scratch/images
ln -f -s $CSVDIR /scratch/csv
ln -f -s $ILLUMDIR /scratch/illum
ln -f -s $OUTPUTRAW /scratch/output_raw
ln -f -s $OUTPUTNORMALIZED /scratch/output_normalized
CPARGS="-b --do-not-fetch -c -r --jvm-heap-size=2g"
#=============================================
# General Sanity Checks and Setup
#=============================================
# ensure images exist in /platedir
IMAGESEXIST=$(ls $PLATEDIR | wc -l)
if [ $? -gt 0 ]; then
echo "Error accessing images directory. Did you specify the right volume for /platedir - exiting job"
exit 1
fi
if [ "$IMAGESEXIST" -eq 0 ]; then
echo "Error: no files in /platedir. Did you specify the right volume for /platedir? - exiting job"
exit 2
fi
#=============================================
# Processing
#=============================================
# 0. generate CSV file for plate
echo "0 - Generating CSV file"
. ./generateCSV.sh \
/scratch/images \
$BARCODE \
/scratch/illum/$BARCODE \
/scratch/csv
# 1. generate illumination data
echo "1 - Running Illumination Pipeline"
python ./CellProfiler/CellProfiler.py $CPARGS \
-p ./illum_loaddata_2.1.1.-janssen.cppipe \
--data-file=/scratch/csv/illumination_$BARCODE.csv \
-o /scratch/illum/$BARCODE
# 2. generate analysis output
echo "2 - Running Analysis Pipeline"
python ./CellProfiler/CellProfiler.py $CPARGS \
-p ./analysis_loaddata_2.1.1.-janssen.cppipe \
--data-file=/scratch/csv/analysis_$BARCODE.csv \
-o /scratch/output_raw/$BARCODE/process_1
# 3. generate normalized data
. ./normalizePlate.sh \
/scratch/output_raw/$BARCODE \
$BARCODE \
/scratch/output_normalized/$BARCODE
# Done
echo "Done at `date`"