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.1] Improve relabel identifiers message when number of columns is not 2 #18634

Merged
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
8 changes: 7 additions & 1 deletion lib/galaxy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3812,8 +3812,14 @@ def add_copied_value_to_new_elements(new_label, dce_object):
if how_type == "tabular":
# We have a tabular file, where the first column is an existing element identifier,
# and the second column is the new element identifier.
new_labels_dict = {}
source_new_label = (line.strip().split("\t") for line in new_labels)
new_labels_dict = dict(source_new_label)
for i, label_pair in enumerate(source_new_label):
if not len(label_pair) == 2:
raise exceptions.MessageException(
f"Relabel mapping file line {i + 1} contains {len(label_pair)} columns, but 2 are required"
)
new_labels_dict[label_pair[0]] = label_pair[1]
for dce in hdca.collection.elements:
dce_object = dce.element_object
element_identifier = dce.element_identifier
Expand Down
Loading