Mercurial > repos > davidvanzessen > argalaxy_tools
annotate complete.sh @ 56:7ae6b6b5d890 draft
"planemo upload commit 2d4cb6757e8eff095295550bbde6fd9e2ee0b73d"
| author | rhpvorderman |
|---|---|
| date | Tue, 14 Dec 2021 12:45:47 +0000 |
| parents | 2a7dc86d8f85 |
| children |
| rev | line source |
|---|---|
| 53 | 1 #!/bin/bash |
| 2 set -e | |
|
55
2a7dc86d8f85
"planemo upload commit 14f5f6a6fa8873c6d7f0f97dfddc0ba02fff3d1d"
rhpvorderman
parents:
54
diff
changeset
|
3 inputFiles=($1) # Input files can be multiple files |
| 53 | 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 html=$2 | |
| 13 dir="$(cd "$(dirname "$0")" && pwd)" | |
| 14 array=("$@") | |
|
54
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
15 echo "<html><h3>Progress</h3><table><tr><td>info</td></tr>" > "$html" |
|
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
16 echo "<tr><td>-----------------------------------</td></tr>" >> "$html" |
| 53 | 17 |
| 18 #mkdir $PWD/igblastdatabase | |
| 19 #unzip $dir/database.zip -d $PWD/igblastdatabase/ | |
| 20 #export IGDATA=$PWD/igblastdatabase/ | |
| 21 | |
|
54
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
22 echo "python: $(which python)" |
|
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
23 echo "R: $(which R)" |
|
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
24 echo "Rscript: $(which Rscript)" |
| 53 | 25 |
| 26 id="" | |
| 27 forwardSlash="/" | |
| 28 mergerInput=() | |
| 29 echo "Before loop" | |
| 30 count=1 | |
| 31 for current in "${inputFiles[@]}" | |
| 32 do | |
| 33 if [[ "$current" != *"$forwardSlash"* ]]; then | |
| 34 id="$current" | |
|
54
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
35 mergerInput+=("$id") |
| 53 | 36 count=1 |
| 37 continue | |
| 38 fi | |
| 39 echo "working on $current" | |
|
54
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
40 fileName=$(basename "$current") |
| 53 | 41 fileName="${fileName%.*}" |
| 42 parsedFileName="$PWD/$fileName.parsed" | |
|
54
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
43 f=$(file "$current") |
| 53 | 44 zipType="Zip archive" |
| 45 zxType="XZ compressed data" | |
| 46 echo "filetype of ${id}: $f" | |
| 47 if [[ "$f" == *"$zipType"* ]] || [[ "$f" == *"$zxType"* ]] | |
| 48 then | |
| 49 echo "<tr><td>Sample $count of patient $id is an archive file, using IMGT Loader</td></tr>" >> $html | |
| 50 fileName=$(basename $current) | |
| 51 bash ${dir}/imgt_loader/imgt_loader.sh $current $parsedFileName "${fileName}" | |
| 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 | |
| 54 bash ${dir}/igblast/igblast.sh $current "$species" $locus $parsedFileName | |
| 55 fi | |
|
54
81b3eb11ed2c
"planemo upload commit 6c0195cc4de6a34e2c46d875be4fc2157a21cdf6"
rhpvorderman
parents:
53
diff
changeset
|
56 mergerInput+=("$parsedFileName") |
| 53 | 57 count=$((count+1)) |
| 58 done | |
| 59 | |
| 60 echo "<tr><td>-----------------------------------</td></tr>" >> $html | |
| 61 echo "<tr><td>merging</td></tr>" >> $html | |
| 62 | |
| 63 bash $dir/experimental_design/experimental_design.sh ${mergerInput[*]} $PWD/merged.txt | |
| 64 | |
| 65 echo "<tr><td>done</td></tr>" >> $html | |
| 66 echo "<tr><td>-----------------------------------</td></tr>" >> $html | |
| 67 echo "<tr><td>plotting</td></tr>" >> $html | |
| 68 | |
| 69 echo "after ED" | |
| 70 | |
| 71 bash $dir/report_clonality/r_wrapper.sh $PWD/merged.txt $2 $outputDir $clonalType "$species" "$locus" $filterproductive $clonality_method | |
| 72 |
