forked from CellProfiler/CellProfiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-2.6.sh
executable file
·37 lines (36 loc) · 934 Bytes
/
python-2.6.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
#!/bin/bash
TGTUSER=imageweb
TGTHOME=/home/unix/imageweb
if [ $USER == $TGTUSER ]
then
if [ $HOME == $TGTHOME ]
then
export HOME=/broad/hptmp/imageweb
fi
fi
export PYTHONPATH=/imaging/analysis/CPCluster/CellProfiler-2.0/javabridge-bioformats-site-packages
. /broad/software/scripts/useuse
reuse .toolbox-0.11.0
reuse Java-1.6
export MPLCONFIGDIR=/imaging/analysis/CPCluster/CellProfiler-2.0/.matplotlib
export LAST_CHECKOUT=`echo "import os;cpdir='/imaging/analysis/CPCluster/CellProfiler-2.0';print os.path.join(cpdir,str(max(*[int(x) for x in os.listdir(cpdir) if x.isdigit()])))" | python`
if [ -n "$CELLPROFILER_USE_XVFB" ]
then
#
# Set up X -> Xvfb
#
DISPLAY=:$LSB_JOBID
echo "Xvfb display = $DISPLAY"
tmp=/local/scratch/CellProfilerXVFB.$RANDOM.$RANDOM
echo "Xvfb directory = $tmp"
mkdir $tmp
Xvfb $DISPLAY -fbdir $tmp &
XVFBPID=$!
echo "Xvfb PID = $XVFBPID"
python -s "$@"
kill $XVFBPID
sleep 5
rmdir $tmp
else
python "$@"
fi