Skip to content

Commit 875278c

Browse files
authored
Merge pull request #20840 from natefoo/modernize-tools
Modernize tools in the filters/ dir
2 parents 3e7f220 + b85262d commit 875278c

24 files changed

+279
-575
lines changed

lib/galaxy_test/api/test_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ def test_show_dynamic_tools(self):
18531853
def test_show_tool_source_admin(self):
18541854
response = self._get("tools/cat1/raw_tool_source", admin=True)
18551855
response.raise_for_status()
1856-
assert "Concatenate datasets" in response.text
1856+
assert "Concatenate multiple datasets" in response.text
18571857
assert response.headers["language"] == "xml"
18581858

18591859
def test_show_tool_source_denied(self):

test-data/cat_wrapper_out1.bed

Lines changed: 0 additions & 133 deletions
This file was deleted.

tools/filters/bed2gff.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
<tool id="bed2gff1" name="BED-to-GFF" version="2.0.0">
1+
<tool id="bed2gff1" name="BED-to-GFF" version="2.0.0" profile="24.2">
22
<description>converter</description>
33
<edam_operations>
44
<edam_operation>operation_3434</edam_operation>
55
</edam_operations>
6+
<requirements>
7+
<requirement type="package" version="3.13">python</requirement>
8+
</requirements>
9+
<required_files>
10+
<include path="bed_to_gff_converter.py"/>
11+
</required_files>
612
<command>python '$__tool_directory__/bed_to_gff_converter.py' '$input' '$out_file1'</command>
713
<inputs>
814
<param format="bed" name="input" type="data" label="Convert this dataset"/>

tools/filters/catWrapper.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

