Mercurial > repos > lparsons > fastx_barcode_splitter_enhanced
diff fastx_barcode_splitter_galaxy_wrapper.sh @ 4:0fb7e9130a70 draft default tip
planemo upload for repository https://github.com/lparsons/galaxy_tools/tree/master/tools/fastx_barcode_splitter_enhanced commit 460463a5406419fe8e113467bdb8bd093d21e7c5
author | lparsons |
---|---|
date | Mon, 02 May 2016 17:04:32 -0400 |
parents | 32304398ef67 |
children |
line wrap: on
line diff
--- a/fastx_barcode_splitter_galaxy_wrapper.sh Fri Mar 11 17:24:31 2016 -0500 +++ b/fastx_barcode_splitter_galaxy_wrapper.sh Mon May 02 17:04:32 2016 -0400 @@ -17,21 +17,18 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Modified by Lance Parsons (lparsons@princeton.edu) -# 2011-03-15 Adapted to allow galaxy to determine filetype -# 2015-10-21 Updated to make compatible with OSX (BSD sed) -# 2015-11-13 Removed LIBRARY_NAME, no longer needed +# 2011-03-15 Adapted to allow galaxy to determine filetype +# 2015-10-21 Updated to make compatible with OSX (BSD sed) +# 2015-11-13 Removed LIBRARY_NAME, no longer needed +# 2016-04-28 Output summary as simple tabular output -#This is a shell script wrapper for 'fastx_barcode_splitter.pl' +# This is a shell script wrapper for 'fastx_barcode_splitter.pl' # # 1. Output files are saved at the dataset's files_path directory. -# -# 2. 'fastx_barcode_splitter.pl' outputs a textual table. -# This script turns it into pretty HTML with working URL -# (so lazy users can just click on the URLs and get their files) if [ "$1x" = "x" ]; then - echo "Usage: $0 [BARCODE FILE] [FASTQ FILE] [OUTPUT_PATH] [FILETYPE]" >&2 - exit 1 + echo "Usage: $0 [BARCODE FILE] [FASTQ FILE] [OUTPUT_PATH] [FILETYPE]" >&2 + exit 1 fi BARCODE_FILE="$1" @@ -42,22 +39,22 @@ # The rest of the parameters are passed to the split program if [ "${OUTPUT_PATH}x" = "x" ]; then - echo "Usage: $0 [BARCODE FILE] [FASTQ FILE] [OUTPUT_PATH] [FILETYPE]" >&2 - exit 1 + echo "Usage: $0 [BARCODE FILE] [FASTQ FILE] [OUTPUT_PATH] [FILETYPE]" >&2 + exit 1 fi if [ ! -r "$FASTQ_FILE" ]; then - echo "Error: Input file ($FASTQ_FILE) not found!" >&2 - exit 1 + echo "Error: Input file ($FASTQ_FILE) not found!" >&2 + exit 1 fi if [ ! -r "$BARCODE_FILE" ]; then - echo "Error: barcode file ($BARCODE_FILE) not found!" >&2 - exit 1 + echo "Error: barcode file ($BARCODE_FILE) not found!" >&2 + exit 1 fi mkdir -p "$OUTPUT_PATH" if [ ! -d "$OUTPUT_PATH" ]; then - echo "Error: failed to create output path '$OUTPUT_PATH'" >&2 - exit 1 + echo "Error: failed to create output path '$OUTPUT_PATH'" >&2 + exit 1 fi BASEPATH="$OUTPUT_PATH/" @@ -67,13 +64,7 @@ RESULTS=$(gzip -cdf "$FASTQ_FILE" | "$DIRECTORY/fastx_barcode_splitter.pl" --bcfile "$BARCODE_FILE" --prefix "$PREFIX" --suffix "$SUFFIX" "$@") if [ $? != 0 ]; then - echo "error" + echo "error" fi -# -# Convert the textual tab-separated table into simple HTML table -echo "<html><body><table border=1>" -echo "$RESULTS" | sed "s|$BASEPATH\\(.*\\)|\\1|" | \ -perl -n -e '$_ =~ s|\t|</td><td>|g; print "<tr><td>\n$_</td></tr>\n"' -echo "<p>" -echo "</table></body></html>" +echo "$RESULTS" \ No newline at end of file