Skip to content

Commit 490766e

Browse files
committed
Keep old and new version
1 parent 065ebd5 commit 490766e

7 files changed

Lines changed: 319 additions & 3 deletions

lib/galaxy/tools/filter_empty_collection.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</edam_operations>
1212
<inputs>
1313
<param type="data_collection" collection_type="list,list:paired" name="input" label="Input Collection" />
14-
<param type="data" name="replacement" optional="true" label="Replace empty elements with this dataset" help="If provided, empty elements will be replaced with this dataset"/>
1514
</inputs>
1615
<outputs>
1716
<collection name="output" format_source="input" type_source="input" label="${on_string} (filtered empty datasets)" >
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<tool id="__FILTER_EMPTY_DATASETS__"
2+
name="Filter empty datasets"
3+
version="1.1.0"
4+
tool_type="filter_empty_datasets_collection">
5+
<description></description>
6+
<type class="FilterEmptyDatasetsTool" module="galaxy.tools" />
7+
<action module="galaxy.tools.actions.model_operations"
8+
class="ModelOperationToolAction"/>
9+
<edam_operations>
10+
<edam_operation>operation_3695</edam_operation>
11+
</edam_operations>
12+
<inputs>
13+
<param type="data_collection" collection_type="list,list:paired" name="input" label="Input Collection" />
14+
<param type="data" name="replacement" optional="true" label="Replace empty elements with this dataset" help="If provided, empty elements will be replaced with this dataset"/>
15+
</inputs>
16+
<outputs>
17+
<collection name="output" format_source="input" type_source="input" label="${on_string} (filtered empty datasets)" >
18+
</collection>
19+
</outputs>
20+
<tests>
21+
<test>
22+
<param name="input">
23+
<collection type="list">
24+
<element name="e1" value="simple_line.txt" />
25+
</collection>
26+
</param>
27+
<output_collection name="output" type="list" count="1">
28+
<element name="e1">
29+
<assert_contents>
30+
<has_text_matching expression="^This is a line of text.\n$" />
31+
</assert_contents>
32+
</element>
33+
</output_collection>
34+
</test>
35+
</tests>
36+
<help><![CDATA[
37+
38+
========
39+
Synopsis
40+
========
41+
42+
Removes empty elements from a collection.
43+
44+
This tool takes a dataset collection and filters out (removes) empty datasets. This is useful for continuing a multi-sample analysis when downstream tools require datasets to have content.
45+
46+
.. image:: ${static_path}/images/tools/collection_ops/filter_empty.svg
47+
:width: 500
48+
:alt: Filtering empty datasets
49+
50+
-----
51+
52+
.. class:: infomark
53+
54+
This tool will create new history datasets from your collection but your quota usage will not increase.
55+
56+
]]></help>
57+
</tool>
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<tool id="__FILTER_FROM_FILE__"
2+
name="Filter collection"
3+
version="1.1.0"
4+
tool_type="filter_from_file">
5+
<description></description>
6+
<type class="FilterFromFileTool" module="galaxy.tools" />
7+
<action module="galaxy.tools.actions.model_operations"
8+
class="ModelOperationToolAction"/>
9+
<edam_operations>
10+
<edam_operation>operation_3695</edam_operation>
11+
</edam_operations>
12+
<inputs>
13+
<param type="data_collection" name="input" label="Input Collection" help="A collection whose elements will be filtered."/>
14+
<conditional name="how">
15+
<param type="select" name="how_filter" label="How should the elements to remove be determined?">
16+
<option value="remove_if_absent" selected="true">Remove if identifiers are ABSENT from file</option>
17+
<option value="remove_if_present">Remove if identifiers are PRESENT in file</option>
18+
</param>
19+
<when value="remove_if_absent">
20+
<param type="data" name="filter_source" format="txt" label="Filter out identifiers absent from" />
21+
</when>
22+
<when value="remove_if_present">
23+
<param type="data" name="filter_source" format="txt" label="Filter out identifiers present in" />
24+
</when>
25+
</conditional>
26+
</inputs>
27+
<outputs>
28+
<collection name="output_filtered" format_source="input" type_source="input" label="${on_string} (filtered)" >
29+
</collection>
30+
<collection name="output_discarded" format_source="input" type_source="input" label="${on_string} (discarded)" >
31+
</collection>
32+
</outputs>
33+
<tests>
34+
<test>
35+
<param name="input">
36+
<collection type="list">
37+
<element name="i1" value="simple_line.txt" />
38+
<element name="i2" value="simple_line_alternative.txt" />
39+
</collection>
40+
</param>
41+
<param name="how_filter" value="remove_if_present" />
42+
<param name="filter_source" value="filter_labels_1.txt" ftype="txt" />
43+
<output_collection name="output_filtered" type="list">
44+
<element name="i1">
45+
<assert_contents>
46+
<has_text_matching expression="^This is a line of text.\n$" />
47+
</assert_contents>
48+
</element>
49+
</output_collection>
50+
<output_collection name="output_discarded" type="list">
51+
<element name="i2">
52+
<assert_contents>
53+
<has_text_matching expression="^This is a different line of text.\n$" />
54+
</assert_contents>
55+
</element>
56+
</output_collection>
57+
</test>
58+
<test>
59+
<param name="input">
60+
<collection type="list">
61+
<element name="i1" value="simple_line.txt" />
62+
<element name="i2" value="simple_line_alternative.txt" />
63+
</collection>
64+
</param>
65+
<param name="how_filter" value="remove_if_absent" />
66+
<param name="filter_source" value="filter_labels_1.txt" ftype="txt" />
67+
<output_collection name="output_filtered" type="list">
68+
<element name="i2">
69+
<assert_contents>
70+
<has_text_matching expression="^This is a different line of text.\n$" />
71+
</assert_contents>
72+
</element>
73+
</output_collection>
74+
<output_collection name="output_discarded" type="list">
75+
<element name="i1">
76+
<assert_contents>
77+
<has_text_matching expression="^This is a line of text.\n$" />
78+
</assert_contents>
79+
</element>
80+
</output_collection>
81+
</test>
82+
</tests>
83+
<help><![CDATA[
84+
85+
========
86+
Synopsis
87+
========
88+
89+
Filters elements from a collection using a list supplied in a file.
90+
91+
===========
92+
Description
93+
===========
94+
95+
This tools allow filtering elements from a data collection. It takes an input collection and a text file with names (i.e. identifiers). The tool behavious is controlled by **How should the elements to remove be determined?** drop-down. It has the following options:
96+
97+
**Remove if identifiers are ABSENT from file**
98+
99+
Given a collection::
100+
101+
Collection: [Dataset A]
102+
[Dataset B]
103+
[Dataset X]
104+
105+
and a text file::
106+
107+
A
108+
B
109+
Z
110+
111+
the tool will return two collections::
112+
113+
(filtered): [Dataset A]
114+
[Dataset B]
115+
116+
(discarded): [Dataset X]
117+
118+
------
119+
120+
**Remove if identifiers are PRESENT in file**
121+
122+
Given a collection::
123+
124+
Collection: [Dataset A]
125+
[Dataset B]
126+
[Dataset X]
127+
128+
and a text file::
129+
130+
A
131+
B
132+
Z
133+
134+
the tool will return two collections::
135+
136+
(filtered): [Dataset X]
137+
138+
(discarded): [Dataset A]
139+
[Dataset B]
140+
141+
.. class:: warningmark
142+
143+
**Note** how the tool deals with the ``Z`` entry.
144+
145+
.. class:: infomark
146+
147+
148+
This tool will create new history datasets from your collection but your quota usage will not increase.
149+
]]></help>
150+
</tool>

