comparison fastx_toolkit-0.0.6/install_galaxy_files.sh @ 3:997f5136985f draft default tip

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