-
Notifications
You must be signed in to change notification settings - Fork 1
/
confil.xml
111 lines (106 loc) · 5.34 KB
/
confil.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<tool id="confil" name="Contamination Filter (confil)" version="@VERSION@+galaxy0">
<macros>
<token name="@VERSION@">0.1.5</token>
</macros>
<requirements>
<requirement type="package" version="@VERSION@">confil</requirement>
<requirement type="package" version="7.0">click</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
#set $input_type = $input_type_conditional.input_type
#import re
####### Single Input
#if $input_type == "single"
ln -s "${input_type_conditional.single_input}" $input_type_conditional.single_input.element_identifier &&
#set report_name = os.path.splitext(os.path.basename($input_type_conditional.single_input.element_identifier))[0]
#set report_name = re.sub('_[0-9]+$', '', str(report_name)) + '.tab'
if confil --threads \${GALAXY_SLOTS:-1} --cutoff $cutoff
$input_type_conditional.single_input.element_identifier ;
then
ln -sf "${input_type_conditional.single_input}" '$single_output_file' ;
else
touch '$single_output_file' ;
fi
####### Paired Collection
#elif $input_type == "paired_collection"
ln -s "${input_type_conditional.collection_input.forward}" $input_type_conditional.collection_input.forward.element_identifier &&
ln -s "${input_type_conditional.collection_input.reverse}" $input_type_conditional.collection_input.reverse.element_identifier &&
#set report_name = os.path.splitext(os.path.basename($input_type_conditional.collection_input.forward.element_identifier))[0]
#set report_name = re.sub('_[0-9]+$', '', str(report_name)) + '.tab'
if confil --threads \${GALAXY_SLOTS:-1} --cutoff $cutoff --paired
$input_type_conditional.collection_input.forward.element_identifier $input_type_conditional.collection_input.reverse.element_identifier ;
then
ln -sf "${input_type_conditional.collection_input.forward}" '$list_output.forward'
&& ln -sf "${input_type_conditional.collection_input.reverse}" '$list_output.reverse' ;
else
touch '$list_output.forward' && touch '$list_output.reverse' ;
fi
#end if
&& mv $report_name '$output_report'
]]>
</command>
<inputs>
<conditional name="input_type_conditional">
<param name="input_type" type="select" label="Select Input Type">
<option value="single" selected="true">Single Dataset</option>
<option value="paired_collection">Paired Collection</option>
</param>
<when value="single">
<param name="single_input" type="data" format="fq,fastq,fastq.gz,fastqsanger" label="Select FASTQ Dataset" help="Specify dataset with single reads" />
</when>
<when value="paired_collection">
<param name="collection_input" format="fq,fastq,fastq.gz,fastqsanger" type="data_collection" collection_type="paired" label="Select Dataset Pair" help="Specify paired dataset collection containing paired reads" />
</when>
</conditional>
<param name="cutoff" type="integer" label="Cutoff percentage" value="90" min="50" max="99" />
</inputs>
<outputs>
<data name="output_report" format="tabular" label="${tool.name} on ${on_string} kraken2 report" />
<data name="single_output_file" format="fastq" label="${tool.name} on ${on_string} single output">
<filter>input_type_conditional['input_type'] == "single"</filter>
</data>
<collection name="list_output" type="paired" label="${tool.name} on ${on_string} paired output" structured_like="collection_input" inherit_format="true">
<filter>input_type_conditional['input_type'] == "paired_collection"</filter>
<data name="forward" format="fastq" />
<data name="reverse" format="fastq" />
</collection>
</outputs>
<tests>
<test>
<param name="single_input" value="seq_1.fastq" />
<param name="input_type" value="single" />
<output name="output_report" ftype="tabular" file="seq.tab" />
<output name="single_output_file" ftype="fastq" file="seq_1.fastq" />
</test>
<test>
<param name="collection_input">
<collection type="paired">
<element name="forward" value="seq_1.fastq" />
<element name="reverse" value="seq_2.fastq" />
</collection>
</param>
<param name="input_type" value="paired_collection" />
<output name="output_report" ftype='tabular' file="seq.tab" />
<output_collection name="list_output" type="paired">
<element name="forward" value="seq_1.fastq">
</element>
<element name="reverse" value="seq_2.fastq">
</element>
</output_collection>
</test>
</tests>
<help><![CDATA[
confil parses a kraken2 report and determines contamination based on a specified cutoff.
]]> </help>
<citations>
<citation type="bibtex">
@misc{githubconfil,
author = {SANBI-SA},
year = {2019},
title = {confil},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://github.com/COMBAT-TB/confil},
}</citation>
</citations>
</tool>