diff wrapper.sh @ 5:048f8cdbb6d2 draft default tip

Uploaded
author davidvanzessen
date Thu, 07 Aug 2014 10:19:53 -0400
parents fac36e2248fd
children
line wrap: on
line diff
--- a/wrapper.sh	Wed Jul 23 10:13:05 2014 -0400
+++ b/wrapper.sh	Thu Aug 07 10:19:53 2014 -0400
@@ -2,17 +2,31 @@
 dir="$(cd "$(dirname "$0")" && pwd)"
 
 input=$1
-ref=$2
-output=$3
-f=$(file $input)
-zipType="Zip archive"
-if [[ "$f" == *"$zipType"* ]]
-then
-	echo "Zip archive, assuming IMGT output file"
-	echo "Trying: unzip $input -d $PWD/files/"
-	unzip $input -d $PWD/files/ > $PWD/unziplog.log
-	cat $PWD/files/*/2_* | cut -f2,4,7 > $PWD/gappednt.txt
-	python $dir/script_imgt.py --input $PWD/gappednt.txt --ref $ref --output $output
-else
-	python $dir/script_xlsx.py --input $input --ref $ref --output $output
-fi
+ids=$2
+ref=$3
+output=$4
+
+input=($input)
+
+ids=($ids)
+
+first="${input[0]}"
+
+count=0
+for current in ${input[@]}
+do
+	f=$(file $current)
+	zipType="Zip archive"
+	if [[ "$f" == *"$zipType"* ]]
+	then
+		id=${ids[$count]}
+		unzip $current -d $PWD/$id/ >> $PWD/unziplog.log
+		filename="$PWD/gappednt_${id}.txt"
+		cat $PWD/$id/*/2_* | cut -f2,4,7 > $filename
+		python $dir/script_imgt.py --input $filename --ref $ref --output $output --id $id
+	else
+		python $dir/script_xlsx.py --input $current --ref $ref --output $output
+	fi
+	count=$((count+1))
+done
+