<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://biowerkzeug.org/index.php?action=history&amp;feed=atom&amp;title=Hippo_setup.sh</id>
	<title>Hippo setup.sh - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://biowerkzeug.org/index.php?action=history&amp;feed=atom&amp;title=Hippo_setup.sh"/>
	<link rel="alternate" type="text/html" href="https://biowerkzeug.org/index.php?title=Hippo_setup.sh&amp;action=history"/>
	<updated>2026-04-29T13:16:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://biowerkzeug.org/index.php?title=Hippo_setup.sh&amp;diff=129&amp;oldid=prev</id>
		<title>Oliver: script and example usage</title>
		<link rel="alternate" type="text/html" href="https://biowerkzeug.org/index.php?title=Hippo_setup.sh&amp;diff=129&amp;oldid=prev"/>
		<updated>2008-10-18T20:30:08Z</updated>

		<summary type="html">&lt;p&gt;script and example usage&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;hippo_setup.sh&amp;#039;&amp;#039;&amp;#039; bash script [http://forums.biowerkzeug.org/viewtopic.php?f=2&amp;amp;t=23 automates] the [[Simulations|setup of hippo simulations]]. &lt;br /&gt;
&lt;br /&gt;
Copy and paste the script below into a file, name it &amp;lt;tt&amp;gt;setup_hippo.sh&amp;lt;/tt&amp;gt;, make it executable, install it in your PATH. Set the variable &amp;lt;tt&amp;gt;HIPPO_HOME&amp;lt;/tt&amp;gt; to the directory that you got when unpacking the downloaded hippo.zip file. &lt;br /&gt;
&lt;br /&gt;
Example use:&lt;br /&gt;
 hippo_setup.sh -w  ProteinX_GBSA_MC ${HIPPO_HOME}/testjobs/test/trpzip2_GBSA_MC/hippo_input.txt ../coord/protein_X.pdb&lt;br /&gt;
