erange version 4.0a dev release
[erange.git] / docs / regionCounts.sh
1 #!/bin/bash
2 echo 'regionCounts.sh: version 1.0'
3
4 cachepages=""
5 if [ $# -eq 3 ]; then
6     cachepages="--cache "$3
7 fi
8
9 if [ $# -lt 2 ]; then
10         echo 'usage: regionCounts.sh partitionfile datalist.file [cachevalue]'
11         echo
12         echo 'where the datalist file is a comma-delimited list of prefix and rds-files'
13         echo
14 else
15         arguments=$1' '$2' '$cachepages
16         python $ERANGEPATH/recordLog.py regionCounts.log regionCounts.sh "with parameters: $arguments"
17         while read line
18         do 
19                 prefix=`echo $line | cut -f 1 -d ','`
20                 rds=`echo $line | cut -f 2 -d ','`
21                 if [ -e $rds ]; then
22                         python $ERANGEPATH/regionCounts.py $1 $rds $prefix.partcount --force --nomerge --rpkm $cachepages
23                 else
24                         echo "could not find $rds - skipping"
25                         python $ERANGEPATH/recordLog.py regionCounts.log regionCounts.sh "could not find $rds - skipping"
26                 fi
27         done < $2      
28 fi