mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #11764 from mvdbeek/fix_format_input_implicit_conversion
[21.01] Fix format="input" with implicit conversions
This commit is contained in:
@@ -975,6 +975,13 @@ def determine_output_format(output, parameter_context, input_datasets, input_dat
|
||||
# the type should match the input
|
||||
ext = output.format
|
||||
if ext == "input":
|
||||
if input_datasets and random_input_ext in {'data', 'auto'}:
|
||||
# Probably dealing with an implicitly converted dataset
|
||||
try:
|
||||
first_input_dataset = next(iter(input_datasets.values()))
|
||||
random_input_ext = get_ext_or_implicit_ext(first_input_dataset)
|
||||
except Exception:
|
||||
pass
|
||||
ext = random_input_ext
|
||||
format_source = output.format_source
|
||||
if format_source is not None and format_source in input_datasets:
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<tool id="implicit_conversion_format_input" name="implicit_conversion with input format">
|
||||
<command>
|
||||
cut -f 1 '$input1' > '$output1'
|
||||
</command>
|
||||
<inputs>
|
||||
<param type="data" format="fasta" name="input1" label="Input 1" />
|
||||
</inputs>
|
||||
<outputs>
|
||||
<data name="output1" format="input" />
|
||||
</outputs>
|
||||
<tests>
|
||||
<!-- Test implicit conversion. -->
|
||||
<test>
|
||||
<param name="input1" value="1.fasta.gz" ftype="fasta.gz" />
|
||||
<output name="output1" ftype="fasta">
|
||||
<assert_contents>
|
||||
<has_line line=">hg17" />
|
||||
</assert_contents>
|
||||
</output>
|
||||
</test>
|
||||
</tests>
|
||||
</tool>
|
||||
@@ -133,6 +133,7 @@
|
||||
<tool file="empty_output.xml" />
|
||||
<tool file="validation_empty_dataset.xml" />
|
||||
<tool file="implicit_conversion.xml" />
|
||||
<tool file="implicit_conversion_format_input.xml" />
|
||||
<tool file="implicit_collection_conversion.xml" />
|
||||
<tool file="implicit_nested_list_conversion.xml" />
|
||||
<tool file="explicit_conversion.xml" />
|
||||
|
||||
Reference in New Issue
Block a user