Skip to content

Commit ee5f807

Browse files
authored
Merge pull request #19222 from wm75/fix-harmonize
[24.0] Create harmonized collections from correct tool outputs
2 parents 1e6a5c0 + 891d7aa commit ee5f807

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

lib/galaxy/tools/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3660,14 +3660,13 @@ def produce_outputs(self, trans, out_data, output_collections, incoming, history
36603660
final_sorted_identifiers = [
36613661
element.element_identifier for element in elements1 if element.element_identifier in old_elements2_dict
36623662
]
3663-
# Raise Exception if it is empty
36643663
if len(final_sorted_identifiers) == 0:
36653664
# Create empty collections:
36663665
output_collections.create_collection(
3667-
next(iter(self.outputs.values())), "output1", elements={}, propagate_hda_tags=False
3666+
self.outputs["output1"], "output1", elements={}, propagate_hda_tags=False
36683667
)
36693668
output_collections.create_collection(
3670-
next(iter(self.outputs.values())), "output2", elements={}, propagate_hda_tags=False
3669+
self.outputs["output2"], "output2", elements={}, propagate_hda_tags=False
36713670
)
36723671
return
36733672

@@ -3685,7 +3684,7 @@ def output_with_selected_identifiers(old_elements_dict, output_label):
36853684
self._add_datasets_to_history(history, new_elements.values())
36863685
# Create collections:
36873686
output_collections.create_collection(
3688-
next(iter(self.outputs.values())), output_label, elements=new_elements, propagate_hda_tags=False
3687+
self.outputs[output_label], output_label, elements=new_elements, propagate_hda_tags=False
36893688
)
36903689

36913690
# Create outputs:

lib/galaxy/tools/harmonize_two_collections_list.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,37 @@
171171
<output_collection name="output1" type="list" count="0"/>
172172
<output_collection name="output2" type="list" count="0"/>
173173
</test>
174+
<!-- test that collection types get propagated to outputs correctly -->
175+
<test>
176+
<param name="input1">
177+
<collection type="list">
178+
<element name="element_1" value="simple_line.txt" />
179+
</collection>
180+
</param>
181+
<param name="input2">
182+
<collection type="list:paired">
183+
<element name="element_1">
184+
<collection type="paired">
185+
<element name="forward" value="1.fastqsanger" ftype="fastqsanger" />
186+
<element name="reverse" value="1.fastqsanger" ftype="fastqsanger" />
187+
</collection>
188+
</element>
189+
</collection>
190+
</param>
191+
<output_collection name="output1" type="list" count="1">
192+
<element name="element_1">
193+
<assert_contents>
194+
<has_text_matching expression="^This is a line of text.\n$" />
195+
</assert_contents>
196+
</element>
197+
</output_collection>
198+
<output_collection name="output2" type="list:paired" count="1">
199+
<element name="element_1">
200+
<element name="forward" file="1.fastqsanger" ftype="fastqsanger" />
201+
<element name="reverse" file="1.fastqsanger" ftype="fastqsanger" />
202+
</element>
203+
</output_collection>
204+
</test>
174205
</tests>
175206
<help><![CDATA[
176207

0 commit comments

Comments
 (0)