Previous changeset 2:a60283899c6d (2015-04-22) Next changeset 4:14d05f2d511d (2016-07-14) |
Commit message:
Updated to version 0.32.3: add support for FASTQ pairs (dataset collections) |
modified:
README.rst trimmomatic.xml |
added:
install_tool_deps.sh package_trimmomatic.sh run_planemo_tests.sh |
b |
diff -r a60283899c6d -r f8a9a5eaca8a README.rst --- a/README.rst Wed Apr 22 09:36:27 2015 -0400 +++ b/README.rst Wed Sep 23 08:59:23 2015 -0400 |
b |
@@ -58,6 +58,9 @@ ========== ====================================================================== Version Changes ---------- ---------------------------------------------------------------------- +0.32.3 - Add support for FASTQ R1/R2 pairs using dataset collections (input + can be dataset collection, in which case tool also outputs dataset + collections) and improve order and naming of output files. 0.32.2 - Use ``GALAXY_SLOTS`` to set the appropriate number of threads to use at runtime (default is 6). 0.32.1 - Remove ``trimmomatic_adapters.loc.sample`` and hard-code adapter files |
b |
diff -r a60283899c6d -r f8a9a5eaca8a install_tool_deps.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install_tool_deps.sh Wed Sep 23 08:59:23 2015 -0400 |
[ |
@@ -0,0 +1,40 @@ +#!/bin/bash +# +# Install dependencies for Trimmomatic for testing from the command line +# +# Installation directory +TOP_DIR=$1 +if [ -z "$TOP_DIR" ] ; then + echo Usage: $(basename $0) DIR + exit +fi +if [ -z "$(echo $TOP_DIR | grep ^/)" ] ; then + TOP_DIR=$(pwd)/$TOP_DIR +fi +if [ ! -d "$TOP_DIR" ] ; then + mkdir -p $TOP_DIR +fi +cd $TOP_DIR +# Trimmomatic 0.32 +INSTALL_DIR=$TOP_DIR/trimmomatic/0.32 +mkdir -p $INSTALL_DIR +wd=$(mktemp -d) +pushd $wd +wget -q http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/Trimmomatic-0.32.zip +unzip -qq Trimmomatic-0.32.zip +mv Trimmomatic-0.32/trimmomatic-0.32.jar $INSTALL_DIR/ +mv Trimmomatic-0.32/adapters/ $INSTALL_DIR/ +popd +rm -rf $wd/* +rmdir $wd +# Make setup file +cat > trimmomatic/0.32/env.sh <<EOF +#!/bin/sh +# Source this to setup trimmomatic/0.32 +echo Setting up Trimmomatic 0.32 +export TRIMMOMATIC_DIR=$INSTALL_DIR +export TRIMMOMATIC_ADAPTERS_DIR=$INSTALL_DIR/adapters +# +EOF +## +# |
b |
diff -r a60283899c6d -r f8a9a5eaca8a package_trimmomatic.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_trimmomatic.sh Wed Sep 23 08:59:23 2015 -0400 |
[ |
@@ -0,0 +1,24 @@ +#!/bin/sh +# +# Package Trimmomatic tool files into tgz file for upload to +# Galaxy toolshed +# +TGZ=trimmomatic.tgz +if [ -f $TGZ ] ; then + echo $TGZ: already exists, please remove >&2 + exit 1 +fi +tar cvzf $TGZ \ + README.rst \ + trimmomatic.xml \ + trimmomatic.sh \ + tool_dependencies.xml \ + test-data +if [ -f $TGZ ] ; then + echo Created $TGZ +else + echo Failed to created $TGZ >&2 + exit 1 +fi +## +# |
b |
diff -r a60283899c6d -r f8a9a5eaca8a run_planemo_tests.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run_planemo_tests.sh Wed Sep 23 08:59:23 2015 -0400 |
[ |
@@ -0,0 +1,39 @@ +#!/bin/bash +# +# Install dependencies and set up environment for +# trimmomatic tool, then run tests using planemo +# +# Note that any arguments supplied to the script are +# passed directly to the "planemo test..." invocation +# +# e.g. --install_galaxy (to get planemo to create a +# Galaxy instance to run tests) +# +# --galaxy_root DIR (to run tests using existing +# Galaxy instance) +# +# List of dependencies +TOOL_DEPENDENCIES="trimmomatic/0.32" +# Where to find them +TOOL_DEPENDENCIES_DIR=$(pwd)/test.tool_dependencies.trimmomatic +if [ ! -d $TOOL_DEPENDENCIES_DIR ] ; then + echo WARNING $TOOL_DEPENDENCIES_DIR not found >&2 + echo Creating tool dependencies dir + mkdir -p $TOOL_DEPENDENCIES_DIR + echo Installing tool dependencies + $(dirname $0)/install_tool_deps.sh $TOOL_DEPENDENCIES_DIR +fi +# Load dependencies +for dep in $TOOL_DEPENDENCIES ; do + env_file=$TOOL_DEPENDENCIES_DIR/$dep/env.sh + if [ -e $env_file ] ; then + . $env_file + else + echo ERROR no env.sh file found for $dep >&2 + exit 1 + fi +done +# Run the planemo tests +planemo test $@ $(dirname $0)/trimmomatic.xml +## +# |
b |
diff -r a60283899c6d -r f8a9a5eaca8a trimmomatic.xml --- a/trimmomatic.xml Wed Apr 22 09:36:27 2015 -0400 +++ b/trimmomatic.xml Wed Sep 23 08:59:23 2015 -0400 |
[ |
b'@@ -1,12 +1,31 @@\n-<tool id="trimmomatic" name="Trimmomatic" version="0.32.2">\n+<tool id="trimmomatic" name="Trimmomatic" version="0.32.3">\n <description>flexible read trimming tool for Illumina NGS data</description>\n- <command interpreter="bash">trimmomatic.sh\n+ <requirements>\n+ <requirement type="package" version="0.32">trimmomatic</requirement>\n+ </requirements>\n+ <stdio>\n+ <exit_code range="1:" />\n+ </stdio>\n+ <command interpreter="bash"><![CDATA[\n+ trimmomatic.sh\n -mx8G\n -jar \\$TRIMMOMATIC_DIR/trimmomatic-0.32.jar\n #if $paired_end.is_paired_end\n- PE -threads \\${GALAXY_SLOTS:-6} -phred33 $fastq_r1_in $paired_end.fastq_r2_in $fastq_out_r1_paired $fastq_out_r1_unpaired $fastq_out_r2_paired $fastq_out_r2_unpaired \n+ PE -threads \\${GALAXY_SLOTS:-6} -phred33\n+ #set $paired_input_type = $paired_end.paired_input_type_conditional.paired_input_type\n+ #if $paired_input_type == "pair_of_files"\n+ "${paired_end.paired_input_type_conditional.fastq_r1_in}"\n+ "${paired_end.paired_input_type_conditional.fastq_r2_in}"\n+ "${fastq_out_r1_paired}" "${fastq_out_r1_unpaired}"\n+ "${fastq_out_r2_paired}" "${fastq_out_r2_unpaired}"\n+ #else\n+ "${paired_end.paired_input_type_conditional.fastq_pair.forward}"\n+ "${paired_end.paired_input_type_conditional.fastq_pair.reverse}"\n+ "${fastq_out_paired.forward}" "${fastq_out_unpaired.forward}"\n+ "${fastq_out_paired.reverse}" "${fastq_out_unpaired.reverse}"\n+ #end if\n #else\n- SE -threads \\${GALAXY_SLOTS:-6} -phred33 $fastq_in $fastq_out\n+ SE -threads \\${GALAXY_SLOTS:-6} -phred33 "$fastq_in" "$fastq_out"\n #end if\n ## ILLUMINACLIP option\n #if $illuminaclip.do_illuminaclip\n@@ -35,10 +54,7 @@\n HEADCROP:$op.operation.headcrop\n #end if\n #end for\n- </command>\n- <requirements>\n- <requirement type="package" version="0.32">trimmomatic</requirement>\n- </requirements>\n+ ]]></command>\n <inputs>\n <conditional name="paired_end">\n <param name="is_paired_end" type="boolean" label="Paired end data?" truevalue="yes" falsevalue="no" checked="on" />\n@@ -46,10 +62,23 @@\n <param name="fastq_in" type="data" format="fastqsanger" label="Input FASTQ file" />\n </when>\n <when value="yes">\n- <param name="fastq_r1_in" type="data" format="fastqsanger"\n-\t label="Input FASTQ file (R1/first of pair)" />\n- <param name="fastq_r2_in" type="data" format="fastqsanger"\n-\t label="Input FASTQ file (R2/second of pair)" />\n+ <conditional name="paired_input_type_conditional">\n+ <param name="paired_input_type" type="select" label="Input Type">\n+ <option value="pair_of_files" selected="true">Pair of datasets</option>\n+ <option value="collection">Dataset collection pair</option>\n+ </param>\n+ <when value="pair_of_files">\n+ \t <param name="fastq_r1_in" type="data" format="fastqsanger"\n+\t\t label="Input FASTQ file (R1/first of pair)" />\n+ \t <param name="fastq_r2_in" type="data" format="fastqsanger"\n+\t\t label="Input FASTQ file (R2/second of pair)" />\n+\t</when>\n+ <when value="collection">\n+ <param name="fastq_pair" format="fastqsanger" type="data_collection"\n+ \t\t collection_type="paired"\n+ \t\t label="Select FASTQ dataset collection with R1/R2 pair" />\n+ </when>\n+ </conditional>\n </when>\n </conditional>\n <conditional name="illuminaclip">\n@@ -101,21 +130,37 @@\n </repeat>\n </inputs>\n <outputs>\n- <data format="fastqsanger" name="fastq_out_r1_paired" label="${tool.name} on ${on_string} (R1 paired)">\n+ <data format="fastqsanger" name="fastq_out_r1_paired" label="${tool.name} on ${paired_end.paired_input_type_conditional.fastq_r1_in.name} (R1 paired)">\n <filter>paired_end[\'is_paired_end\']</filter>\n+ <filter>paired_end[\'paired_input_type_conditional\'][\'paired_input_type\'] == "pair_of_files"</filter>\n </data>\n- <data format="fastqsanger" name="fastq_out_r1_unpaired" label="${tool.name} on ${on_string} (R1'..b' "pair_of_files"</filter>\n </data>\n- <data format="fastqsanger" name="fastq_out" label="${tool.name} on ${on_string}">\n+ <data format="fastqsanger" name="fastq_out" label="${tool.name} on ${paired_end.fastq_in.name}">\n <filter>not paired_end[\'is_paired_end\']</filter>\n </data>\n+ <collection name="fastq_out_paired" type="paired" label="${tool.name} on ${paired_end.paired_input_type_conditional.fastq_pair.name}: paired">\n+ <data name="forward" format="fastqsanger" label="${tool.name} on ${paired_end.paired_input_type_conditional.fastq_pair.forward.name} (R1 paired)" />\n+ <data name="reverse" format="fastqsanger" label="${tool.name} on ${paired_end.paired_input_type_conditional.fastq_pair.reverse.name} (R2 paired)" />\n+ <filter>paired_end[\'is_paired_end\']</filter>\n+ <filter>paired_end[\'paired_input_type_conditional\'][\'paired_input_type\'] == "collection"</filter>\n+ </collection>\n+ <collection name="fastq_out_unpaired" type="paired" label="${tool.name} on ${paired_end.paired_input_type_conditional.fastq_pair.name}: unpaired">\n+ <data name="forward" format="fastqsanger" label="${tool.name} on ${paired_end.paired_input_type_conditional.fastq_pair.forward.name} (R1 unpaired)" />\n+ <data name="reverse" format="fastqsanger" label="${tool.name} on ${paired_end.paired_input_type_conditional.fastq_pair.reverse.name} (R2 unpaired)" />\n+ <filter>paired_end[\'is_paired_end\']</filter>\n+ <filter>paired_end[\'paired_input_type_conditional\'][\'paired_input_type\'] == "collection"</filter>\n+ </collection>\n </outputs>\n <tests>\n <test>\n@@ -159,8 +204,28 @@\n -->\n <output name="fastq_out" file="trimmomatic_se_out2.fastq" />\n </test>\n+ <test>\n+ <!-- Paired-end with dataset collection -->\n+ <param name="is_paired_end" value="yes" />\n+ <param name="paired_input_type" value="collection" />\n+ <param name="fastq_pair">\n+ <collection type="paired">\n+ <element name="forward" value="Illumina_SG_R1.fastq" ftype="fastqsanger" />\n+ <element name="reverse" value="Illumina_SG_R2.fastq" ftype="fastqsanger"/>\n+ </collection>\n+ </param>\n+ <param name="operations_0|operation|name" value="SLIDINGWINDOW" />\n+ <output_collection name="fastq_out_paired" type="paired">\n+\t<element name="forward" file="trimmomatic_pe_r1_paired_out1.fastq" />\n+\t<element name="reverse" file="trimmomatic_pe_r2_paired_out1.fastq" />\n+ </output_collection>\n+ <output_collection name="fastq_out_unpaired" type="paired">\n+\t<element name="forward" file="trimmomatic_pe_r1_unpaired_out1.fastq" />\n+\t<element name="reverse" file="trimmomatic_pe_r2_unpaired_out1.fastq" />\n+ </output_collection>\n+ </test>\n </tests>\n- <help>\n+ <help><![CDATA[\n .. class:: infomark\n \n **What it does**\n@@ -191,6 +256,14 @@\n \n .. class:: infomark\n \n+**Inputs**\n+\n+For single-end data this Trimmomatic tool accepts a single FASTQ file; for\n+paired-end data it will accept either two FASTQ files (R1 and R2), or a\n+dataset collection containing the R1/R2 FASTQ pair.\n+\n+.. class:: infomark\n+\n **Outputs**\n \n For paired-end data a particular strength of Trimmomatic is that it retains the\n@@ -201,6 +274,12 @@\n * Additionally two FASTQ files (R1-unpaired and R2-unpaired) contain reads where\n one of the pair failed the filtering steps.\n \n+.. class:: warningmark\n+\n+If the input consists of a dataset collection with the R1/R2 FASTQ pair then\n+the outputs will also inclue two dataset collections: one for the \'paired\'\n+outputs and one for the \'unpaired\' (as described above)\n+\n Retaining the same order and number of reads in the filtered output fastq files is\n essential for many downstream analysis tools.\n \n@@ -228,7 +307,7 @@\n \n Please kindly acknowledge both this Galaxy tool and the Trimmomatic program if you\n use it.\n- </help>\n+ ]]></help>\n <citations>\n <!--\n See https://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax#A.3Ccitations.3E_tag_set\n' |