Repository 'concatenate_multiple_datasets'
hg clone https://toolshed.g2.bx.psu.edu/repos/artbio/concatenate_multiple_datasets

Changeset 3:62aebaf6cfa0 (2019-05-10)
Previous changeset 2:1fe4d165ac0e (2019-04-15) Next changeset 4:7afc0515a307 (2019-06-18)
Commit message:
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/concat_multi_datasets commit 64e9762ab35b04bb0d151e441baa2fae8bf2cb4a
modified:
catWrapper.xml
b
diff -r 1fe4d165ac0e -r 62aebaf6cfa0 catWrapper.xml
--- a/catWrapper.xml Mon Apr 15 18:52:43 2019 -0400
+++ b/catWrapper.xml Fri May 10 10:15:02 2019 -0400
[
b'@@ -1,4 +1,4 @@\n-<tool id="cat_multi_datasets" name="Concatenate multiple datasets" version="1.1.0">\n+<tool id="cat_multi_datasets" name="Concatenate multiple datasets" version="1.2.0">\n     <description>tail-to-head by specifying how</description>\n     <command><![CDATA[\n         #if $headers == 0:\n@@ -25,6 +25,31 @@\n                 #end for\n                 sleep 1\n             #end if\n+        #else if $global_condition.input_type == "simple_collections":\n+            #if $global_condition.collections_condition.collection_cat_type == "two_collections":\n+                mkdir concatenated &&\n+                #if $dataset_names == "No":\n+                    #for $x, $y in zip($global_condition.collections_condition.input_1, $global_condition.collections_condition.input_2)\n+                        $concat_command \'$x\' \'$y\' > concatenated/\'${x.element_identifier}.listed.${x.ext}.listed\' &&\n+                    #end for\n+                    sleep 1\n+                #else:\n+                    #for $x, $y in zip($global_condition.collections_condition.input_1, $global_condition.collections_condition.input_2)\n+                        #if $x.ext[-2:] == "gz":\n+                            printf "# ${x.element_identifier}\\n" | gzip -c > concatenated/\'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed\' &&\n+                            gzip -dc \'$x\' | $concat_command | gzip -c >> concatenated/\'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed\' &&\n+                            printf "# ${y.element_identifier}\\n" | gzip -c >> concatenated/\'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed\' &&\n+                            gzip -dc \'$y\' | $concat_command | gzip -c >> concatenated/\'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed\' &&\n+                        #else:\n+                            printf "# ${x.element_identifier}\\n" > concatenated/\'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed\' &&\n+                            $concat_command \'$x\'>> concatenated/\'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed\' &&\n+                            printf "# ${y.element_identifier}\\n" >> concatenated/\'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed\' &&\n+                            $concat_command \'$y\' >> concatenated/\'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed\' &&\n+                        #end if\n+                    #end for\n+                sleep 1\n+                #end if\n+            #end if\n         #else if $global_condition.input_type == "paired_collection":\n             #if $global_condition.paired_cat_type == "by_strand":\n                 #if $dataset_names == "No":\n@@ -107,19 +132,31 @@\n         <conditional name="global_condition">\n             <param name="input_type" type="select" label="What type of data do you wish to concatenate?" help="Depending on the type of input selected the concatenation options will differ">\n                 <option value="singles">Single datasets</option>\n+                <option value="simple_collections">Collections</option>\n                 <option value="paired_collection">Paired collection</option>\n             </param>\n             <when value="singles">\n                 <param name="inputs" type="data" label="Concatenate Datasets" multiple="True" help="All inputed datasets will be concatenated tail-to-head."/>\n             </when>\n             <when value="paired_collection">\n-                <param name="inputs" type="data_collection" collection_type="list:paired" label="Input paired collections to concatenate"/>\n+                <param name="inputs" type="data_collection" collection_type="list:paired" label="Input paired collection to concatenate"/>\n                 <param name="paired_cat_type" type="select" label="What type of concatenation do you wish to perform?">\n                     <option value="by_strand">Conca'..b'ections concatenation -->\n+            <param name="input_type" value="simple_collections" />\n+            <param name="collection_cat_type" value="two_collections"/>\n+            <param name="input_1">\n+                <collection type="list">\n+                    <element name="2" value="2_f.fastq"/>\n+                    <element name="3" value="3_f.fastq"/>\n+                    <element name="4" value="4_f.fastq"/>\n+                </collection>\n+            </param>\n+            <param name="input_2">\n+                <collection type="list">\n+                    <element name="2" value="2_r.fastq"/>\n+                    <element name="3" value="3_r.fastq"/>\n+                    <element name="4" value="4_r.fastq"/>\n+                </collection>\n+            </param>\n+            <param name="dataset_names" value="No" />\n+            <param name="headers" value="0" />\n+            <output_collection name="list_output" type="list" count="3" >\n+                <element name="2" file="2.fastq"/>\n+                <element name="3" file="3.fastq"/>\n+                <element name="4" file="4.fastq"/>\n+            </output_collection>\n+        </test>\n+        <test> <!-- Test 2 collections concatenation with other options-->\n+            <param name="input_type" value="simple_collections" />\n+            <param name="collection_cat_type" value="two_collections"/>\n+            <param name="input_1">\n+                <collection type="list">\n+                    <element name="1_f.fastq" value="1_f.fastq.gz"/>\n+                </collection>\n+            </param>\n+            <param name="input_2">\n+                <collection type="list">\n+                    <element name="1_r.fastq" value="1_r.fastq.gz"/>\n+                </collection>\n+            </param>\n+            <param name="dataset_names" value="Yes" />\n+            <param name="headers" value="4" />\n+            <output_collection name="list_output" type="list" count="1" >\n+                <element name="1_f.fastq_1_r.fastq" file="1_options.fastq.gz" decompress="True"/>\n+            </output_collection>\n+        </test>\n     </tests>\n     <help>\n \n@@ -250,13 +331,23 @@\n \n **WARNING:** The paired collection operations do not handle gziped files.\n \n+**WARNING:** When concatenating 2 collections make sure the first collection is the one with the most items.\n+\n -----\n \n **What it does**\n \n Concatenates datasets and paired collections with multiple options:\n \n- - It\'s possible select either a concatenation by strand, by pair or a whole collection concatenation, when the input is a paired collection.\n+ - When the input is a paired collection:\n+\n+   - concatenation by strand : forward and reverse datasets are concatenated separately and a list with a single forward - reverse dataset pair is returned\n+\n+   - concatenation by pair : forward - reverse dataset pairs are concatenated and a simple dataset collection is returned\n+\n+   - whole collection concatenation : all datasets in the collection are concatenated and a single dataset is returned\n+\n+ - When the inputs are 2 collections: datasets are concatenated in a pairwise combination and a single dataset collection is returned\n \n  - Skipping lines before concatenation to avoid headers\n \n@@ -294,6 +385,33 @@\n \n -----\n \n+**2 Collections concatenation**\n+\n+1rst collection::\n+\n+    a\n+    b\n+    c\n+    d\n+\n+2nd collection::\n+\n+    1\n+    2\n+    3\n+    4\n+\n+Concatenation result::\n+\n+    A single collection containing:\n+\n+    a concatenated with 1\n+    b concatenated with 2\n+    c concatenated with 3\n+    d concatenated with 4\n+\n+-----\n+\n **Paired collection concatenation example**\n \n 1rst pair::\n@@ -304,7 +422,7 @@\n \n     forward - reverse\n \n-Concatenation by strand::\n+- Concatenation by strand::\n \n     concatenates:\n \n@@ -315,7 +433,7 @@\n \n     1 pair\n \n-Concatenation by pair::\n+- Concatenation by pair::\n \n     concatenates:\n \n@@ -326,7 +444,7 @@\n \n     2 datasets\n \n-Concatenate all::\n+- Concatenate all::\n \n     concatenates:\n \n'