This would&lt;br /&gt;
* create the working directory &amp;#039;&amp;#039;ProteinX_GBSA_MC&amp;#039;&amp;#039; (and because of the &amp;#039;&amp;#039;-w&amp;#039;&amp;#039; (`wipe&amp;#039;) option it would delete everything in this directory before copying files)&lt;br /&gt;
* copy data files&lt;br /&gt;
* copy a working executable (the &amp;#039;&amp;#039;-m&amp;#039;&amp;#039; (mpi) option would indicate that we want an executable that can run in parallel)&lt;br /&gt;
* copy a template for the input file &amp;#039;&amp;#039;hippo_input.txt&amp;#039;&amp;#039; from one of the test jobs&lt;br /&gt;
* copy the protein structure&lt;br /&gt;
&lt;br /&gt;
Then you would edit the command input file &amp;#039;&amp;#039;ProteinX_GBSA_MC/hippo_input.txt&amp;#039;&amp;#039; to suit your needs. Finally, run hippo:&lt;br /&gt;
 ./hippo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/bash&lt;br /&gt;
# Copyright (c) 2008 Oliver Beckstein &amp;lt;orbeckst@gmail.com&amp;gt;&lt;br /&gt;
# This script is made available under the terms of the GNU Public License v2.&lt;br /&gt;
# http://www.gnu.org/licenses/gpl-2.0.html#SEC1&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# prepare for a hippo run by setting up the local working directory&lt;br /&gt;
&lt;br /&gt;
#------------------------------------------------------------&lt;br /&gt;
# CUSTOMIZATION&lt;br /&gt;
# - set HIPPO_HOME to the directory where the hippo executables and &lt;br /&gt;
#   support files are located, eg &amp;#039;${HOME}/hippo&amp;#039;&lt;br /&gt;
# - put this script somewhere into your PATH&lt;br /&gt;
#&lt;br /&gt;
: ${HIPPO_HOME:=&amp;quot;${HOME}/Library/hippo&amp;quot;}&lt;br /&gt;
#&lt;br /&gt;
#------------------------------------------------------------&lt;br /&gt;
# &lt;br /&gt;
# HIPPO_HOME can be set from environment or commandline -D HIPPO_HOME&lt;br /&gt;
#: ${HIPPO_HOME:=$(dirname &amp;quot;$0&amp;quot;)/../hippo_r26}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
usage=&amp;quot;$0 [options] work_dir [input_files ...]&lt;br /&gt;
&lt;br /&gt;
This script sets up the work_dir for a run of hippo. work_dir is&lt;br /&gt;
created unless it exists already. It hard-links the hippo executable&lt;br /&gt;
and the data files into the directory.&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
-h              help&lt;br /&gt;
-D HIPPO_HOME   directory where hippo and files reside&lt;br /&gt;
-m              look for mpi-enabled binaries&lt;br /&gt;
-w              wipe the work_dir (&amp;#039;rm -rf work_dir&amp;#039;) before setting up&lt;br /&gt;
                making sure that we start from a clean slate&lt;br /&gt;
&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function die () {&lt;br /&gt;
    local msg=&amp;quot;$1&amp;quot; err=${2:-1}&lt;br /&gt;
    echo 1&amp;gt;&amp;amp;2 &amp;quot;ERROR: $msg [status=$err]&amp;quot;&lt;br /&gt;
    exit $err&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function pick_binary () {&lt;br /&gt;
   # find working executable &lt;br /&gt;
   # we&amp;#039;ll use the first one that only complains about missing input file&lt;br /&gt;
   local hippo_dir=&amp;quot;$1&amp;quot; use_mpi=&amp;quot;$2&amp;quot;&lt;br /&gt;
   local _hippo_binaries=&amp;quot;hippo hippo_p3&amp;quot;&lt;br /&gt;
   local hippo=&amp;quot;not_found&amp;quot;&lt;br /&gt;
   local tmpdir=`mktemp -d`&lt;br /&gt;
   pushd &amp;gt;/dev/null &amp;quot;$tmpdir&amp;quot; || die &amp;quot;Failed to set up testing area&amp;quot;&lt;br /&gt;
   for h in ${_hippo_binaries}; do&lt;br /&gt;
       if [ &amp;quot;${use_mpi}&amp;quot; = 1 ]; then&lt;br /&gt;
	   exe=&amp;quot;${hippo_dir}/${h}_mpi&amp;quot;&lt;br /&gt;
       else&lt;br /&gt;
	   exe=&amp;quot;${hippo_dir}/${h}&amp;quot;&lt;br /&gt;
       fi&lt;br /&gt;
       if ${exe} 2&amp;gt;&amp;amp;1 | egrep &amp;quot;Could not open file: hippo_input.txt&amp;quot; &amp;gt;/dev/null; then&lt;br /&gt;
	   hippo=${exe}&lt;br /&gt;
	   break&lt;br /&gt;
       fi&lt;br /&gt;
   done&lt;br /&gt;
   if [ &amp;quot;${hippo}&amp;quot; = &amp;quot;not_found&amp;quot; ]; then&lt;br /&gt;
       ARCH=$(uname -m); &lt;br /&gt;
       OS=$(uname -s);&lt;br /&gt;
       die &amp;quot;No usable hippo executable found (MPI=${use_mpi}); see if there is one at&lt;br /&gt;
http://www.biowerkzeug.com for your architecture ${ARCH} and operating&lt;br /&gt;
system ${OS}. &amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
   popd &amp;gt;/dev/null&lt;br /&gt;
   rm -r &amp;quot;${tmpdir}&amp;quot; || die &amp;quot;Failed to remove tmpdir... weird&amp;quot;&lt;br /&gt;
   echo &amp;quot;${hippo}&amp;quot;&lt;br /&gt;
   return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#set -x&lt;br /&gt;
&lt;br /&gt;
# defaults&lt;br /&gt;
USE_MPI=0&lt;br /&gt;
WIPE_WORK_DIR=0&lt;br /&gt;
&lt;br /&gt;
# arg processing&lt;br /&gt;
TEMP=`getopt -o hmwD: -n &amp;#039;hippo_setup.sh&amp;#039; -- &amp;quot;$@&amp;quot;`&lt;br /&gt;
opterr=$?&lt;br /&gt;
[ $opterr != 0 ] &amp;amp;&amp;amp; die &amp;quot;Error parsing the commandline.&amp;quot; $opterr&lt;br /&gt;
eval set -- &amp;quot;$TEMP&amp;quot;&lt;br /&gt;
while true; do&lt;br /&gt;
    case &amp;quot;$1&amp;quot; in&lt;br /&gt;
	-h) echo -e &amp;quot;${usage}&amp;quot;; exit 0;;&lt;br /&gt;
	-D) HIPPO_HOME=&amp;quot;$2&amp;quot;; shift;;&lt;br /&gt;
	-m) USE_MPI=1;;&lt;br /&gt;
	-w) WIPE_WORK_DIR=1;; &lt;br /&gt;
	--) shift; break;;&lt;br /&gt;
    esac&lt;br /&gt;
    shift&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