lib/galaxy/tools/filter_null.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
</edam_operations>
88
<inputs>
99
<param type="data_collection" collection_type="list,list:paired" name="input" label="Input Collection"/>
10-
<param type="data" name="replacement" optional="true" label="Replace null elements with this dataset" help="If provided, null elements will be replaced with this dataset"/>
1110
</inputs>
1211
<outputs>
1312
<collection name="output" format_source="input" type_source="input" label="${on_string} (without null datasets)">
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<tool id="__FILTER_NULL__" name="Filter null elements" version="1.1.0" tool_type="filter_null">
2+
<description/>
3+
<type class="FilterNullTool" module="galaxy.tools"/>
4+
<action module="galaxy.tools.actions.model_operations" class="ModelOperationToolAction"/>
5+
<edam_operations>
6+
<edam_operation>operation_3695</edam_operation>
7+
</edam_operations>
8+
<inputs>
9+
<param type="data_collection" collection_type="list,list:paired" name="input" label="Input Collection"/>
10+
<param type="data" name="replacement" optional="true" label="Replace null elements with this dataset" help="If provided, null elements will be replaced with this dataset"/>
11+
</inputs>
12+
<outputs>
13+
<collection name="output" format_source="input" type_source="input" label="${on_string} (without null datasets)">
14+
</collection>
15+
</outputs>
16+
<tests>
17+
<test>
18+
<param name="input">
19+
<collection type="list">
20+
<element name="e1" value="simple_line.txt"/>
21+
</collection>
22+
</param>
23+
<output_collection name="output" type="list" count="1">
24+
<element name="e1">
25+
<assert_contents>
26+
<has_text_matching expression="^This is a line of text.\n$"/>
27+
</assert_contents>
28+
</element>
29+
</output_collection>
30+
</test>
31+
</tests>
32+
<help><![CDATA[
33+
34+
========
35+
Synopsis
36+
========
37+
38+
Removes null elements from a collection.
39+
40+
This tool takes a dataset collection and filters out nulls. This is useful for removing elements that resulted from conditional execution of jobs.
41+
42+
.. class:: infomark
43+
44+
This tool will create new history datasets from your collection but your quota usage will not increase.
45+
46+
]]></help>
47+
</tool>

