mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-11-29 04:17:00 +08:00
The sanitize option gained two values - replace spaces, and replace "/" and spaces - and "/" is now documented as always surviving in user-supplied names. Results are unchanged for the values 0.1.0 accepted: "/" and "" both reduce the new named-path character set to the empty tuple 0.1.0 hardcoded, and the auto branches build the same tuple either way. The bump is for the input form, which now offers options an older job was never able to pick. export_remote.xml carries 0.2.0 and the untouched 0.1.0 is frozen as export_remote_0.1.0.xml, with both registered in tool_conf.xml.sample and the framework sample_tool_conf.xml. Note this inverts the convention used by the bundled collection operation tools, where the bare filename holds the old version and the new one carries the version suffix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
76 lines
4.1 KiB
XML
76 lines
4.1 KiB
XML
<tool id="export_remote" name="Export datasets" version="0.1.0" profile="21.05">
|
|
<description>to repositories</description>
|
|
<!-- TODO
|
|
<requirements>
|
|
<requirement type="package" version="21.05">galaxy-files</requirement>
|
|
</requirements>
|
|
-->
|
|
<command><![CDATA[
|
|
python '$__tool_directory__/export_remote.py'
|
|
--file-sources '$file_sources'
|
|
--inputs '$inputs'
|
|
--files-to-export '$files_to_export'
|
|
#if $include_metadata_files:
|
|
--export-metadata-files $include_metadata_files
|
|
#end if
|
|
> '$out'
|
|
]]></command>
|
|
<configfiles>
|
|
<file_sources name="file_sources"/>
|
|
<inputs name="inputs" />
|
|
<configfile name="files_to_export">#import json
|
|
#from galaxy.util import filesystem_safe_string
|
|
#if $export_type.export_type_selector == "datasets_auto":
|
|
#set $fileconfig = json.dumps($export_type.infiles.serialize(invalid_chars=tuple(str($invalid_chars))))
|
|
#else if $export_type.export_type_selector == "collection_auto":
|
|
#set $fileconfig = json.dumps($export_type.incollection.serialize(invalid_chars=tuple(str($invalid_chars)), include_collection_name=bool($export_type.include_collection_name)))
|
|
#else
|
|
#set $fileconfig = [d['infile'].serialize() for d in $export_type.datasets]
|
|
#for $i, $dataset in enumerate($export_type.datasets):
|
|
#silent $fileconfig[$i]['staging_path'] = filesystem_safe_string(str(dataset["name"]), 255, invalid_chars=())
|
|
#end for
|
|
#silent fileconfig = json.dumps($fileconfig)
|
|
#end if
|
|
$fileconfig
|
|
</configfile>
|
|
</configfiles>
|
|
<inputs>
|
|
<conditional name="export_type">
|
|
<param name="export_type_selector" type="select" label="What would you like to export?">
|
|
<option value="datasets_auto" selected="true">Datasets using their Galaxy name and extension</option>
|
|
<option value="collection_auto">Dataset Collection using their name, structure and extension</option>
|
|
<option value="datasets_named">Datasets specifying their names</option>
|
|
<!-- Allow more options - e.g. HTML, collections preserving their structure... -->
|
|
</param>
|
|
<when value="datasets_auto">
|
|
<param name="infiles" type="data" format="data" multiple="true" label="Choose your datasets" help="Datasets must have unique names"/>
|
|
</when>
|
|
<when value="collection_auto">
|
|
<param name="incollection" type="data_collection" format="data" label="Choose your dataset collection" help="Dataset collection will be exported. Collections will become folders and datasets will be files"/>
|
|
<param name="include_collection_name" type="boolean" label="Include the collection name as top level directory?"/>
|
|
</when>
|
|
<when value="datasets_named">
|
|
<repeat name="datasets" title="Dataset">
|
|
<param type="data" format="data" name="infile" label="Input dataset"/>
|
|
<param type="text" name="name" label="Enter file name" help="To create a file named "f1.txt" in directory named "dir1" enter "dir1/f1.txt"">
|
|
<!-- 🔥 turn off sanitizer, so unicode strings can be used. Is sanitized in configfile -->
|
|
<sanitizer sanitize="false"/>
|
|
<validator type="length" min="1" max="255"/>
|
|
</param>
|
|
</repeat>
|
|
</when>
|
|
</conditional>
|
|
<param type="directory_uri" name="d_uri" label="Directory URI"/>
|
|
<param name="include_metadata_files" type="boolean" checked="true" label="Include metadata files in export?" help="Examples of metadata files are bam, cram and vcf indexes that can be regenerated from raw data"/>
|
|
<param name="invalid_chars" type="select" label="Select which characters should be stripped from the exported paths">
|
|
<option value="/">Sanitize /</option>
|
|
<option value="">Don't sanitize values</option>
|
|
</param>
|
|
</inputs>
|
|
<outputs>
|
|
<data name="out" format="txt" label="Export logs"/>
|
|
</outputs>
|
|
<tests>
|
|
</tests>
|
|
</tool>
|