Skip to content

Instantly share code, notes, and snippets.

@hexylena
Created October 15, 2024 09:34
Show Gist options
  • Save hexylena/5a7f4cf2dbfb137aa012aab85e8f4cd4 to your computer and use it in GitHub Desktop.
Save hexylena/5a7f4cf2dbfb137aa012aab85e8f4cd4 to your computer and use it in GitHub Desktop.
testing tool(s) for galaxy
<?xml version="1.0"?>
<tool id="metadataFetch" name="Metadata" version="1.0" profile="16.04">
<description></description>
<command detect_errors="aggressive"><![CDATA[
echo "==tags==" >> $output;
#for tag in $input.tags:
echo "${tag.user_tname}" >> $output;
#end for
echo "==meta1==" >> $output;
echo "id: ${__app__.security.encode_id($input.id)}" >> $output;
echo "hid: ${input.hid}" >> $output;
echo "history_id: ${__app__.security.encode_id($input.history_id)}" >> $output;
echo "size = ${input.get_size(nice_size=True)}" >> $output;
echo "datatype.edam_format = ${input.datatype.edam_format}" >> $output;
echo "datatype.fileext = ${input.datatype.file_ext}" >> $output;
echo "==meta2==" >> $output;
#for (key, value) in $input.get_metadata().items():
echo "${key} = ${value}" >> $output;
#end for
echo "==history==" >> $output;
echo "history.user = ${input.history.user.email}" >> $output;
echo "history.user_id = ${input.history.user_id}" >> $output;
echo "history.get_display_name = ${input.history.get_display_name()}" >> $output;
echo "==tool==" >> $output;
echo "tool_id = ${input.creating_job.tool_id}" >> $output;
echo "tool_version = ${input.creating_job.tool_version}" >> $output;
echo "job_runner_name = ${input.creating_job.job_runner_name}" >> $output;
echo "handler = ${input.creating_job.handler}" >> $output;
echo "==trans==" >> $output;
echo "Infra URL: ${__app__.config.galaxy_infrastructure_url}"
echo "==builtin==" >> $output;
echo "__tool_directory__ = ${__tool_directory__}" >> $output;
echo "__new_file_path__ = ${__new_file_path__}" >> $output;
echo "__tool_data_path__ = ${__tool_data_path__}" >> $output;
echo "__root_dir__ = ${__root_dir__}" >> $output;
echo "__datatypes_config__ = ${__datatypes_config__}" >> $output;
echo "__user_id__ = ${__user_id__}" >> $output;
echo "__user_email__ = ${__user_email__}" >> $output;
echo "__app__ = ${__app__}" >> $output;
]]></command>
<inputs>
<param label="Data" name="input" type="data" />
</inputs>
<outputs>
<data format="txt" name="output"/>
</outputs>
<citations>
</citations>
<help>Dumps out all of the available metadata for inspection - hexylena</help>
</tool>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment