diff confindr.xml @ 0:619d56f369af

"planemo upload commit e779d2916df6a1f2f5884c3abfac3bf3a1e59717"
author jpayne
date Thu, 03 Sep 2020 22:32:44 -0400
parents
children be0474727c9a
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/confindr.xml	Thu Sep 03 22:32:44 2020 -0400
@@ -0,0 +1,91 @@
+<tool id="confindr" name="ConFindr" version="0.1.0" python_template_version="3.5">
+    <requirements>
+        <requirement type="package" version="0.7.4">confindr</requirement>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+        #if $reads.reads_select == 'collection'
+            #set forward=$reads.coll.forward
+            #set reverse=$reads.coll.reverse
+            #set name=$reads.coll.name.replace(' ', '_')
+        #else
+            #set name=$forward.name.split('_')[0]
+        #end if
+            mkdir ./${name}
+        #if $forward.is_of_type("fastq.gz","fastqsanger.gz")
+            && cp $forward ./${name}/${name}_R1.fastq.gz
+        #else if $forward.is_of_type("fastq.bz2", "fastqsanger.bz2")
+            && tar -vxjOf $forward > ./${name}/${name}_R1.fastq
+        #else
+            && cp $forward ./${name}/${name}_R1.fastq
+        #end if
+        #if $reverse.is_of_type("fastq.gz","fastqsanger.gz")
+            && cp $reverse ./${name}/${name}_R2.fastq.gz
+        #else if $reverse.is_of_type("fastq.bz2", "fastqsanger.bz2")
+            && tar -vxjOf $reverse > ./${name}/${name}_R2.fastq
+        #else
+            && cp $reverse ./${name}/${name}_R2.fastq
+        #end if
+        ## !!! confindr in single-threaded mode; race condition bugs in multiple threads !!! ##
+        && confindr.py -i ./${name} -o ./output -t 1
+        && cat ./output/confindr_log.txt
+        && ls -lah ./output/confindr_report.csv
+
+    ]]></command>
+    <inputs>
+        <conditional name="reads">
+            <param name="reads_select" type="select" label="Paired-end collection, or two datasets from your history">
+                <option value="collection">Paired collection from your history</option>
+                <option value="history">Two FASTQ datasets from your history</option>
+            </param>
+            <when value="collection">
+                <param label="Paired reads" name="coll" type="data_collection" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" collection_type="paired" />
+            </when>
+            <when value="history">
+                <param label="Forward reads" type="data" name="forward" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
+                <param label="Reverse reads" type="data" name="reverse" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="csv" name="contam_report" label="Contamination Report" from_work_dir="./output/confindr_report.csv" />
+    </outputs>
+    <tests>
+        <test>
+            <param name="reads_select" value="collection" />
+            <param name="coll">
+                <collection type="paired">
+                    <element name="forward" value="example_R1.fastq.gz" ftype="fastqsanger.gz" />
+                    <element name="reverse" value="example_R2.fastq.gz" ftype="fastqsanger.gz" />
+                </collection>
+            </param>
+            <output name="contam_report" value="confindr_report.csv" />
+        </test>
+        <test>
+            <param name="reads_select" value="history" />
+            <param name="forward" value="example_R1.fastq.gz" ftype="fastqsanger.gz"/>
+            <param name="reverse" value="example_R2.fastq.gz" ftype="fastqsanger.gz"/>
+            <output name="contam_report" value="confindr_report_2.csv" />
+        </test>
+        <test>
+            <param name="reads_select" value="history" />
+            <param name="forward" value="example_R1.fastq.bz2" ftype="fastqsanger.bz2"/>
+            <param name="reverse" value="example_R2.fastq.bz2" ftype="fastqsanger.bz2"/>
+            <output name="contam_report" value="confindr_report_2.csv" />
+        </test>
+    </tests>
+    <help><![CDATA[
+        ConFindr, a contamination screen for Illumina sequencing
+    ]]></help>
+    <citations>
+        <citation type="doi">10.7717/peerj.6995</citation>
+        <citation type="bibtex">
+@misc{githubConFindr,
+  author = {LastTODO, FirstTODO},
+  year = {TODO},
+  title = {ConFindr},
+  publisher = {GitHub},
+  journal = {GitHub repository},
+  url = {https://github.com/OLC-Bioinformatics/ConFindr},
+}</citation>
+    </citations>
+</tool>
\ No newline at end of file