Mercurial > repos > davidvanzessen > vidjil_with_browser
comparison vidjil.sh @ 7:e55dfd9a8c00 draft default tip
Uploaded
| author | davidvanzessen |
|---|---|
| date | Thu, 12 Feb 2015 10:47:15 -0500 |
| parents | 7346cd210a43 |
| children |
comparison
equal
deleted
inserted
replaced
| 6:7346cd210a43 | 7:e55dfd9a8c00 |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 set -e | 2 set -e |
| 3 | 3 |
| 4 inputFile=$1 | 4 inputFile=$1 |
| 5 outputFile=$2 | 5 id=$2 |
| 6 outputDir=$3 | 6 outputFile=$3 |
| 7 database=$4 | 7 outputDir=$4 |
| 8 limit_reads=$5 | 8 database=$5 |
| 9 limit_ratio=$6 | 9 limit_reads=$6 |
| 10 selection=$7 | 10 limit_ratio=$7 |
| 11 germline=$8 | 11 selection=$8 |
| 12 germline=$9 | |
| 13 fastaFile=${10} | |
| 12 | 14 |
| 15 wd="$PWD" | |
| 13 dir="$(cd "$(dirname "$0")" && pwd)" | 16 dir="$(cd "$(dirname "$0")" && pwd)" |
| 14 mkdir $outputDir | 17 mkdir $outputDir |
| 18 mkdir $outputDir/data | |
| 19 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 | |
| 15 | 20 |
| 16 unzip $dir/browser.zip -d $outputDir/ > $outputDir/unziplog.log | 21 unzip $dir/browser.zip -d $outputDir/ > $outputDir/unziplog.log |
| 17 | |
| 18 mkdir $outputDir/data | |
| 19 | 22 |
| 20 if [[ "$database" == "download" ]] ; then | 23 if [[ "$database" == "download" ]] ; then |
| 21 echo "Downloading up to date database from IMGT..." | 24 echo "Downloading up to date database from IMGT..." |
| 22 mkdir $outputDir/tmp | 25 mkdir $outputDir/tmp |
| 23 mkdir $outputDir/tmp/germline | 26 mkdir $outputDir/tmp/germline |
| 29 cd $outputDir/tmp | 32 cd $outputDir/tmp |
| 30 else | 33 else |
| 31 cd $dir | 34 cd $dir |
| 32 fi | 35 fi |
| 33 | 36 |
| 37 ./vidjil -G germline/$germline -y all -r ${limit_reads} -% ${limit_ratio} -b $id -o $outputDir/data $inputFile | |
| 34 | 38 |
| 35 inputFiles=$(echo "$inputFile" | tr "| " "\n") | 39 mv $outputDir/data/${id}.vdj.fa $fastaFile |
| 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 | |
| 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 | 40 |
| 55 echo -e \ | 41 echo -e \ |
| 56 "var config = {\n" \ | 42 "var config = {\n" \ |
| 57 " 'file_menu' : {\n" \ | 43 " 'autoload' : 'data/${id}.vidjil'\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; | 44 "}" > $outputDir/js/conf.js; |
| 45 |
