From f559ced17d3019cc7915dfbba4ba4d72e80630c8 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 19 Nov 2024 16:54:13 +0100 Subject: [PATCH 1/2] Prefer auto-decompressed datatype when picking conversion target Fixes https://github.com/galaxyproject/galaxy/issues/18709 --- lib/galaxy/datatypes/registry.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/datatypes/registry.py b/lib/galaxy/datatypes/registry.py index 671f30d82e16..a717dad0098f 100644 --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -881,7 +881,16 @@ def find_conversion_destination_for_dataset_by_extensions( if datatype and datatype.matches_any(accepted_datatypes): return True, None, None - for convert_ext in self.get_converters_by_datatype(ext): + converter_extensions = self.get_converters_by_datatype(ext) + uncompressed_instance = getattr(datatype, "uncompressed_datatype_instance", None) + if uncompressed_instance and uncompressed_instance.file_ext in converter_extensions: + # sort uncompressed instance ahead of other possible conversions + converter_extensions = [ + uncompressed_instance.file_ext, + *(ext for ext in converter_extensions if ext != uncompressed_instance.file_ext), + ] + + for convert_ext in converter_extensions: convert_ext_datatype = self.get_datatype_by_extension(convert_ext) if convert_ext_datatype is None: self.log.warning( From 974d7e58bf56522175120c619e047cfd423374d2 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 19 Nov 2024 17:21:45 +0100 Subject: [PATCH 2/2] Tighten conversion target input This way we test that conversion to txt occurs via fasta, not the fasta to tabular converter. --- test/functional/tools/implicit_conversion_format_input.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/tools/implicit_conversion_format_input.xml b/test/functional/tools/implicit_conversion_format_input.xml index e93f54095592..090aa474f0fc 100644 --- a/test/functional/tools/implicit_conversion_format_input.xml +++ b/test/functional/tools/implicit_conversion_format_input.xml @@ -3,7 +3,7 @@ cut -f 1 '$input1' > '$output1' - +