comparison complete.sh @ 0:f90fbc15b35a draft

Uploaded
author davidvanzessen
date Thu, 16 Jul 2015 08:30:43 -0400
parents
children edbf4fba5fc7
comparison
equal deleted inserted replaced
-1:000000000000 0:f90fbc15b35a
1 #!/bin/bash
2 set -e
3 inputFiles=($1)
4 outputDir=$3
5 outputFile=$3/index.html #$1
6 clonalType=$4
7 species=$5
8 locus=$6
9 filterproductive=$7
10 clonality_method=$8
11
12
13 html=$2
14 dir="$(cd "$(dirname "$0")" && pwd)"
15 array=("$@")
16 echo "<html><h3>Progress</h3><table><tr><td>info</td></tr>" > $html
17 echo "<tr><td>-----------------------------------</td></tr>" >> $html
18
19 #mkdir $PWD/igblastdatabase
20 #unzip $dir/database.zip -d $PWD/igblastdatabase/
21 #export IGDATA=$PWD/igblastdatabase/
22
23 id=""
24 forwardSlash="/"
25 mergerInput=()
26 echo "Before loop"
27 count=1
28 for current in "${inputFiles[@]}"
29 do
30 if [[ "$current" != *"$forwardSlash"* ]]; then
31 id="$current"
32 mergerInput+=($id)
33 count=1
34 continue
35 fi
36 echo "working on $current"
37 fileName=$(basename $current)
38 parsedFileName="${fileName%.*}"
39 parsedFileName="$PWD/$parsedFileName.parsed"
40 f=$(file $current)
41 zipType="Zip archive"
42 zxType="XZ compressed data"
43 if [[ "$f" == *"$zipType"* ]] || [[ "$f" == *"$zxType"* ]]
44 then
45 echo "<tr><td>Sample $count of patient $id is an archive file, using IMGT Loader</td></tr>" >> $html
46 fileName=$(basename $current)
47 bash ${dir}/imgt_loader/imgt_loader.sh $current $parsedFileName $count $parsedFileName "tmp"
48 else
49 echo "<tr><td>Sample $count of patient $id is not a zip file, using igBLASTn</td></tr>" >> $html
50 #blastAndParse $current $id $count $fileName $parsedFileName &
51 fi
52 mergerInput+=($parsedFileName)
53 count=$((count+1))
54 done
55 wait
56
57 echo "after loop"
58
59 echo "<tr><td>-----------------------------------</td></tr>" >> $html
60 echo "<tr><td>merging</td></tr>" >> $html
61
62 python $dir/experimental_design/experimental_design.py ${mergerInput[*]} --output $PWD/merged.txt
63
64 echo "<tr><td>done</td></tr>" >> $html
65 echo "<tr><td>-----------------------------------</td></tr>" >> $html
66 echo "<tr><td>plotting</td></tr>" >> $html
67
68 echo "after ED"
69
70 bash $dir/report_clonality/r_wrapper.sh $PWD/merged.txt $2 $outputDir $clonalType "$species" "$locus" $filterproductive $clonality_method
71