Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.0] Create harmonized collections from correct tool outputs #19222

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/galaxy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3660,14 +3660,13 @@ def produce_outputs(self, trans, out_data, output_collections, incoming, history
final_sorted_identifiers = [
element.element_identifier for element in elements1 if element.element_identifier in old_elements2_dict
]
# Raise Exception if it is empty
if len(final_sorted_identifiers) == 0:
# Create empty collections:
output_collections.create_collection(
next(iter(self.outputs.values())), "output1", elements={}, propagate_hda_tags=False
self.outputs["output1"], "output1", elements={}, propagate_hda_tags=False
)
output_collections.create_collection(
next(iter(self.outputs.values())), "output2", elements={}, propagate_hda_tags=False
self.outputs["output2"], "output2", elements={}, propagate_hda_tags=False
)
return

Expand All @@ -3685,7 +3684,7 @@ def output_with_selected_identifiers(old_elements_dict, output_label):
self._add_datasets_to_history(history, new_elements.values())
# Create collections:
output_collections.create_collection(
next(iter(self.outputs.values())), output_label, elements=new_elements, propagate_hda_tags=False
self.outputs[output_label], output_label, elements=new_elements, propagate_hda_tags=False
)

# Create outputs:
Expand Down
31 changes: 31 additions & 0 deletions lib/galaxy/tools/harmonize_two_collections_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,37 @@
<output_collection name="output1" type="list" count="0"/>
<output_collection name="output2" type="list" count="0"/>
</test>
<!-- test that collection types get propagated to outputs correctly -->
<test>
<param name="input1">
<collection type="list">
<element name="element_1" value="simple_line.txt" />
</collection>
</param>
<param name="input2">
<collection type="list:paired">
<element name="element_1">
<collection type="paired">
<element name="forward" value="1.fastqsanger" ftype="fastqsanger" />
<element name="reverse" value="1.fastqsanger" ftype="fastqsanger" />
</collection>
</element>
</collection>
</param>
<output_collection name="output1" type="list" count="1">
<element name="element_1">
<assert_contents>
<has_text_matching expression="^This is a line of text.\n$" />
</assert_contents>
</element>
</output_collection>
<output_collection name="output2" type="list:paired" count="1">
<element name="element_1">
<element name="forward" file="1.fastqsanger" ftype="fastqsanger" />
<element name="reverse" file="1.fastqsanger" ftype="fastqsanger" />
</element>
</output_collection>
</test>
</tests>
<help><![CDATA[

Expand Down
Loading