Mercurial > repos > davidvanzessen > argalaxy_tools
comparison imgt_loader/imgt_loader.sh @ 58:a073fa12ef98 draft
Uploaded
| author | davidvanzessen |
|---|---|
| date | Fri, 18 Mar 2016 08:02:22 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 57:16c7fc1c4bf8 | 58:a073fa12ef98 |
|---|---|
| 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 zxType="XZ compressed data" | |
| 15 | |
| 16 if [[ "$f" == *"$zip7Type"* ]]; then | |
| 17 echo "7-zip" | |
| 18 echo "Trying: 7za e $input -o$PWD/files/" | |
| 19 7za e $input -o$PWD/$name/files | |
| 20 fi | |
| 21 | |
| 22 if [[ "$f" == *"$tarType"* ]] | |
| 23 then | |
| 24 echo "tar archive" | |
| 25 echo "Trying: tar xvf $input -C $PWD/files/" | |
| 26 tar -xvf $input -C $PWD/$name/files | |
| 27 fi | |
| 28 | |
| 29 if [[ "$f" == *"$bzip2Type"* ]] | |
| 30 then | |
| 31 echo "bzip2 compressed data" | |
| 32 echo "Trying: tar jxf $input -C $PWD/files/" | |
| 33 tar -jxf $input -C $PWD/$name/files | |
| 34 fi | |
| 35 | |
| 36 if [[ "$f" == *"$gzipType"* ]] | |
| 37 then | |
| 38 echo "gzip compressed data" | |
| 39 echo "Trying: tar xvzf $input -C $PWD/files/" | |
| 40 tar -xvzf $input -C $PWD/$name/files | |
| 41 fi | |
| 42 | |
| 43 if [[ "$f" == *"$zipType"* ]] | |
| 44 then | |
| 45 echo "Zip archive" | |
| 46 echo "Trying: unzip $input -d $PWD/files/" | |
| 47 unzip $input -d $PWD/$name/files > $PWD/unziplog.log | |
| 48 fi | |
| 49 | |
| 50 if [[ "$f" == *"$rarType"* ]] | |
| 51 then | |
| 52 echo "RAR archive" | |
| 53 echo "Trying: unrar e $input $PWD/files/" | |
| 54 unrar e $input $PWD/$name/files | |
| 55 fi | |
| 56 | |
| 57 if [[ "$f" == *"$zxType"* ]] | |
| 58 then | |
| 59 echo "xz compressed data" | |
| 60 echo "Trying: tar -xJf $input -C $PWD/files/" | |
| 61 tar xJf $input -C $PWD/$name/files | |
| 62 fi | |
| 63 find $PWD/$name/files -iname "1_*" -exec cat {} + > $PWD/$name/summ.txt | |
| 64 find $PWD/$name/files -iname "5_*" -exec cat {} + > $PWD/$name/aa.txt | |
| 65 find $PWD/$name/files -iname "6_*" -exec cat {} + > $PWD/$name/junction.txt | |
| 66 | |
| 67 #python $dir/imgt_loader.py --summ $PWD/$name/summ.txt --aa $PWD/$name/aa.txt --junction $PWD/$name/junction.txt --output $output | |
| 68 | |
| 69 Rscript --verbose $dir/imgt_loader.r $PWD/$name/summ.txt $PWD/$name/aa.txt $PWD/$name/junction.txt $output 2>&1 |
