1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
#!/bin/sh
#
# Arguments check and suage information
#
SRC="."
DEST="$1"
if [ -z "$DEST" ]; then
cat<<EOF
FASTX-toolkit Galaxy Installation script.
This script copies the FASTX-Toolkit files into the specified Galaxy directory.
Usage: $0 [GALAXY-DIRECTORY]
GALAXY-DIRECTORY - root directory of the Galaxy server.
EOF
exit
fi
echo
echo "FASTX-toolkit Galaxy Installation script."
echo
#
# Sanity checks for the specified galaxy directory
#
echo -n "Checking Galaxy destination directory..."
[ -d "$DEST" ] ||
{ echo "Error: directory '$DEST' does not exist!" ; exit 1 ; }
[ -r "$DEST/tool_conf.xml" ] ||
{ echo "Error: file '$DEST/tool_conf.xml' does not exist! (is '$DEST' the root of the Galaxy server?)" ; exit 1 ; }
for subdir in tools tool-data test-data static; do
[ -d "$DEST/$subdir" ] ||
{ echo "Error: sub-directory '$DEST/$subdir' does not exist! (is '$DEST' the root of the Galaxy server?)" ; exit 1 ; }
done
echo "ok"
#
# Sanity checks for the FASTX-toolkit files
#
echo -n "Checking FASTX-toolkit source directory..."
[ -r "$SRC/galaxy/fastx_toolkit_conf.xml" ] ||
{ echo "Error: file '$SRC/galaxy/fastx_toolkit_conf.xml' does not exist! (is '$SRC' the root of FASTX-toolkit ?)" ; exit 1 ; }
for subdir in tools tools/fastx_toolkit tool-data test-data static static/fastx_icons; do
[ -d "$SRC/galaxy/$subdir" ] ||
{ echo "Error: sub-directory '$SRC/galaxy/$subdir' does not exist! (is '$SRC' the root of FASTX-toolkit?)" ; exit 1 ; }
done
echo "ok"
#
# Copy FASTX-Toolkit files into Galaxy server
#
echo -n "Creating static/fastx_icons directory..."
mkdir -p "$DEST/static/fastx_icons" || exit 1 ;
echo "OK"
echo -n "Copying static/fastx_icons..."
cp $SRC/galaxy/static/fastx_icons/*.png "$DEST/static/fastx_icons" || exit 1 ;
echo "OK"
echo -n "Copying test-data files..."
cp $SRC/galaxy/test-data/fast* "$DEST/test-data" || exit 1 ;
echo "OK"
echo -n "Copying tool-data files..."
cp $SRC/galaxy/tool-data/fastx_clipper_sequences.txt "$DEST/tool-data/" || exit 1;
echo "OK"
echo -n "Creaing tools/fastx_toolkit directory..."
mkdir -p "$DEST/tools/fastx_toolkit" || exit 1;
echo "OK"
#
# Be extra careful when copying the XML files -
# Ask the user for confirmation if the XML files already exists
# (so that if they were changed, they will not be blindly overwriten)
echo "==="
echo "=== NOTE:"
echo "==="
echo "If the FASTX-toolkit XML files already exist on your galaxy server,"
echo "You will be prompted to confirm overwriting them."
echo "If you have made any changes to the XML files, DO NOT overwrite your files."
echo
echo -n "Copying FASTX-toolkit XML tool configuration..."
cp -i $SRC/galaxy/tools/fastx_toolkit/*.{xml,sh} "$DEST/tools/fastx_toolkit"
echo "ok"
#
# Instruct the user what to do next
#
cat<<EOF
FASTX-toolkit files copied to your galaxy server directory.
Additionally, you'll need to make the following manual configurations:
1. Add the content of
$SRC/galaxy/fastx_toolkit_conf.xml
to
$DEST/tool_conf.xml
2. Update the adapters file:
$DEST/tool-data/fastx_clipper_sequences.txt
And add valid adapters/linkers.
3. Edit "fastx_barcode_splitter_galaxy_wrapper.sh", change
The two variables BASEPATH and PUBLICURL to valid path/URL.
See README for detailed explanation (under the
"Special configuration for Barcode-Splitter" section).
EOF
|