annotate pal_finder_wrapper.sh @ 4:cb56cc1d5c39 draft

Updates to the palfilter.py utility.
author pjbriggs
date Mon, 21 Mar 2016 06:52:43 -0400
parents e1a14ed7a9d6
children a73c48890bde
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
1 #!/bin/sh
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
2 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
3 # pal_finder_wrapper.sh: run pal_finder perl script as a Galaxy tool
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
4 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
5 # Usage: run_palfinder.sh FASTQ_R1 FASTQ_R2 MICROSAT_SUMMARY PAL_SUMMARY FILTERED_MICROSATS [OPTIONS]
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
6 # run_palfinder.sh --454 FASTA MICROSAT_SUMMARY PAL_SUMMARY [OPTIONS]
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
7 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
8 # Options:
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
9 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
10 # --primer-prefix PREFIX: prefix added to the beginning of all primer names (prPrefixName)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
11 # --2merMinReps N: miniumum number of 2-mer repeat units to detect (0=ignore units of this size)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
12 # --3merMinReps N
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
13 # --4merMinReps N
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
14 # --5merMinReps N
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
15 # --6merMinReps N
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
16 # --primer-mispriming-library FASTA: specify a Fasta file with sequences to avoid amplifying
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
17 # --primer-opt-size VALUE: optimum primer length
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
18 # --primer-min-size VALUE: minimum acceptable primer length
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
19 # --primer-max-size VALUE: maximum acceptable primer length
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
20 # --primer-min-gc VALUE: minimum allowable percentage of Gs and Cs in any primer
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
21 # --primer-max-gc VALUE: maximum allowable percentage of Gs and Cs
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
22 # --primer-gc-clamp VALUE: number of consecutive Gs and Cs at 3' end of both left and right primer
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
23 # --primer-max-end-gc VALUE: max number of Gs or Cs in last five 3' bases of left or right primer
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
24 # --primer-min-tm VALUE: minimum acceptable melting temperature (Celsius) for a primer oligo
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
25 # --primer-max-tm VALUE: maximum acceptable melting temperature (Celsius)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
26 # --primer-opt-tm VALUE: optimum melting temperature (Celsius)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
27 # --primer-pair-max-diff-tm VALUE: max difference between melting temps of left & right primers
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
28 # --output_config_file FNAME: write a copy of the config.txt file to FNAME
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
29 # --filter_microsats FNAME: write output of filter options FNAME
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
30 # -assembly FNAME: run the 'assembly' filter option and write to FNAME
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
31 # -primers: run the 'primers' filter option
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
32 # -occurrences: run the 'occurrences' filter option
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
33 # -rankmotifs: run the 'rankmotifs' filter option
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
34 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
35 # pal_finder is available from http://sourceforge.net/projects/palfinder/
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
36 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
37 # primer3 is available from http://primer3.sourceforge.net/releases.php
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
38 # (nb needs version 2.0.0-alpha)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
39 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
40 # Explicitly set the locations of the pal_finder script, data files and the primer3
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
41 # executable by setting the following variables in the environment:
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
42 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
43 # * PALFINDER_SCRIPT_DIR: location of the pal_finder Perl script (defaults to
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
44 # /usr/bin)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
45 # * PALFINDER_DATA_DIR: location of the pal_finder data files (specifically
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
46 # config.txt and simple.ref; defaults to /usr/share/pal_finder_v0.02.04)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
47 # * PRIMER3_CORE_EXE: name of the primer3_core program, which should include the
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
48 # full path if it's not on the Galaxy user's PATH (defaults to primer3_core)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
49 #
1
771ebe02636f Uploaded version 0.02.04.2: fix bug that causes tool to fail when prefix includes spaces; add explicit dependency on Perl 5.16.3.
pjbriggs
parents: 0
diff changeset
50 echo "### $(basename $0) ###"
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
51 echo $*
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
52 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
53 # Initialise locations of scripts, data and executables
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
54 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
55 # Set these in the environment to overide at execution time
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
56 : ${PALFINDER_SCRIPT_DIR:=/usr/bin}
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
57 : ${PALFINDER_DATA_DIR:=/usr/share/pal_finder_v0.02.04}
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
58 : ${PRIMER3_CORE_EXE:=primer3_core}
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
59 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
60 # Filter script is in the same directory as this script
3
e1a14ed7a9d6 Updated to version 0.02.04.4 (new pal_filter script)
pjbriggs
parents: 2
diff changeset
61 PALFINDER_FILTER=$(dirname $0)/pal_filter.py
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
62 if [ ! -f $PALFINDER_FILTER ] ; then
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
63 echo No $PALFINDER_FILTER script >&2
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
64 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
65 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
66 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
67 # Check that we have all the components
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
68 function have_program() {
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
69 local program=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
70 local got_program=$(which $program 2>&1 | grep "no $(basename $program) in")
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
71 if [ -z "$got_program" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
72 echo yes
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
73 else
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
74 echo no
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
75 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
76 }
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
77 if [ "$(have_program $PRIMER3_CORE_EXE)" == "no" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
78 echo "ERROR primer3_core missing: ${PRIMER3_CORE_EXE} not found" >&2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
79 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
80 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
81 if [ ! -f "${PALFINDER_DATA_DIR}/config.txt" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
82 echo "ERROR pal_finder config.txt not found in ${PALFINDER_DATA_DIR}" >&2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
83 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
84 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
85 if [ ! -f "${PALFINDER_SCRIPT_DIR}/pal_finder_v0.02.04.pl" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
86 echo "ERROR pal_finder_v0.02.04.pl not found in ${PALFINDER_SCRIPT_DIR}" >&2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
87 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
88 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
89 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
90 # Initialise parameters used in the config.txt file
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
91 PRIMER_PREFIX="test"
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
92 MIN_2_MER_REPS=6
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
93 MIN_3_MER_REPS=0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
94 MIN_4_MER_REPS=0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
95 MIN_5_MER_REPS=0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
96 MIN_6_MER_REPS=0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
97 PRIMER_MISPRIMING_LIBRARY=$PALFINDER_DATA_DIR/simple.ref
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
98 PRIMER_OPT_SIZE=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
99 PRIMER_MAX_SIZE=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
100 PRIMER_MIN_SIZE=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
101 PRIMER_MAX_GC=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
102 PRIMER_MIN_GC=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
103 PRIMER_GC_CLAMP=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
104 PRIMER_MAX_END_GC=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
105 PRIMER_OPT_TM=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
106 PRIMER_MAX_TM=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
107 PRIMER_MIN_TM=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
108 PRIMER_PAIR_MAX_DIFF_TM=
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
109 OUTPUT_CONFIG_FILE=
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
110 OUTPUT_ASSEMBLY=
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
111 FILTERED_MICROSATS=
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
112 FILTER_OPTIONS=
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
113 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
114 # Collect command line arguments
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
115 if [ $# -lt 2 ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
116 echo "Usage: $0 FASTQ_R1 FASTQ_R2 MICROSAT_SUMMARY PAL_SUMMARY [OPTIONS]"
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
117 echo " $0 --454 FASTA MICROSAT_SUMMARY PAL_SUMMARY [OPTIONS]"
3
e1a14ed7a9d6 Updated to version 0.02.04.4 (new pal_filter script)
pjbriggs
parents: 2
diff changeset
118 exits
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
119 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
120 if [ "$1" == "--454" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
121 PLATFORM="454"
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
122 FNA=$2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
123 else
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
124 PLATFORM="Illumina"
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
125 FASTQ_R1=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
126 FASTQ_R2=$2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
127 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
128 MICROSAT_SUMMARY=$3
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
129 PAL_SUMMARY=$4
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
130 shift; shift; shift; shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
131 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
132 # Collect command line options
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
133 while [ ! -z "$1" ] ; do
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
134 case "$1" in
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
135 --primer-prefix)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
136 shift
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
137 # Convert all non-alphanumeric characters to underscores in prefix
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
138 PRIMER_PREFIX=$(echo -n $1 | tr -s -c "[:alnum:]" "_")
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
139 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
140 --2merMinReps)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
141 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
142 MIN_2_MER_REPS=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
143 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
144 --3merMinReps)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
145 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
146 MIN_3_MER_REPS=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
147 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
148 --4merMinReps)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
149 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
150 MIN_4_MER_REPS=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
151 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
152 --5merMinReps)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
153 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
154 MIN_5_MER_REPS=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
155 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
156 --6merMinReps)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
157 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
158 MIN_6_MER_REPS=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
159 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
160 --primer-mispriming-library)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
161 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
162 PRIMER_MISPRIMING_LIBRARY=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
163 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
164 --primer-opt-size)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
165 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
166 PRIMER_OPT_SIZE=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
167 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
168 --primer-max-size)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
169 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
170 PRIMER_MAX_SIZE=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
171 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
172 --primer-min-size)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
173 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
174 PRIMER_MIN_SIZE=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
175 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
176 --primer-max-gc)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
177 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
178 PRIMER_MAX_GC=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
179 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
180 --primer-min-gc)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
181 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
182 PRIMER_MIN_GC=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
183 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
184 --primer-gc-clamp)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
185 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
186 PRIMER_GC_CLAMP=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
187 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
188 --primer-max-end-gc)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
189 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
190 PRIMER_MAX_END_GC=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
191 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
192 --primer-opt-tm)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
193 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
194 PRIMER_OPT_TM=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
195 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
196 --primer-max-tm)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
197 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
198 PRIMER_MAX_TM=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
199 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
200 --primer-min-tm)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
201 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
202 PRIMER_MIN_TM=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
203 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
204 --primer-pair-max-diff-tm)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
205 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
206 PRIMER_PAIR_MAX_DIFF_TM=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
207 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
208 --output_config_file)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
209 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
210 OUTPUT_CONFIG_FILE=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
211 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
212 --filter_microsats)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
213 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
214 FILTERED_MICROSATS=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
215 ;;
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
216 -primers|-occurrences|-rankmotifs)
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
217 FILTER_OPTIONS="$FILTER_OPTIONS $1"
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
218 ;;
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
219 -assembly)
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
220 FILTER_OPTIONS="$FILTER_OPTIONS $1"
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
221 shift
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
222 OUTPUT_ASSEMBLY=$1
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
223 ;;
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
224 *)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
225 echo Unknown option: $1 >&2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
226 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
227 ;;
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
228 esac
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
229 shift
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
230 done
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
231 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
232 # Check that primer3_core is available
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
233 got_primer3=`which $PRIMER3_CORE_EXE 2>&1 | grep -v "no primer3_core in"`
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
234 if [ -z "$got_primer3" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
235 echo ERROR primer3_core not found >&2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
236 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
237 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
238 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
239 # Set up the working dir
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
240 if [ "$PLATFORM" == "Illumina" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
241 # Paired end Illumina data as input
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
242 if [ $FASTQ_R1 == $FASTQ_R2 ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
243 echo ERROR R1 and R2 fastqs are the same file >&2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
244 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
245 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
246 ln -s $FASTQ_R1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
247 ln -s $FASTQ_R2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
248 fastq_r1=$(basename $FASTQ_R1)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
249 fastq_r2=$(basename $FASTQ_R2)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
250 else
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
251 # 454 data as input
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
252 ln -s $FNA
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
253 fna=$(basename $FNA)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
254 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
255 ln -s $PRIMER_MISPRIMING_LIBRARY
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
256 PRIMER_MISPRIMING_LIBRARY=$(basename $PRIMER_MISPRIMING_LIBRARY)
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
257 mkdir Output
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
258 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
259 # Copy in the default config.txt file
1
771ebe02636f Uploaded version 0.02.04.2: fix bug that causes tool to fail when prefix includes spaces; add explicit dependency on Perl 5.16.3.
pjbriggs
parents: 0
diff changeset
260 echo "### Creating config.txt file for pal_finder run ###"
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
261 /bin/cp $PALFINDER_DATA_DIR/config.txt .
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
262 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
263 # Update the config.txt file with new values
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
264 function set_config_value() {
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
265 local key=$1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
266 local value=$2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
267 local config_txt=$3
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
268 if [ -z "$value" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
269 echo "No value for $key, left as default"
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
270 else
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
271 echo Setting "$key" to "$value"
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
272 sed -i 's,^'"$key"' .*,'"$key"' '"$value"',' $config_txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
273 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
274 }
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
275 # Input files
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
276 set_config_value platform $PLATFORM config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
277 if [ "$PLATFORM" == "Illumina" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
278 set_config_value inputFormat fastq config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
279 set_config_value pairedEnd 1 config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
280 set_config_value inputReadFile $fastq_r1 config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
281 set_config_value pairedReadFile $fastq_r2 config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
282 else
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
283 set_config_value inputFormat fasta config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
284 set_config_value pairedEnd 0 config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
285 set_config_value input454reads $fna config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
286 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
287 # Output files
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
288 set_config_value MicrosatSumOut Output/microsat_summary.txt config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
289 set_config_value PALsummaryOut Output/PAL_summary.txt config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
290 # Microsat info
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
291 set_config_value 2merMinReps $MIN_2_MER_REPS config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
292 set_config_value 3merMinReps $MIN_3_MER_REPS config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
293 set_config_value 4merMinReps $MIN_4_MER_REPS config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
294 set_config_value 5merMinReps $MIN_5_MER_REPS config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
295 set_config_value 6merMinReps $MIN_6_MER_REPS config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
296 # Primer3 settings
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
297 set_config_value primer3input Output/pr3in.txt config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
298 set_config_value primer3output Output/pr3out.txt config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
299 set_config_value primer3executable $PRIMER3_CORE_EXE config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
300 set_config_value prNamePrefix ${PRIMER_PREFIX}_ config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
301 set_config_value PRIMER_MISPRIMING_LIBRARY "$PRIMER_MISPRIMING_LIBRARY" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
302 set_config_value PRIMER_OPT_SIZE "$PRIMER_OPT_SIZE" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
303 set_config_value PRIMER_MIN_SIZE "$PRIMER_MIN_SIZE" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
304 set_config_value PRIMER_MAX_SIZE "$PRIMER_MAX_SIZE" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
305 set_config_value PRIMER_MIN_GC "$PRIMER_MIN_GC" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
306 set_config_value PRIMER_MAX_GC "$PRIMER_MAX_GC" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
307 set_config_value PRIMER_GC_CLAMP "$PRIMER_GC_CLAMP" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
308 set_config_value PRIMER_MAX_END_GC "$PRIMER_MAX_END_GC" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
309 set_config_value PRIMER_MIN_TM "$PRIMER_MIN_TM" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
310 set_config_value PRIMER_MAX_TM "$PRIMER_MAX_TM" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
311 set_config_value PRIMER_OPT_TM "$PRIMER_OPT_TM" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
312 set_config_value PRIMER_PAIR_MAX_DIFF_TM "$PRIMER_PAIR_MAX_DIFF_TM" config.txt
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
313 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
314 # Run pal_finder
1
771ebe02636f Uploaded version 0.02.04.2: fix bug that causes tool to fail when prefix includes spaces; add explicit dependency on Perl 5.16.3.
pjbriggs
parents: 0
diff changeset
315 echo "### Running pal_finder ###"
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
316 perl $PALFINDER_SCRIPT_DIR/pal_finder_v0.02.04.pl config.txt 2>&1 | tee pal_finder.log
1
771ebe02636f Uploaded version 0.02.04.2: fix bug that causes tool to fail when prefix includes spaces; add explicit dependency on Perl 5.16.3.
pjbriggs
parents: 0
diff changeset
317 echo "### pal_finder finised ###"
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
318 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
319 # Check that log ends with "Done!!" message
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
320 if [ -z "$(tail -n 1 pal_finder.log | grep Done!!)" ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
321 echo ERROR pal_finder failed to complete successfully >&2
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
322 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
323 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
324 #
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
325 # Sort outputs into a consistent order regardless of Perl version
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
326 echo "### Sorting outputs ###"
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
327 head -1 Output/PAL_summary.txt > Output/PAL_summary.sorted.txt
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
328 if [ "$PLATFORM" == "Illumina" ] ; then
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
329 grep -v "^readPairID" Output/PAL_summary.txt | sort -k 1 >> Output/PAL_summary.sorted.txt
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
330 else
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
331 grep -v "^SequenceID" Output/PAL_summary.txt | sort -k 1 >> Output/PAL_summary.sorted.txt
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
332 fi
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
333 mv Output/PAL_summary.sorted.txt Output/PAL_summary.txt
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
334 #
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
335 # Run the filtering & assembly script
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
336 if [ ! -z "$FILTERED_MICROSATS" ] || [ ! -z "$OUTPUT_ASSEMBLY" ] ; then
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
337 echo "### Running filtering & assembly script ###"
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
338 python $PALFINDER_FILTER -i $fastq_r1 -j $fastq_r2 -p Output/PAL_summary.txt $FILTER_OPTIONS 2>&1
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
339 if [ $? -ne 0 ] ; then
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
340 echo ERROR $PALFINDER_FILTER exited with non-zero status >&2
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
341 exit 1
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
342 elif [ ! -f PAL_summary.filtered ] ; then
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
343 echo ERROR no output from $PALFINDER_FILTER >&2
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
344 exit 1
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
345 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
346 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
347 #
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
348 # Clean up
1
771ebe02636f Uploaded version 0.02.04.2: fix bug that causes tool to fail when prefix includes spaces; add explicit dependency on Perl 5.16.3.
pjbriggs
parents: 0
diff changeset
349 echo "### Handling output files ###"
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
350 if [ -f Output/microsat_summary.txt ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
351 /bin/mv Output/microsat_summary.txt $MICROSAT_SUMMARY
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
352 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
353 if [ -f Output/PAL_summary.txt ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
354 /bin/mv Output/PAL_summary.txt $PAL_SUMMARY
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
355 fi
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
356 if [ ! -z "$FILTERED_MICROSATS" ] && [ -f PAL_summary.filtered ] ; then
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
357 /bin/mv PAL_summary.filtered $FILTERED_MICROSATS
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
358 fi
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
359 if [ ! -z "$OUTPUT_ASSEMBLY" ] ; then
3
e1a14ed7a9d6 Updated to version 0.02.04.4 (new pal_filter script)
pjbriggs
parents: 2
diff changeset
360 assembly=${fastq_r1%.*}_pal_filter_assembly_output.txt
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
361 if [ -f "$assembly" ] ; then
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
362 /bin/mv $assembly "$OUTPUT_ASSEMBLY"
3
e1a14ed7a9d6 Updated to version 0.02.04.4 (new pal_filter script)
pjbriggs
parents: 2
diff changeset
363 else
e1a14ed7a9d6 Updated to version 0.02.04.4 (new pal_filter script)
pjbriggs
parents: 2
diff changeset
364 echo ERROR no assembly output found >&2
e1a14ed7a9d6 Updated to version 0.02.04.4 (new pal_filter script)
pjbriggs
parents: 2
diff changeset
365 exit 1
2
b6ccc7dd7b02 Version 0.02.04.3.
pjbriggs
parents: 1
diff changeset
366 fi
0
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
367 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
368 if [ ! -z "$OUTPUT_CONFIG_FILE" ] && [ -f config.txt ] ; then
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
369 /bin/mv config.txt $OUTPUT_CONFIG_FILE
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
370 fi
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
371 ##
3f908e7fff4f Uploaded first version to toolshed.
pjbriggs
parents:
diff changeset
372 #