erange version 4.0a dev release
[erange.git] / docs / partition.sh
1 # an example shell script to combine multiple region calls into one partition
2 #
3
4 if [ -z "$1" ]; then
5     PARTNAME=comb
6 else
7         PARTNAME=$1
8 fi
9
10 if [ -z "$2" ]; then 
11         MINSIZE=400
12 else
13         MINSIZE=$2
14 fi
15
16 N=0
17 if [ $# -lt 2 ]; then
18         echo 'usage: partition.sh name minSize datalist.file'
19         echo
20         echo 'where the datalist file is a list of region files'
21         echo
22 else
23         while read line
24         do
25                 if [ $N -lt 1 ]; then
26                         FILELIST=''
27                 else
28                         FILELIST=$FILELIST,
29                 fi
30                 FILELIST=$FILELIST$line
31                 let N=N+1
32         done < $3
33         python $ERANGEPATH/partition.py $N.way $FILELIST $PARTNAME$N.part --minFeature $MINSIZE --nomerge --locid --norandom
34 fi