Repository 'fgbio_sort_fastq'
hg clone https://toolshed.g2.bx.psu.edu/repos/jjohnson/fgbio_sort_fastq

Changeset 0:099a35a39c29 (2021-08-19)
Commit message:
"planemo upload commit 77a5370a0978b5332bb3a9f063588a52a468ea08"
added:
fgbio_sort_fastq.xml
macros.xml
b
diff -r 000000000000 -r 099a35a39c29 fgbio_sort_fastq.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fgbio_sort_fastq.xml Thu Aug 19 15:13:55 2021 +0000
[
@@ -0,0 +1,33 @@
+<tool id="fgbio_sort_fastq" name="fgbio SortFastq" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" python_template_version="3.5">
+    <description>Sorts the records in a FASTQ file based on the lexicographic ordering of their read names</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <version_command>fgbio --version</version_command>
+    <command detect_errors="exit_code"><![CDATA[
+        fgbio SortFastq
+        --input '$input'
+        #if $input.is_of_type("fastq.gz", "fastqsanger.gz")
+            --output output.fastq.gz
+            && cp output.fastq.gz '$output'
+        #else
+            --output output.fastq
+            && cp output.fastq '$output'
+        #end if
+    ]]></command>
+    <inputs>
+        <param name="input" type="data" format="fastq,fastq.gz" label="fastq file to be sorted"/>
+    </inputs>
+    <outputs>
+        <data name="output" format_source="input" label="Sorted ${input.name}"/>
+    </outputs>
+    <help><![CDATA[
+**fgbio SortFastq**
+
+Sorts a FASTQ file. Sorts the records in a FASTQ file based on the lexicographic ordering of their read names. Input and output files can be either uncompressed or gzip-compressed.
+
+http://fulcrumgenomics.github.io/fgbio/tools/latest/SortFastq.html
+    ]]></help>
+    <expand macro="citations" />
+</tool>
b
diff -r 000000000000 -r 099a35a39c29 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Thu Aug 19 15:13:55 2021 +0000
[
b'@@ -0,0 +1,254 @@\n+<macros>\n+    <token name="@TOOL_VERSION@">1.3.0</token>\n+    <token name="@VERSION_SUFFIX@">1</token>\n+    <xml name="requirements">\n+        <requirements>\n+            <requirement type="package" version="@TOOL_VERSION@">fgbio</requirement>\n+            <yield/>\n+        </requirements>\n+    </xml>\n+    <xml name="citations">\n+        <citations>\n+            <citation type="bibtex">@online{fgbio,\n+              author = {Tim Fennell, Nils Homer},\n+              title = {fgbio},\n+              year = 2015,\n+              url = {https://github.com/fulcrumgenomics/fgbio},\n+              urldate = {2021-03-01}\n+            }</citation>\n+        </citations>\n+    </xml>\n+    <token name="@READ_STRUCTURE_PATTERN@">(([1-9][0-9]*[TBMS])*([+]|[1-9][0-9]*)[TBMS])</token>\n+    <token name="@READ_STRUCTURES_PATTERN@">@READ_STRUCTURE_PATTERN@(\\s@READ_STRUCTURE_PATTERN@)*</token>\n+    <xml name="read_structures_validator" token_pattern="@READ_STRUCTURES_PATTERN@">\n+            <validator type="regex" message="">^@READ_STRUCTURES_PATTERN@$</validator>\n+    </xml>\n+    <xml name="read_structures" token_pattern="@READ_STRUCTURES_PATTERN@">\n+        <param argument="--read-structures" type="text" value="" optional="true" label="Read structures, one for each of the FASTQ">\n+            <expand macro="read_structures_validator" pattern="@READ_STRUCTURE_PATTERN@" />\n+        </param>\n+    </xml>\n+\n+    <xml name="fastq_input" token_fastqtype="reads" token_defaultpaired="True" token_defaultnone="False">\n+        <conditional name="@FASTQTYPE@">\n+            <param name="type" type="select" label="Library type of FASTQ @FASTQTYPE@">\n+                <option value="none" selected="@DEFAULTNONE@">NO fastq @FASTQTYPE@</option>\n+                <option value="single">Single-end</option>\n+                <option value="paired" selected="@DEFAULTPAIRED@">Paired-end</option>\n+                <option value="paired_collection">Paired-end Dataset Collection</option>\n+            </param>\n+            <when value="none"/>\n+            <when value="single">\n+                <param name="input_single" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />\n+                <expand macro="read_structures" pattern="@READ_STRUCTURE_PATTERN@" />\n+            </when>\n+            <when value="paired">\n+                <param name="input_read1" type="data" format="fastq,fastq.gz" label="Reads #1 in FASTQ format" />\n+                <param name="input_read2" type="data" format="fastq,fastq.gz" label="Reads #2 in FASTQ format" />\n+                <expand macro="read_structures" pattern="@READ_STRUCTURES_PATTERN@" />\n+            </when>\n+            <when value="paired_collection">\n+                <param name="input_readpair" type="data_collection" collection_type="paired" format="fastq,fastq.gz" label="Paired Reads in FASTQ format" />\n+                <expand macro="read_structures" pattern="@READ_STRUCTURES_PATTERN@" />\n+            </when>\n+        </conditional>\n+    </xml>\n+    <xml name="fastq_reads">\n+        <expand macro="fastq_input" fastqtype="reads" defaultpaired="True" defaultnone="False"/>\n+    </xml>\n+    <xml name="fastq_inputs">\n+        <expand macro="fastq_input" fastqtype="reads" defaultpaired="True" defaultnone="False"/>\n+        <expand macro="fastq_input" fastqtype="indices" defaultpaired="False" defaultnone="True"/>\n+    </xml>\n+    <token name="@FASTQ_READS@"><![CDATA[\n+        #set $fastqs = []\n+        #set $read_structs = []\n+        #if $reads.type == \'single\':\n+            $fastqs.append($reads.input_single)\n+        #elif $reads.type == \'paired\':\n+            $fastqs.append($reads.input_read1)\n+            $fastqs.append($reads.input_read2)\n+        #elif $reads.type == \'paired_collection\':\n+            $fastqs.append($reads.input_readpair.forward)\n+            $fastqs.append($reads.input_readpair.reverse)\n+        #end if\n+        #if $reads.type !=\'none\' and $reads.read_structures:\n+            $read'..b'-read-structures $read_structures\n+        #end if\n+]]></token>\n+        <xml name="inherit_format_1">\n+            <actions>\n+                <conditional name="library.type">\n+                    <when value="single">\n+                        <action type="format">\n+                            <option type="from_param" name="library.input_1" param_attribute="ext" />\n+                        </action>\n+                    </when>\n+                    <when value="paired">\n+                        <action type="format">\n+                            <option type="from_param" name="library.input_1" param_attribute="ext" />\n+                        </action>\n+                    </when>\n+                    <when value="paired_collection">\n+                        <action type="format">\n+                            <option type="from_param" name="library.input_1" param_attribute="forward.ext" />\n+                        </action>\n+                    </when>\n+                </conditional>\n+            </actions>\n+        </xml>\n+\n+        <xml name="inherit_format_2">\n+            <actions>\n+                <conditional name="library.type">\n+                    <when value="paired">\n+                        <action type="format">\n+                            <option type="from_param" name="library.input_2" param_attribute="ext" />\n+                        </action>\n+                    </when>\n+                    <when value="paired_collection">\n+                        <action type="format">\n+                            <option type="from_param" name="library.input_1" param_attribute="reverse.ext" />\n+                        </action>\n+                    </when>\n+                </conditional>\n+            </actions>\n+        </xml>\n+    <xml name="sam_tag_validator">\n+\n+            <validator type="regex" message="">^[A-Za-z][A-Za-z]$</validator>\n+    </xml>\n+    <xml name="sam_sort_order">\n+        <param argument="--sort-order" type="select" optional="true" label="Sort BAM by">\n+            <option value="TemplateCoordinate">TemplateCoordinate</option>\n+            <option value="Coordinate">Coordinate</option>\n+            <option value="Queryname">Queryname</option>\n+            <option value="Random">Random</option>\n+            <option value="RandomQuery">RandomQuery</option>\n+        </param>\n+    </xml>\n+    \n+    <xml name="sort_order_change_format">\n+        <change_format>\n+            <when input="sort_order" value="Coordinate" format="bam" />\n+            <when input="sort_order" value="TemplateCoordinate" format="bam" />\n+            <when input="sort_order" value="QueryName" format="unsorted.bam" />\n+            <when input="sort_order" value="Random" format="unsorted.bam" />\n+            <when input="sort_order" value="RandomQuery" format="unsorted.bam" />\n+        </change_format>\n+    </xml>\n+\n+    <token name="@READ_STRUCTURES_HELP@"><![CDATA[\n+**Read Structures**\n+\n+Read structures are made up of <number><operator> pairs much like the CIGAR string in BAM files. Four kinds of operators are recognized:\n+\n+ -  T identifies a template read\n+ -  B identifies a sample barcode read\n+ -  M identifies a unique molecular index read\n+ -  S identifies a set of bases that should be skipped or ignored\n+\n+The last <number><operator> pair may be specified using a + sign instead of number to denote \xe2\x80\x9call remaining bases\xe2\x80\x9d. This is useful if, e.g., fastqs have been trimmed and contain reads of varying length. For example to convert a paired-end run with an index read and where the first 5 bases of R1 are a UMI and the second five bases are monotemplate you might specify:\n+\n+:: \n+\n+    --input r1.fq r2.fq i1.fq --read-structures 5M5S+T +T +B\n+\n+Alternative if you know your reads are of fixed length you could specify:\n+\n+:: \n+\n+    --input r1.fq r2.fq i1.fq --read-structures 5M5S65T 75T 8B\n+\n+\n+]]></token>\n+    <xml name="citations">\n+        <citations>\n+            <yield />\n+        </citations>\n+    </xml>\n+</macros>\n'