Skip to content

Commit

Permalink
Fix output datatype when uncompressing a dataset with incorrect datatype
Browse files Browse the repository at this point in the history
with the ``CONVERTER_gz_to_uncompressed`` tool.

Previously, if a user forced an incorrect datatype to a compressed input
dataset (e.g. `fastqsanger` instead of `fastqsanger.gz`), then the output
datatype assigned by this tool would be an invalid one (`fastqsan`).

Fix galaxyproject#17938.
  • Loading branch information
nsoranzo committed Apr 9, 2024
1 parent 77fc849 commit 0611465
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/galaxy/datatypes/converters/gz_to_uncompressed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gzip -dcf '$input1' > '$output1'
<configfiles>
<configfile name="ext_config">{"output1": {
"name": "${input1.name[0:-len('.gz')] if $input1.name.endswith('.gz') else $input1.name} uncompressed",
"ext": "${input1.ext[0:-len('.gz')] if $input1.ext != 'vcf_bgzip' else 'vcf'}"
"ext": "${'vcf' if $input1.ext == 'vcf_bgzip' else $input1.ext[0:-len('.gz')] if $input1.ext.endswith('.gz') else $input1.ext}"
}}</configfile>
</configfiles>
<inputs>
Expand All @@ -21,6 +21,15 @@ gzip -dcf '$input1' > '$output1'
<param name="input1" value="test.vcf.gz" ftype="vcf_bgzip"/>
<output name="output1" file="test.vcf" ftype="vcf"/>
</test>
<test>
<param name="input1" value="1.fasta.gz" ftype="fasta.gz"/>
<output name="output1" file="1.fasta" ftype="fasta"/>
</test>
<!-- Test input with wrong format -->
<test>
<param name="input1" value="1.fasta.gz" ftype="fasta"/>
<output name="output1" file="1.fasta" ftype="fasta"/>
</test>
</tests>
<help>
</help>
Expand Down

0 comments on commit 0611465

Please sign in to comment.