tools/filters/catWrapper.xml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
1-
<tool id="cat1" name="Concatenate datasets" version="1.0.0">
2-
<description>tail-to-head</description>
1+
<tool id="cat1" name="Concatenate multiple datasets or collections" version="1.0.0" profile="24.2">
2+
<description></description>
33
<edam_operations>
44
<edam_operation>operation_3436</edam_operation>
55
</edam_operations>
6-
<command interpreter="python"><![CDATA[
7-
catWrapper.py
8-
'$out_file1'
9-
'$input1'
10-
#for $q in $queries
11-
'${q.input2}'
12-
#end for
6+
<requirements>
7+
<requirement type="package" version="8.31">coreutils</requirement>
8+
</requirements>
9+
<command><![CDATA[
10+
cat '$input1'
11+
#for $q in $queries
12+
'${q.input2}'
13+
#end for
14+
> '$out_file1'
1315
]]></command>
1416
<inputs>
15-
<param name="input1" type="data" label="Concatenate Dataset"/>
17+
<param name="input1" format="data" type="data" label="Concatenate Dataset"/>
1618
<repeat name="queries" title="Dataset">
17-
<param name="input2" type="data" label="Select" />
19+
<param name="input2" format="data" type="data" label="Select" />
1820
</repeat>
1921
</inputs>
2022
<outputs>
21-
<data name="out_file1" format="input" metadata_source="input1"/>
23+
<data name="out_file1" format_source="input1" metadata_source="input1"/>
2224
</outputs>
2325
<tests>
2426
<test>
2527
<param name="input1" value="1.bed"/>
26-
<param name="input2" value="2.bed"/>
27-
<output name="out_file1" file="cat_wrapper_out1.bed"/>
28+
<repeat name="queries">
29+
<param name="input2" value="2.bed"/>
30+
</repeat>
31+
<output name="out_file1" ftype="bed" file="cat_wrapper_out1.bed"/>
2832
</test>
29-
<!--TODO: if possible, enhance the underlying test code to handle this test
30-
the problem is multiple params with the same name "input2"
3133
<test>
3234
<param name="input1" value="1.bed"/>
33-
<param name="input2" value="2.bed"/>
34-
<param name="input2" value="3.bed"/>
35-
<output name="out_file1" file="cat_wrapper_out2.bed"/>
35+
<repeat name="queries">
36+
<param name="input2" value="2.bed"/>
37+
</repeat>
38+
<repeat name="queries">
39+
<param name="input2" value="3.bed"/>
40+
</repeat>
41+
<output name="out_file1" ftype="bed" file="cat_wrapper_out2.bed"/>
3642
</test>
37-
-->
3843
</tests>
3944
<help><![CDATA[
4045
.. class:: warningmark

tools/filters/compare.xml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
<tool id="comp1" name="Compare two Datasets" version="1.0.2">
1+
<tool id="comp1" name="Compare two Datasets" version="1.0.2" profile="24.2">
22
<description>to find common or distinct rows</description>
3-
<command interpreter="python">joinWrapper.py $input1 $input2 $field1 $field2 $mode $out_file1</command>
3+
<requirements>
4+
<requirement type="package" version="8.31">coreutils</requirement>
5+
</requirements>
6+
<command><![CDATA[
7+
join --nocheck-order -t \$'\t'
8+
#if $mode == "V":
9+
-v 1
10+
#end if
11+
-o "\$(seq -s, -f '1.%g' 1 \$(head -n1 '$input1' | tr '\t' '\n' | wc -l))"
12+
-1 '$field1' -2 '$field2'
13+
<(sort -t \$'\t' -k '${field1},${field1}' '$input1')
14+
<(sort -t \$'\t' -k '${field2},${field2}' '$input2')
15+
> '$out_file1'
16+
]]></command>
417
<edam_operations>
518
<edam_operation>operation_3695</edam_operation>
619
</edam_operations>
@@ -19,7 +32,7 @@
1932
</param>
2033
</inputs>
2134
<outputs>
22-
<data format="input" name="out_file1" metadata_source="input1" />
35+
<data name="out_file1" format_source="input1" metadata_source="input1" />
2336
</outputs>
2437
<tests>
2538
<test>

tools/filters/convert_characters.xml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
<tool id="Convert characters1" name="Convert" version="1.0.0">
1+
<tool id="Convert characters1" name="Convert" version="1.0.1" profile="24.2">
22
<description>delimiters to TAB</description>
3-
<command interpreter="python">
4-
convert_characters.py
5-
#if $strip
6-
--strip
7-
#end if
8-
#if $condense
9-
--condense
10-
#end if
11-
$input $convert_from $out_file1
3+
<requirements>
4+
<requirement type="package" version="3.13">python</requirement>
5+
</requirements>
6+
<required_files>
7+
<include path="convert_characters.py"/>
8+
</required_files>
9+
<command>
10+
python '$__tool_directory__/convert_characters.py'
11+
#if $strip
12+
--strip
13+
#end if
14+
#if $condense
15+
--condense
16+
#end if
17+
'$input' '$convert_from' '$out_file1'
1218
</command>
1319
<inputs>
1420
<param name="convert_from" type="select" label="Convert all">
@@ -30,9 +36,6 @@ $input $convert_from $out_file1
3036
<outputs>
3137
<data format="tabular" name="out_file1" />
3238
</outputs>
33-
<stdio>
34-
<exit_code range="1:" level="fatal" />
35-
</stdio>
3639
<tests>
3740
<test>
3841
<param name="convert_from" value="s"/>

tools/filters/gff/extract_GFF_Features.xml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
<tool id="Extract_features1" name="Extract features" version="1.0.0">
1+
<tool id="Extract_features1" name="Extract features" version="1.0.0" profile="20.05">
22
<description>from GFF data</description>
3-
<command interpreter="python">extract_GFF_Features.py $input1 $out_file1 ${column_choice.col} ${column_choice.feature}</command>
3+
<requirements>
4+
<requirement type="package" version="0.14.0">bx-python</requirement>
5+
</requirements>
6+
<required_files>
7+
<include path="extract_GFF_Features.py"/>
8+
</required_files>
9+
<command>
10+
python '$__tool_directory__/extract_GFF_Features.py'
11+
'$input1' '$out_file1' '${column_choice.col}' '${column_choice.feature}'
12+
</command>
413
<inputs>
514
<param format="gff" name="input1" type="data" label="Select GFF data"/>
615
<conditional name="column_choice">
@@ -59,13 +68,15 @@
5968
</conditional>
6069
</inputs>
6170
<outputs>
62-
<data format="input" name="out_file1" metadata_source="input1"/>
71+
<data name="out_file1" format_source="input1" metadata_source="input1"/>
6372
</outputs>
6473
<tests>
6574
<test>
6675
<param name="input1" value="5.gff"/>
67-
<param name="col" value="0" />
68-
<param name="feature" value="chr5,chr6,chr7,chr8" />
76+
<conditional name="column_choice">
77+
<param name="col" value="0" />
78+
<param name="feature" value="chr5,chr6,chr7,chr8" />
79+
</conditional>
6980
<output name="out_file1" file="Extract_features1_out.gff"/>
7081
</test>
7182
</tests>

tools/filters/gff/gff_filter_by_attribute.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
<tool id="gff_filter_by_attribute" name="Filter GFF data by attribute" version="0.2">
1+
<tool id="gff_filter_by_attribute" name="Filter GFF data by attribute" version="0.2" profile="24.2">
22
<description>using simple expressions</description>
3+
<requirements>
4+
<requirement type="package" version="3.13">python</requirement>
5+
</requirements>
6+
<required_files>
7+
<include path="gff_filter_by_attribute.py"/>
8+
</required_files>
39
<command>
4-
python '$__tool_directory__/gff_filter_by_attribute.py' '$input' '$out_file1' '$cond' '${input.metadata.attribute_types}'
10+
python '$__tool_directory__/gff_filter_by_attribute.py'
11+
'$input' '$out_file1' '$cond' '${input.metadata.attribute_types}'
512
</command>
613
<inputs>
714
<param name="input" type="data" format="gff" label="Filter" help="Dataset missing? See TIP below." />
@@ -10,7 +17,7 @@ python '$__tool_directory__/gff_filter_by_attribute.py' '$input' '$out_file1' '$
1017
</param>
1118
</inputs>
1219
<outputs>
13-
<data name="out_file1" format="input" metadata_source="input"/>
20+
<data name="out_file1" format_source="input" metadata_source="input"/>
1421
</outputs>
1522
<tests>
1623
<test>

0 commit comments

Comments
 (0)