jpayne@3
|
1 <tool id="confindr" name="ConFindr" version="0.1.0">
|
jpayne@0
|
2 <requirements>
|
jpayne@0
|
3 <requirement type="package" version="0.7.4">confindr</requirement>
|
jpayne@0
|
4 </requirements>
|
jpayne@0
|
5 <command detect_errors="exit_code"><![CDATA[
|
jpayne@2
|
6 ## Copy and optionally uncompress reads ##
|
jpayne@0
|
7 #if $reads.reads_select == 'collection'
|
jpayne@0
|
8 #set forward=$reads.coll.forward
|
jpayne@0
|
9 #set reverse=$reads.coll.reverse
|
jpayne@0
|
10 #set name=$reads.coll.name.replace(' ', '_')
|
jpayne@0
|
11 #else
|
jpayne@0
|
12 #set name=$forward.name.split('_')[0]
|
jpayne@0
|
13 #end if
|
jpayne@0
|
14 mkdir ./${name}
|
jpayne@0
|
15 #if $forward.is_of_type("fastq.gz","fastqsanger.gz")
|
jpayne@0
|
16 && cp $forward ./${name}/${name}_R1.fastq.gz
|
jpayne@0
|
17 #else if $forward.is_of_type("fastq.bz2", "fastqsanger.bz2")
|
jpayne@0
|
18 && tar -vxjOf $forward > ./${name}/${name}_R1.fastq
|
jpayne@0
|
19 #else
|
jpayne@0
|
20 && cp $forward ./${name}/${name}_R1.fastq
|
jpayne@0
|
21 #end if
|
jpayne@0
|
22 #if $reverse.is_of_type("fastq.gz","fastqsanger.gz")
|
jpayne@0
|
23 && cp $reverse ./${name}/${name}_R2.fastq.gz
|
jpayne@0
|
24 #else if $reverse.is_of_type("fastq.bz2", "fastqsanger.bz2")
|
jpayne@0
|
25 && tar -vxjOf $reverse > ./${name}/${name}_R2.fastq
|
jpayne@0
|
26 #else
|
jpayne@0
|
27 && cp $reverse ./${name}/${name}_R2.fastq
|
jpayne@0
|
28 #end if
|
jpayne@0
|
29 ## !!! confindr in single-threaded mode; race condition bugs in multiple threads !!! ##
|
jpayne@0
|
30 && confindr.py -i ./${name} -o ./output -t 1
|
jpayne@0
|
31 && cat ./output/confindr_log.txt
|
jpayne@0
|
32 && ls -lah ./output/confindr_report.csv
|
jpayne@0
|
33
|
jpayne@0
|
34 ]]></command>
|
jpayne@0
|
35 <inputs>
|
jpayne@0
|
36 <conditional name="reads">
|
jpayne@0
|
37 <param name="reads_select" type="select" label="Paired-end collection, or two datasets from your history">
|
jpayne@0
|
38 <option value="collection">Paired collection from your history</option>
|
jpayne@0
|
39 <option value="history">Two FASTQ datasets from your history</option>
|
jpayne@0
|
40 </param>
|
jpayne@0
|
41 <when value="collection">
|
jpayne@0
|
42 <param label="Paired reads" name="coll" type="data_collection" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" collection_type="paired" />
|
jpayne@0
|
43 </when>
|
jpayne@0
|
44 <when value="history">
|
jpayne@0
|
45 <param label="Forward reads" type="data" name="forward" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
|
jpayne@0
|
46 <param label="Reverse reads" type="data" name="reverse" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
|
jpayne@0
|
47 </when>
|
jpayne@0
|
48 </conditional>
|
jpayne@0
|
49 </inputs>
|
jpayne@0
|
50 <outputs>
|
jpayne@0
|
51 <data format="csv" name="contam_report" label="Contamination Report" from_work_dir="./output/confindr_report.csv" />
|
jpayne@0
|
52 </outputs>
|
jpayne@0
|
53 <tests>
|
jpayne@0
|
54 <test>
|
jpayne@0
|
55 <param name="reads_select" value="collection" />
|
jpayne@0
|
56 <param name="coll">
|
jpayne@0
|
57 <collection type="paired">
|
jpayne@0
|
58 <element name="forward" value="example_R1.fastq.gz" ftype="fastqsanger.gz" />
|
jpayne@0
|
59 <element name="reverse" value="example_R2.fastq.gz" ftype="fastqsanger.gz" />
|
jpayne@0
|
60 </collection>
|
jpayne@0
|
61 </param>
|
jpayne@0
|
62 <output name="contam_report" value="confindr_report.csv" />
|
jpayne@0
|
63 </test>
|
jpayne@0
|
64 <test>
|
jpayne@0
|
65 <param name="reads_select" value="history" />
|
jpayne@0
|
66 <param name="forward" value="example_R1.fastq.gz" ftype="fastqsanger.gz"/>
|
jpayne@0
|
67 <param name="reverse" value="example_R2.fastq.gz" ftype="fastqsanger.gz"/>
|
jpayne@0
|
68 <output name="contam_report" value="confindr_report_2.csv" />
|
jpayne@0
|
69 </test>
|
jpayne@0
|
70 <test>
|
jpayne@0
|
71 <param name="reads_select" value="history" />
|
jpayne@0
|
72 <param name="forward" value="example_R1.fastq.bz2" ftype="fastqsanger.bz2"/>
|
jpayne@0
|
73 <param name="reverse" value="example_R2.fastq.bz2" ftype="fastqsanger.bz2"/>
|
jpayne@0
|
74 <output name="contam_report" value="confindr_report_2.csv" />
|
jpayne@0
|
75 </test>
|
jpayne@0
|
76 </tests>
|
jpayne@0
|
77 <help><![CDATA[
|
jpayne@0
|
78 ConFindr, a contamination screen for Illumina sequencing
|
jpayne@0
|
79 ]]></help>
|
jpayne@0
|
80 <citations>
|
jpayne@0
|
81 <citation type="doi">10.7717/peerj.6995</citation>
|
jpayne@0
|
82 <citation type="bibtex">
|
jpayne@0
|
83 @misc{githubConFindr,
|
jpayne@0
|
84 author = {LastTODO, FirstTODO},
|
jpayne@0
|
85 year = {TODO},
|
jpayne@0
|
86 title = {ConFindr},
|
jpayne@0
|
87 publisher = {GitHub},
|
jpayne@0
|
88 journal = {GitHub repository},
|
jpayne@0
|
89 url = {https://github.com/OLC-Bioinformatics/ConFindr},
|
jpayne@0
|
90 }</citation>
|
jpayne@0
|
91 </citations>
|
jpayne@2
|
92 </tool>
|