Mercurial > repos > davidvanzessen > baseline_fasta_generator
comparison wrapper.sh @ 5:048f8cdbb6d2 draft default tip
Uploaded
author | davidvanzessen |
---|---|
date | Thu, 07 Aug 2014 10:19:53 -0400 |
parents | fac36e2248fd |
children |
comparison
equal
deleted
inserted
replaced
4:aa4b95abef11 | 5:048f8cdbb6d2 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 dir="$(cd "$(dirname "$0")" && pwd)" | 2 dir="$(cd "$(dirname "$0")" && pwd)" |
3 | 3 |
4 input=$1 | 4 input=$1 |
5 ref=$2 | 5 ids=$2 |
6 output=$3 | 6 ref=$3 |
7 f=$(file $input) | 7 output=$4 |
8 zipType="Zip archive" | 8 |
9 if [[ "$f" == *"$zipType"* ]] | 9 input=($input) |
10 then | 10 |
11 echo "Zip archive, assuming IMGT output file" | 11 ids=($ids) |
12 echo "Trying: unzip $input -d $PWD/files/" | 12 |
13 unzip $input -d $PWD/files/ > $PWD/unziplog.log | 13 first="${input[0]}" |
14 cat $PWD/files/*/2_* | cut -f2,4,7 > $PWD/gappednt.txt | 14 |
15 python $dir/script_imgt.py --input $PWD/gappednt.txt --ref $ref --output $output | 15 count=0 |
16 else | 16 for current in ${input[@]} |
17 python $dir/script_xlsx.py --input $input --ref $ref --output $output | 17 do |
18 fi | 18 f=$(file $current) |
19 zipType="Zip archive" | |
20 if [[ "$f" == *"$zipType"* ]] | |
21 then | |
22 id=${ids[$count]} | |
23 unzip $current -d $PWD/$id/ >> $PWD/unziplog.log | |
24 filename="$PWD/gappednt_${id}.txt" | |
25 cat $PWD/$id/*/2_* | cut -f2,4,7 > $filename | |
26 python $dir/script_imgt.py --input $filename --ref $ref --output $output --id $id | |
27 else | |
28 python $dir/script_xlsx.py --input $current --ref $ref --output $output | |
29 fi | |
30 count=$((count+1)) | |
31 done | |
32 |