Mercurial > repos > davidvanzessen > argalaxy_tools
comparison complete.sh @ 12:010402c959aa draft
Uploaded
author | davidvanzessen |
---|---|
date | Tue, 04 Aug 2015 10:00:20 -0400 |
parents | |
children | cf1def1aaa74 |
comparison
equal
deleted
inserted
replaced
11:0510cf1f7cbc | 12:010402c959aa |
---|---|
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 fileName="${fileName%.*}" | |
39 parsedFileName="$PWD/$fileName.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 "${fileName}" | |
48 else | |
49 echo "<tr><td>Sample $count of patient $id is not a zip file so assuming fasta/fastq, using igBLASTn</td></tr>" >> $html | |
50 bash ${dir}/igblast/igblast.sh $current $species $locus $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 |