comparison immunerepertoirecombined_imgt/imgtconvert.sh @ 0:e71c59b72669 draft

Uploaded
author davidvanzessen
date Mon, 09 Dec 2013 03:45:21 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e71c59b72669
1 #!/bin/bash
2 dir="$(cd "$(dirname "$0")" && pwd)"
3 mkdir $PWD/$2_$3
4
5
6 #!/bin/bash
7 f=$(file $1)
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 $1 -o$PWD/$2_$3/"
18 7za e $1 -o$PWD/$2_$3/
19 fi
20
21 if [[ "$f" == *"$tarType"* ]]
22 then
23 echo "tar archive"
24 echo "Trying: tar xvf $1 -C $PWD/$2_$3/"
25 tar xvf $1 -C $PWD/$2_$3/
26 fi
27
28 if [[ "$f" == *"$bzip2Type"* ]]
29 then
30 echo "bzip2 compressed data"
31 echo "Trying: tar jxf $1 -C $PWD/$2_$3/"
32 tar jxf $1 -C $PWD/$2_$3/
33 fi
34
35 if [[ "$f" == *"$gzipType"* ]]
36 then
37 echo "gzip compressed data"
38 echo "Trying: tar xvzf $1 -C $PWD/$2_$3/"
39 tar xvzf $1 -C $PWD/$2_$3/
40 fi
41
42 if [[ "$f" == *"$zipType"* ]]
43 then
44 echo "Zip archive"
45 echo "Trying: unzip $1 -d $PWD/$2_$3/"
46 unzip $1 -d $PWD/$2_$3/
47 fi
48
49 if [[ "$f" == *"$rarType"* ]]
50 then
51 echo "RAR archive"
52 echo "Trying: unrar e $1 $PWD/$2_$3/"
53 unrar e $1 $PWD/$2_$3/
54 fi
55 find $PWD/$2_$3/ -type f | grep -v "1_Summary_\|5_AA-sequences_\|6_Junction_" | xargs rm -f
56 python $dir/imgtconvert.py --input $PWD/$2_$3 --output $4
57