0
|
1 #!/bin/bash
|
6
|
2 set -e
|
0
|
3
|
|
4 inputFile=$1
|
|
5 outputFile=$2
|
|
6 outputDir=$3
|
|
7 database=$4
|
|
8 limit_reads=$5
|
|
9 limit_ratio=$6
|
6
|
10 selection=$7
|
|
11 germline=$8
|
0
|
12
|
|
13 dir="$(cd "$(dirname "$0")" && pwd)"
|
|
14 mkdir $outputDir
|
|
15
|
|
16 unzip $dir/browser.zip -d $outputDir/ > $outputDir/unziplog.log
|
|
17
|
6
|
18 mkdir $outputDir/data
|
0
|
19
|
|
20 if [[ "$database" == "download" ]] ; then
|
|
21 echo "Downloading up to date database from IMGT..."
|
|
22 mkdir $outputDir/tmp
|
|
23 mkdir $outputDir/tmp/germline
|
|
24 cp $dir/germline/get-germline $outputDir/tmp/germline
|
|
25 cp $dir/germline/split-from-imgt.py $outputDir/tmp/germline
|
|
26 cp $dir/vidjil $outputDir/tmp
|
|
27 cd $outputDir/tmp/germline
|
|
28 ./get-germline 2>&1
|
|
29 cd $outputDir/tmp
|
|
30 else
|
|
31 cd $dir
|
|
32 fi
|
|
33
|
|
34
|
6
|
35 inputFiles=$(echo "$inputFile" | tr "| " "\n")
|
|
36 files_for_config=""
|
|
37 last_file=""
|
|
38 for id_file in $inputFiles
|
|
39 do
|
|
40 tmp=($(echo "${id_file}" | tr ";" "\n"))
|
|
41 id=${tmp[0]}
|
|
42 file=${tmp[1]}
|
|
43
|
|
44 ./vidjil -G germline/$germline -y all -r ${limit_reads} -% ${limit_ratio} -b $id -o $outputDir/data $file
|
|
45
|
|
46 if [[ "$files_for_config" != "" ]] ; then
|
|
47 files_for_config="${files_for_config},"
|
|
48 fi
|
|
49 files_for_config="${files_for_config}'${id}.vidjil'"
|
|
50 last_file="${id}.vidjil"
|
|
51 done
|
0
|
52
|
|
53 echo "<html><center><h1><a href='index.html'>Click here for the results</a></h1>Tip: Open it in a new tab (middle mouse button or right mouse button -> 'open in new tab' on the link above)</center></html>" > $outputFile
|
|
54
|
6
|
55 echo -e \
|
|
56 "var config = {\n" \
|
|
57 " 'file_menu' : {\n" \
|
|
58 " 'path' : 'data/',\n" \
|
|
59 " 'file' : [\n" \
|
|
60 " ${files_for_config}\n" \
|
|
61 " ]\n" \
|
|
62 " },\n" \
|
|
63 " 'autoload' : 'data/${last_file}'\n" \
|
|
64 "}" > $outputDir/js/conf.js;
|