Skip to content

Commit

Permalink
fix xml, add macros.xml and README
Browse files Browse the repository at this point in the history
  • Loading branch information
mthang committed Sep 19, 2024
1 parent 10f536f commit fb38cdc
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 16 deletions.
27 changes: 25 additions & 2 deletions tools/aarnetfilesender/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# AARNet FileSender
ENA-upload-cli wrapper
======================

This is a wrapper for AARNet's FileSender, using the FileSender CLI tool.
Galaxy wrapper of the AARNET
`filesender <https://support.aarnet.edu.au/hc/en-us/articles/230067927-Send-files-with-FileSender>`__.

Setting up credentials on Galaxy
--------------------------------

The admin can enable users to set their own credentials
for this tool. To enable it, make sure the file
``config/user_preferences_extra_conf.yml`` has the following section:

.. code-block:: yaml

aarnet_filesender_account:
description: AARNet FileSender Account Info
inputs:
- name: username
label: AARNet FileSender Username
type: text
required: False
- name: apikey
label: AARNet FileSender API Key
type: password
required: False
36 changes: 22 additions & 14 deletions tools/aarnetfilesender/filesender.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
<?xml version="1.0"?>

<tool id="aarnet_filesender" name="AARNet FileSender" version="3.0.0" workflow_compatible="true">
<requirements>
<requirement type="package" version="3.0.0">filesendercli</requirement>
</requirements>
<tool id="aarnet_filesender" name="AARNet FileSender" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
<description>transfer files to AARnet's FileSender Service</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements" />
<expand macro="version_command" />
<command detect_errors="exit_code"><![CDATA[
#set $apiuser = $__user__.extra_preferences.get('aarnet_filesender_account|username', "").strip()
#set $apikey = $__user__.extra_preferences.get('aarnet_filesender_account|apikey', "").strip()
#if $apiuser == "":
#if $apiuser == "" or $apikey == "":
echo "ERROR: Please enter your FileSender Username in your user preferences under the AARNet FileSender Account Info section" &&
exit 1;
#end if
#if $apikey == "":
echo "ERROR: Please enter your FileSender API Key in your user preferences under the AARNet FileSender Account Info section" &&
exit 1;
#end if
#if $to == "":
echo "WARNING: recipent email not set, setting to $__user_email__" &&
#set $to = $__user_email__
Expand All @@ -34,15 +30,27 @@ mkdir filestosend &&
#end for
filesender -p -u '$apiuser' -a '$apikey' -b https://filesender.aarnet.edu.au/rest.php -f "[email protected]" -r '$to' filestosend >$output 2>&1
]]></command>
<inputs>
<param name="data" type="data" multiple="true" optional="false" label="Datasets to be sent:" />
<param name="data" type="data" format="txt,data" multiple="true" optional="false" label="Datasets to be sent:" />
<param name="to" type="text" optional="false" label="Email address of recipent:"><sanitizer sanitize="False"/></param>
</inputs>
<outputs>
<data name="output" type="data" format="txt" hidden="false"/>
</outputs>
<tests>
<!-- TODO planemo failed due to both username and apikey are null-->
<test>
<param name="data" value="summary_statistics.txt"/>
<output name="output">
<assert_contents>
<has_text text="Uploading"/>
<has_text text="log complete"/>
<has_text text="Upload Complete"/>
</assert_contents>
</output>
</test>
</tests>
<help>
**What it does**
Send dataset(s) from Galaxy to anyone via AARNet's FileSender service.
Expand Down
3 changes: 3 additions & 0 deletions tools/aarnetfilesender/test-data/output.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Uploading: Xnatutils on data 2424: log 100%
Xnatutils on data 2424: log complete
Upload Complete
5 changes: 5 additions & 0 deletions tools/aarnetfilesender/test-data/summary_statistics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Core genes (99% <= strains <= 100%) 251
Soft core genes (95% <= strains < 99%) 0
Shell genes (15% <= strains < 95%) 0
Cloud genes (0% <= strains < 15%) 0
Total genes (0% <= strains <= 100%) 251

0 comments on commit fb38cdc

Please sign in to comment.