Mercurial > repos > davidvanzessen > complete_immunerepertoire_igg
comparison imgt_loader.sh @ 5:3287f7b9c47d draft
Uploaded
author | davidvanzessen |
---|---|
date | Fri, 05 Sep 2014 04:19:58 -0400 |
parents | |
children | 70c8234acaf3 |
comparison
equal
deleted
inserted
replaced
4:24d5d9120d93 | 5:3287f7b9c47d |
---|---|
1 #!/bin/bash | |
2 input=$1 | |
3 output=$2 | |
4 name=$3 | |
5 dir="$(cd "$(dirname "$0")" && pwd)" | |
6 mkdir -p $PWD/$name/files | |
7 f=$(file $input) | |
8 zip7Type="7-zip archive" | |
9 tarType="tar archive" | |
10 bzip2Type="bzip2 compressed" | |
11 gzipType="gzip compressed" | |
12 zipType="Zip archive" | |
13 rarType="RAR archive" | |
14 | |
15 if [[ "$f" == *"$zip7Type"* ]]; then | |
16 echo "7-zip" | |
17 echo "Trying: 7za e $input -o$PWD/files/" | |
18 7za e $input -o$PWD/$name/files | |
19 fi | |
20 | |
21 if [[ "$f" == *"$tarType"* ]] | |
22 then | |
23 echo "tar archive" | |
24 echo "Trying: tar xvf $input -C $PWD/files/" | |
25 tar xvf $input -C $PWD/$name/files | |
26 fi | |
27 | |
28 if [[ "$f" == *"$bzip2Type"* ]] | |
29 then | |
30 echo "bzip2 compressed data" | |
31 echo "Trying: tar jxf $input -C $PWD/files/" | |
32 tar jxf $input -C $PWD/$name/files | |
33 fi | |
34 | |
35 if [[ "$f" == *"$gzipType"* ]] | |
36 then | |
37 echo "gzip compressed data" | |
38 echo "Trying: tar xvzf $input -C $PWD/files/" | |
39 tar xvzf $input -C $PWD/$name/files | |
40 fi | |
41 | |
42 if [[ "$f" == *"$zipType"* ]] | |
43 then | |
44 echo "Zip archive" | |
45 echo "Trying: unzip $input -d $PWD/files/" | |
46 unzip $input -d $PWD/$name/files > $PWD/unziplog.log | |
47 fi | |
48 | |
49 if [[ "$f" == *"$rarType"* ]] | |
50 then | |
51 echo "RAR archive" | |
52 echo "Trying: unrar e $input $PWD/files/" | |
53 unrar e $input $PWD/$name/files | |
54 fi | |
55 find $PWD/$name/files -iname "1_*" -exec cat {} + > $PWD/$name/summ.txt | |
56 find $PWD/$name/files -iname "5_*" -exec cat {} + > $PWD/$name/aa.txt | |
57 find $PWD/$name/files -iname "6_*" -exec cat {} + > $PWD/$name/junction.txt | |
58 | |
59 python $dir/imgt_loader.py --summ $PWD/$name/summ.txt --aa $PWD/$name/aa.txt --junction $PWD/$name/junction.txt --output $output |