lib/galaxy/tools/keep_success_collection.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</edam_operations>
1212
<inputs>
1313
<param type="data_collection" collection_type="list,list:paired" name="input" label="Input Collection" />
14-
<param type="data" name="replacement" optional="true" label="Replace unsuccessful elements with this dataset" help="If provided, unsuccessful elements will be replaced with this dataset"/>
1514
</inputs>
1615
<outputs>
1716
<collection name="output" format_source="input" type_source="input" label="${on_string} (only successed datasets)" >
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<tool id="__KEEP_SUCCESS_DATASETS__"
2+
name="Keep success"
3+
version="1.1.0"
4+
tool_type="keep_success_datasets_collection">
5+
<description></description>
6+
<type class="KeepSuccessDatasetsTool" module="galaxy.tools" />
7+
<action module="galaxy.tools.actions.model_operations"
8+
class="ModelOperationToolAction"/>
9+
<edam_operations>
10+
<edam_operation>operation_3695</edam_operation>
11+
</edam_operations>
12+
<inputs>
13+
<param type="data_collection" collection_type="list,list:paired" name="input" label="Input Collection" />
14+
<param type="data" name="replacement" optional="true" label="Replace unsuccessful elements with this dataset" help="If provided, unsuccessful elements will be replaced with this dataset"/>
15+
</inputs>
16+
<outputs>
17+
<collection name="output" format_source="input" type_source="input" label="${on_string} (only successed datasets)" >
18+
</collection>
19+
</outputs>
20+
<tests>
21+
<!-- Test framework has no way of creating a collection with
22+
unsuccess elements, so best we can do is verify identity on
23+
an okay collection.
24+
-->
25+
<test>
26+
<param name="input">
27+
<collection type="list">
28+
<element name="e1" value="simple_line.txt" />
29+
</collection>
30+
</param>
31+
<output_collection name="output" type="list">
32+
<element name="e1">
33+
<assert_contents>
34+
<has_text_matching expression="^This is a line of text.\n$" />
35+
</assert_contents>
36+
</element>
37+
</output_collection>
38+
</test>
39+
</tests>
40+
<help><![CDATA[
41+
42+
========
43+
Synopsis
44+
========
45+
46+
Keep datasets in success (green) from a collection.
47+
48+
===========
49+
Description
50+
===========
51+
52+
This tool takes a dataset collection and filters in (keep) datasets in the success (green) state. This is useful for continuing a multi-sample analysis when one of more of the samples fails or is in paused state.
53+
54+
.. image:: ${static_path}/images/tools/collection_ops/keep_success.svg
55+
:width: 500
56+
:alt: Keep success datasets
57+
58+
-----
59+
60+
.. class:: infomark
61+
62+
This tool will create new history datasets from your collection but your quota usage will not increase.
63+
64+
]]></help>
65+
</tool>

0 commit comments

Comments
 (0)