comparison complete.sh @ 54:81b3eb11ed2c draft

"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
author rhpvorderman
date Tue, 16 Nov 2021 15:42:32 +0000
parents 0ef7f80ea061
children 2a7dc86d8f85
comparison
equal deleted inserted replaced
53:0ef7f80ea061 54:81b3eb11ed2c
1 #!/bin/bash 1 #!/bin/bash
2 set -e 2 set -e
3 inputFiles=($1) 3 inputFiles=("$1")
4 outputDir=$3 4 outputDir=$3
5 outputFile=$3/index.html #$1 5 outputFile=$3/index.html #$1
6 clonalType=$4 6 clonalType=$4
7 species=$5 7 species=$5
8 locus=$6 8 locus=$6
10 clonality_method=$8 10 clonality_method=$8
11 11
12 html=$2 12 html=$2
13 dir="$(cd "$(dirname "$0")" && pwd)" 13 dir="$(cd "$(dirname "$0")" && pwd)"
14 array=("$@") 14 array=("$@")
15 echo "<html><h3>Progress</h3><table><tr><td>info</td></tr>" > $html 15 echo "<html><h3>Progress</h3><table><tr><td>info</td></tr>" > "$html"
16 echo "<tr><td>-----------------------------------</td></tr>" >> $html 16 echo "<tr><td>-----------------------------------</td></tr>" >> "$html"
17 17
18 #mkdir $PWD/igblastdatabase 18 #mkdir $PWD/igblastdatabase
19 #unzip $dir/database.zip -d $PWD/igblastdatabase/ 19 #unzip $dir/database.zip -d $PWD/igblastdatabase/
20 #export IGDATA=$PWD/igblastdatabase/ 20 #export IGDATA=$PWD/igblastdatabase/
21 21
22 echo "python: `which python`" 22 echo "python: $(which python)"
23 echo "R: `which R`" 23 echo "R: $(which R)"
24 echo "Rscript: `which Rscript`" 24 echo "Rscript: $(which Rscript)"
25 25
26 id="" 26 id=""
27 forwardSlash="/" 27 forwardSlash="/"
28 mergerInput=() 28 mergerInput=()
29 echo "Before loop" 29 echo "Before loop"
30 count=1 30 count=1
31 for current in "${inputFiles[@]}" 31 for current in "${inputFiles[@]}"
32 do 32 do
33 if [[ "$current" != *"$forwardSlash"* ]]; then 33 if [[ "$current" != *"$forwardSlash"* ]]; then
34 id="$current" 34 id="$current"
35 mergerInput+=($id) 35 mergerInput+=("$id")
36 count=1 36 count=1
37 continue 37 continue
38 fi 38 fi
39 echo "working on $current" 39 echo "working on $current"
40 fileName=$(basename $current) 40 fileName=$(basename "$current")
41 fileName="${fileName%.*}" 41 fileName="${fileName%.*}"
42 parsedFileName="$PWD/$fileName.parsed" 42 parsedFileName="$PWD/$fileName.parsed"
43 f=$(file $current) 43 f=$(file "$current")
44 zipType="Zip archive" 44 zipType="Zip archive"
45 zxType="XZ compressed data" 45 zxType="XZ compressed data"
46 echo "filetype of ${id}: $f" 46 echo "filetype of ${id}: $f"
47 if [[ "$f" == *"$zipType"* ]] || [[ "$f" == *"$zxType"* ]] 47 if [[ "$f" == *"$zipType"* ]] || [[ "$f" == *"$zxType"* ]]
48 then 48 then
51 bash ${dir}/imgt_loader/imgt_loader.sh $current $parsedFileName "${fileName}" 51 bash ${dir}/imgt_loader/imgt_loader.sh $current $parsedFileName "${fileName}"
52 else 52 else
53 echo "<tr><td>Sample $count of patient $id is not a zip file so assuming fasta/fastq, using igBLASTn</td></tr>" >> $html 53 echo "<tr><td>Sample $count of patient $id is not a zip file so assuming fasta/fastq, using igBLASTn</td></tr>" >> $html
54 bash ${dir}/igblast/igblast.sh $current "$species" $locus $parsedFileName 54 bash ${dir}/igblast/igblast.sh $current "$species" $locus $parsedFileName
55 fi 55 fi
56 mergerInput+=($parsedFileName) 56 mergerInput+=("$parsedFileName")
57 count=$((count+1)) 57 count=$((count+1))
58 done 58 done
59 59
60 echo "<tr><td>-----------------------------------</td></tr>" >> $html 60 echo "<tr><td>-----------------------------------</td></tr>" >> $html
61 echo "<tr><td>merging</td></tr>" >> $html 61 echo "<tr><td>merging</td></tr>" >> $html