0
|
1 #!/bin/bash
|
|
2 dir="$(cd "$(dirname "$0")" && pwd)"
|
|
3
|
|
4 testID=$1
|
|
5 species=$2
|
|
6 substitutionModel=$3
|
|
7 mutabilityModel=$4
|
|
8 clonal=$5
|
|
9 fixIndels=$6
|
|
10 region=$7
|
2
|
11 inputs=$8
|
|
12 inputs=($inputs)
|
|
13 IDs=$9
|
|
14 IDs=($IDs)
|
|
15 ref=${10}
|
|
16 output=${11}
|
|
17 outID="result"
|
|
18
|
|
19 echo "testID = $testID"
|
|
20 echo "species = $species"
|
|
21 echo "substitutionModel = $substitutionModel"
|
|
22 echo "mutabilityModel = $mutabilityModel"
|
|
23 echo "clonal = $clonal"
|
|
24 echo "fixIndels = $fixIndels"
|
|
25 echo "region = $region"
|
|
26 echo "inputs = ${inputs[@]}"
|
|
27 echo "IDs = ${IDs[@]}"
|
|
28 echo "ref = $ref"
|
|
29 echo "output = $output"
|
|
30 echo "outID = $outID"
|
|
31
|
|
32 fasta="$PWD/baseline.fasta"
|
|
33
|
|
34
|
|
35 count=0
|
|
36 for current in ${inputs[@]}
|
|
37 do
|
|
38 f=$(file $current)
|
|
39 zipType="Zip archive"
|
|
40 if [[ "$f" == *"$zipType"* ]]
|
|
41 then
|
|
42 id=${IDs[$count]}
|
|
43 echo "id=$id"
|
|
44 unzip $current -d $PWD/$id/ >> $PWD/unziplog.log
|
|
45 filename="$PWD/gappednt_${id}.txt"
|
|
46 cat $PWD/$id/*/2_* | cut -f2,4,7 > $filename
|
|
47 python $dir/script_imgt.py --input $filename --ref $ref --output $fasta --id $id
|
|
48 else
|
|
49 python $dir/script_xlsx.py --input $current --ref $ref --output $fasta
|
|
50 fi
|
|
51 count=$((count+1))
|
|
52 done
|
|
53 workdir="$PWD"
|
|
54 cd $dir
|
|
55 Rscript --verbose $dir/Baseline_Main.r $testID $species $substitutionModel $mutabilityModel $clonal $fixIndels $region $fasta $workdir/ $outID 2>&1
|
|
56
|
|
57 echo "$workdir/${outID}.txt"
|
|
58
|
|
59 rows=`tail -n +2 $workdir/${outID}.txt | grep -n 'Group' | grep -Eoh '^[0-9]+' | tr '\n' ' '`
|
|
60 rows=($rows)
|
|
61 unset rows[${#rows[@]}-1]
|
0
|
62
|
|
63 cd $dir
|
2
|
64 Rscript --verbose $dir/comparePDFs.r $workdir/${outID}.RData $output ${rows[@]} 2>&1
|
0
|
65
|
|
66
|
2
|
67
|
0
|
68
|
2
|
69
|