From 1d5452b6f4456b9f5bc94de88272a9c5eb3e347b Mon Sep 17 00:00:00 2001
From: rds <rds>
Date: Tue, 7 Oct 2008 09:54:43 +0000
Subject: [PATCH] rename and recode (to keep instep with otterlace) of script
 to test zmap and otterlace

---
 scripts/test_zmap_otterlace.sh | 119 ---------------------------------
 scripts/zmap_otterlace.sh      |  90 +++++++++++++++++++++++++
 2 files changed, 90 insertions(+), 119 deletions(-)
 delete mode 100755 scripts/test_zmap_otterlace.sh
 create mode 100755 scripts/zmap_otterlace.sh

diff --git a/scripts/test_zmap_otterlace.sh b/scripts/test_zmap_otterlace.sh
deleted file mode 100755
index c38bdf6e6..000000000
--- a/scripts/test_zmap_otterlace.sh
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/bin/sh
-############################################################
-# Script to test zmap with otterlace
-
-# Change these few variables to point to the correct places
-
-# This should be the current live code for otter.
-# Try ls -lt /software/anacode/otter
-RELEASE=otter_rel47_zmap
-
-# Change the location of this to be where your zmap to test is.
-ZMAP_TO_TEST=""
-ZMAP_TO_TEST=/var/tmp/rds/ZMap/src/build/linux
-
-############################################################
-# Nothing much to change below here...
-
-SOFTWARE=/software/anacode
-OTTER_CONFIG=$HOME/.otter_config
-OTTER_HOME=$SOFTWARE/otter/$RELEASE
-export OTTER_HOME
-
-if [ ! -d $OTTER_HOME ]; then
-    echo
-    echo "This executable is not available at the moment."
-    echo "Please try the non-test version."
-    echo
-    exit 1
-fi
-
-script='otterlace'
-
-#. $SOFTWARE/bin/setup_anacode_env
-
-# This should be in setup_env
-################## START OF SETUP_ENV ######################
-PERL5LIB="\
-$OTTER_HOME/tk:\
-$OTTER_HOME/PerlModules:\
-$OTTER_HOME/ensembl-ace:\
-$OTTER_HOME/ensembl-otter/modules:\
-$OTTER_HOME/ensembl-pipeline/modules:\
-$OTTER_HOME/ensembl/modules:\
-$OTTER_HOME/ensembl_head/modules:\
-$OTTER_HOME/bioperl-0.7.2:\
-$OTTER_HOME/bioperl-1.2.3-patched:\
-$OTTER_HOME/biodas-1.02:\
-$OTTER_HOME/perl"
-export PERL5LIB
-
-otterlib="$OTTER_HOME/lib"
-if [ -n "$LD_LIBRARY_PATH" ]
-then
-    LD_LIBRARY_PATH="$otterlib:$LD_LIBRARY_PATH"
-else
-    LD_LIBRARY_PATH="$otterlib"
-fi
-export LD_LIBRARY_PATH
-
-otterbin="$OTTER_HOME/bin"
-if [ -n "$PATH" ]
-then
-    PATH="$otterbin:$PATH"
-else
-    PATH="$otterbin"
-fi
-export PATH
-
-#PFETCH_SERVER_LIST=localhost:22400
-#export PFETCH_SERVER_LIST
-
-# Settings for wublast needed by local blast searches
-WUBLASTFILTER=/software/anacode/bin/wublast/filter
-export WUBLASTFILTER
-WUBLASTMAT=/software/anacode/bin/wublast/matrix
-export WUBLASTMAT
-
-# Some setup for acedb
-ACEDB_NO_BANNER=1
-export ACEDB_NO_BANNER
-
-#################### END OF SETUP_ENV #######################
-
-# Now _prepend_ our path to the PATH setup by above.
-
-#emboss_prefix=/nfs/team71/analysis/rds/emboss
-
-if [ "x$emboss_prefix" != "x" ]; then
-    PATH="$emboss_prefix/bin:$PATH"
-    if [ "x$LD_LIBRARY_PATH" == "x" ]; then
-	LD_LIBRARY_PATH="$emboss_prefix/lib"
-    else
-	LD_LIBRARY_PATH="$emboss_prefix/lib:$LD_LIBRARY_PATH"
-    fi
-fi
-
-if [ "x$ZMAP_TO_TEST" != "x" ]; then
-    PATH="$ZMAP_TO_TEST:$PATH"
-fi
-
-
-enable_zmap()
-{
-    echo "[client]"           >> $OTTER_CONFIG
-    echo "show_zmap=enable"   >> $OTTER_CONFIG
-    echo "zmap_main_window=1" >> $OTTER_CONFIG
-}
-
-if [ -f $OTTER_CONFIG ]; then
-    # If it already exists
-    SHOW_ZMAP=`grep show_zmap=enable $OTTER_CONFIG`
-    if [ "x$SHOW_ZMAP" == "x" ]; then
-	enable_zmap
-    fi
-else
-	enable_zmap
-fi
-
-exec /software/bin/perl -w "$OTTER_HOME/tk/$script" $@
diff --git a/scripts/zmap_otterlace.sh b/scripts/zmap_otterlace.sh
new file mode 100755
index 000000000..f6698c184
--- /dev/null
+++ b/scripts/zmap_otterlace.sh
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+SCRIPT_NAME=$(basename $0)
+INITIAL_DIR=$(pwd)
+ SCRIPT_DIR=$(dirname $0)
+if ! echo $SCRIPT_DIR | egrep -q "(^)/" ; then
+    BASE_DIR=$INITIAL_DIR/$SCRIPT_DIR
+else
+    BASE_DIR=$SCRIPT_DIR
+fi
+
+. $BASE_DIR/zmap_functions.sh || { echo "Failed to load zmap_functions.sh"; exit 1; }
+
+
+zmap_message_out "Start of script."
+
+
+# including VARIABLE=VALUE settings from command line
+if [ $# -gt 0 ]; then
+    eval "$*"
+fi
+
+# otter_root is immutable
+otter_root="/software/anacode/otter"
+
+zmap_check ${RELEASE:="otter_production_main"}
+zmap_check ${OTTER_HOME:="$otter_root/$RELEASE"}
+zmap_check ${ZMAP_HOME:="$HOME"}
+zmap_check ${ZMAP_BIN_DIR:="$OTTER_HOME/bin"}
+zmap_check ${TK_OTTER_HOME:=$OTTER_HOME}
+zmap_check ${ACEDB_HOME:="/nfs/disk100/acedb/RELEASE.DEVELOPMENT/bin.LINUX_4"}
+
+export OTTER_HOME ZMAP_HOME
+
+zmap_message_out "Using OTTER_HOME '$OTTER_HOME'"
+zmap_message_out "Using TK_OTTER_HOME '$TK_OTTER_HOME'"
+zmap_message_out "Using ZMAP_HOME '$ZMAP_HOME'"
+zmap_message_out "Using ZMAP_BIN_DIR '$ZMAP_BIN_DIR'"
+
+
+otterlib="$OTTER_HOME/lib"
+if [ -n "$LD_LIBRARY_PATH" ]
+then
+    LD_LIBRARY_PATH="$otterlib:$LD_LIBRARY_PATH"
+else
+    LD_LIBRARY_PATH="$otterlib"
+fi
+export LD_LIBRARY_PATH
+
+otterbin="$ZMAP_BIN_DIR:$OTTER_HOME/bin:/software/anacode/bin:/software/pubseq/bin/EMBOSS-5.0.0/bin"
+if [ -n "$PATH" ]
+then
+    PATH="$otterbin:$PATH"
+else
+    PATH="$otterbin"
+fi
+export PATH
+
+#PFETCH_SERVER_LIST=localhost:22400
+#export PFETCH_SERVER_LIST
+
+# Settings for wublast needed by local blast searches
+WUBLASTFILTER=/software/anacode/bin/wublast/filter
+export WUBLASTFILTER
+WUBLASTMAT=/software/anacode/bin/wublast/matrix
+export WUBLASTMAT
+
+# Some setup for acedb
+ACEDB_NO_BANNER=1
+export ACEDB_NO_BANNER
+
+#cp -f "$OTTER_HOME/acedbrc" ~/.acedbrc
+
+PERL5LIB="\
+$TK_OTTER_HOME/ensembl-otter/tk:\
+$OTTER_HOME/PerlModules:\
+$OTTER_HOME/ensembl-ace:\
+$OTTER_HOME/ensembl-otter/modules:\
+$OTTER_HOME/ensembl-pipeline/modules:\
+$OTTER_HOME/ensembl/modules:\
+$OTTER_HOME/ensembl_head/modules:\
+$OTTER_HOME/bioperl-0.7.2:\
+$OTTER_HOME/bioperl-1.2.3-patched:\
+$OTTER_HOME/biodas-1.02:\
+$OTTER_HOME/perl"
+
+export PERL5LIB
+
+exec /software/bin/perl "$OTTER_HOME/ensembl-otter/tk/otterlace" $@
+
-- 
GitLab