[ -d &amp;quot;${HIPPO_HOME}&amp;quot; ] || die &amp;quot;HIPPO_HOME=${HIPPO_HOME} not found&amp;quot; 1 &lt;br /&gt;
&lt;br /&gt;
HIPPO_EXE=`pick_binary &amp;quot;${HIPPO_HOME}&amp;quot; ${USE_MPI}`&lt;br /&gt;
HIPPO_TOPOLOGY=&amp;quot;${HIPPO_HOME}/hippo_protein_database.dat&amp;quot;&lt;br /&gt;
HIPPO_FF=&amp;quot;${HIPPO_HOME}/oplsaa_forcefield.dat&amp;quot;&lt;br /&gt;
&lt;br /&gt;
test -n &amp;quot;${HIPPO_EXE}&amp;quot; || die &amp;quot;No hippo executable found. Did you set HIPPO_HOME or the -D option?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function setup_hippo () {&lt;br /&gt;
  cp -lf ${HIPPO_EXE} ./hippo &amp;amp;&amp;amp; chmod a+x ./hippo  || return 1&lt;br /&gt;
  cp -lf ${HIPPO_TOPOLOGY} .    || return 2&lt;br /&gt;
  cp -lf ${HIPPO_FF} .          || return 3&lt;br /&gt;
  return 0 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WORK_DIR=&amp;quot;$1&amp;quot;&lt;br /&gt;
shift&lt;br /&gt;
INPUTFILES=&amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
test -n &amp;quot;${WORK_DIR}&amp;quot; || die &amp;quot;No work_dir, see $0 -h for help&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Setting up Hippo run&amp;quot;&lt;br /&gt;
echo &amp;quot;------------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;working directory    ${WORK_DIR}&amp;quot;&lt;br /&gt;
echo &amp;quot;HIPPO_HOME           ${HIPPO_HOME}&amp;quot;&lt;br /&gt;
echo &amp;quot;executable           ${HIPPO_EXE} --&amp;gt; ./hippo&amp;quot;&lt;br /&gt;
echo &amp;quot;force field          ${HIPPO_FF}&amp;quot;&lt;br /&gt;
echo &amp;quot;topology             ${HIPPO_TOPOLOGY}&amp;quot;&lt;br /&gt;
echo &amp;quot;------------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;additional files     ${INPUTFILES}&amp;quot;&lt;br /&gt;
echo &amp;quot;------------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
curdir=&amp;quot;${PWD}&amp;quot;&lt;br /&gt;
if [ ${WIPE_WORK_DIR} = 1 ] &amp;amp;&amp;amp; [ -d &amp;quot;${WORK_DIR}&amp;quot; ]; then&lt;br /&gt;
    case &amp;quot;${WORK_DIR}&amp;quot; in&lt;br /&gt;
	&amp;quot;.&amp;quot;|&amp;quot;..&amp;quot;|&amp;quot;/&amp;quot;|${curdir}) \&lt;br /&gt;
	    die &amp;quot;Refusing to &amp;#039;rm -r WORK_DIR=${WORK_DIR}&amp;#039;&amp;quot;;;&lt;br /&gt;
    esac&lt;br /&gt;
    echo &amp;quot;Wiping WORK_DIR=&amp;#039;${WORK_DIR}&amp;#039; first.&amp;quot;&lt;br /&gt;
    rm -r &amp;quot;${WORK_DIR}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
 &lt;br /&gt;
if ! [ -d &amp;quot;${WORK_DIR}&amp;quot; ]; then&lt;br /&gt;
  mkdir -p &amp;quot;${WORK_DIR}&amp;quot; || die &amp;quot;Failed mkdir $WORK_DIR&amp;quot;&lt;br /&gt;
  echo &amp;quot;Created WORK_DIR=&amp;#039;${WORK_DIR}&amp;#039;.&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
cd &amp;quot;${WORK_DIR}&amp;quot; || die &amp;quot;Failed &amp;#039;cd $WORK_DIR&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Linking hippo files...&amp;quot;&lt;br /&gt;
setup_hippo || die &amp;quot;Failed to link required files.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Copying additional files...&amp;quot;&lt;br /&gt;
for f in ${INPUTFILES}; do&lt;br /&gt;
    cp &amp;quot;${curdir}/${f}&amp;quot; . || die &amp;quot;Failed copying additional file $f&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Done&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Oliver</name></author>
	</entry>
</feed>