diff weeder2_wrapper.sh @ 2:3c5f10f7dd40 draft

Updated to tool version 2.0.1 (use data table to locate freqfiles).
author pjbriggs
date Fri, 27 Nov 2015 11:06:28 -0500
parents 496bc4eff47e
children 89315bdc1a8c
line wrap: on
line diff
--- a/weeder2_wrapper.sh	Tue Dec 09 11:27:19 2014 -0500
+++ b/weeder2_wrapper.sh	Fri Nov 27 11:06:28 2015 -0500
@@ -2,31 +2,40 @@
 #
 # Wrapper script to run weeder2 as a Galaxy tool
 #
-# Usage: weeder_wrapper.sh FASTA_IN SPECIES_CODE MOTIFS_OUT MATRIX_OUT [ ARGS... ]
+# Usage: weeder_wrapper.sh FASTA_IN SPECIES_CODE FREQFILES_DIR MOTIFS_OUT MATRIX_OUT [ ARGS... ]
 #
 # ARGS: one or more arguments to supply directly to weeder2
 #
 # Process command line
 FASTA_IN=$1
 SPECIES_CODE=$2
-MOTIFS_OUT=$3
-MATRIX_OUT=$4
+FREQFILES_DIR=$3
+MOTIFS_OUT=$4
+MATRIX_OUT=$5
 #
 # Other arguments
 ARGS=""
-while [ ! -z "$5" ] ; do
-    ARGS="$ARGS $5"
+while [ ! -z "$6" ] ; do
+    ARGS="$ARGS $6"
     shift
 done
 #
 # Link to input file
 ln -s $FASTA_IN
 #
+# Locate the FreqFiles directory
+if [ $FREQFILES_DIR == "." ] ; then
+    # Use the files in the Weeder2 distribution
+    freqfiles_dir=$WEEDER_FREQFILES_DIR
+else
+    # Alternative location
+    freqfiles_dir=$FREQFILES_DIR
+fi
+#
 # Link to the FreqFiles directory as weeder2 executable
 # expects it to be the same directory
-freqfiles_dir=$WEEDER_FREQFILES_DIR
 if [ -d $freqfiles_dir ] ; then
-    echo "Linking to FreqFiles directory"
+    echo "Linking to FreqFiles directory: $freqfiles_dir"
     ln -s $freqfiles_dir FreqFiles
 else
     echo "ERROR FreqFiles directory not found" >&2