annotate complete.sh @ 47:9ba44c15cad1 draft

Uploaded
author davidvanzessen
date Tue, 18 Jun 2019 05:28:11 -0400
parents d5d203d38c8a
children 124b7fd92a3e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
1 #!/bin/bash
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
2 set -e
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
3 inputFiles=($1)
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
4 outputDir=$3
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
5 outputFile=$3/index.html #$1
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
6 clonalType=$4
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
7 species=$5
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
8 locus=$6
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
9 filterproductive=$7
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
10 clonality_method=$8
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
11
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
12 html=$2
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
13 dir="$(cd "$(dirname "$0")" && pwd)"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
14 array=("$@")
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
15 echo "<html><h3>Progress</h3><table><tr><td>info</td></tr>" > $html
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
16 echo "<tr><td>-----------------------------------</td></tr>" >> $html
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
17
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
18 #mkdir $PWD/igblastdatabase
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
19 #unzip $dir/database.zip -d $PWD/igblastdatabase/
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
20 #export IGDATA=$PWD/igblastdatabase/
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
21
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 7
diff changeset
22 echo "python: `which python`"
d5d203d38c8a Uploaded
davidvanzessen
parents: 7
diff changeset
23 echo "R: `which R`"
d5d203d38c8a Uploaded
davidvanzessen
parents: 7
diff changeset
24 echo "Rscript: `which Rscript`"
d5d203d38c8a Uploaded
davidvanzessen
parents: 7
diff changeset
25
0
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
26 id=""
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
27 forwardSlash="/"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
28 mergerInput=()
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
29 echo "Before loop"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
30 count=1
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
31 for current in "${inputFiles[@]}"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
32 do
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
33 if [[ "$current" != *"$forwardSlash"* ]]; then
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
34 id="$current"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
35 mergerInput+=($id)
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
36 count=1
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
37 continue
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
38 fi
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
39 echo "working on $current"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
40 fileName=$(basename $current)
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
41 fileName="${fileName%.*}"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
42 parsedFileName="$PWD/$fileName.parsed"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
43 f=$(file $current)
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
44 zipType="Zip archive"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
45 zxType="XZ compressed data"
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 7
diff changeset
46 echo "filetype of ${id}: $f"
0
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
47 if [[ "$f" == *"$zipType"* ]] || [[ "$f" == *"$zxType"* ]]
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
48 then
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
49 echo "<tr><td>Sample $count of patient $id is an archive file, using IMGT Loader</td></tr>" >> $html
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
50 fileName=$(basename $current)
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
51 bash ${dir}/imgt_loader/imgt_loader.sh $current $parsedFileName "${fileName}"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
52 else
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
53 echo "<tr><td>Sample $count of patient $id is not a zip file so assuming fasta/fastq, using igBLASTn</td></tr>" >> $html
7
54f6756bacb1 Uploaded
davidvanzessen
parents: 0
diff changeset
54 bash ${dir}/igblast/igblast.sh $current "$species" $locus $parsedFileName
0
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
55 fi
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
56 mergerInput+=($parsedFileName)
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
57 count=$((count+1))
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
58 done
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
59
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
60 echo "<tr><td>-----------------------------------</td></tr>" >> $html
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
61 echo "<tr><td>merging</td></tr>" >> $html
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
62
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
63 bash $dir/experimental_design/experimental_design.sh ${mergerInput[*]} $PWD/merged.txt
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
64
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
65 echo "<tr><td>done</td></tr>" >> $html
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
66 echo "<tr><td>-----------------------------------</td></tr>" >> $html
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
67 echo "<tr><td>plotting</td></tr>" >> $html
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
68
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
69 echo "after ED"
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
70
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
71 bash $dir/report_clonality/r_wrapper.sh $PWD/merged.txt $2 $outputDir $clonalType "$species" "$locus" $filterproductive $clonality_method
afe85eb6572e Uploaded
davidvanzessen
parents:
diff changeset
72