Skip to content

Commit

Permalink
Merge pull request #59 from keara-soloway/31-cicd-for-galaxy-tools
Browse files Browse the repository at this point in the history
Unify galaxy tool versions, dependencies on the chessanalysispipeline package, and citations of the same though a new macros.xml file.

Add a github action to update the testtoolshed repo whenever a new version of chessanalysispipeline is created.
  • Loading branch information
keara-soloway authored Jun 22, 2023
2 parents dfe15e7 + 5c89a7f commit ee1df7d
Show file tree
Hide file tree
Showing 23 changed files with 201 additions and 162 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/galaxy-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: galaxy-tools

on:
push:
tags:
- v*.*.*

jobs:
update-toolshed-repo:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install planemo
run: |
python -m pip install --upgrade pip
pip install planemo
- name: Update tool version macro with CHAP version (tag) name
run: |
sed -i "s/PACKAGE_VERSION/${{ github.ref_name }}/" galaxy-tools/macros.xml
- name: Update toolshed
run: |
planemo shed_update --shed_target testtoolshed --shed_key ${{secrets.XIMGCHESS_TESTTOOLSHED_KEY}}$ galaxy-tools
73 changes: 34 additions & 39 deletions galaxy-tools/chap/chap.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
<tool id="CHAP_test" name="CHESS Analysis Pipeline" version="0.1.0+galaxy0" python_template_version="3.5" profile="21.05">
<requirements>
<requirement type="package" version="0.0.2">ChessAnalysisPipeline</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
cp '$input' data.csv &&
CHAP --config '$config' &&
]]></command>
<inputs>
<param type="data" name="config" format="yaml" />
<param type="data" name="input" format="csv" />
</inputs>
<outputs>
<data name="output" format="json" />
</outputs>
<tests>
<test>
<param name="config" value="config.yaml"/>
<param name="input" value="data.csv"/>
</test>
</tests>
<help><![CDATA[
CHESS Analysis Pipeline (CHAP):
<tool id="CHAP_test" name="CHESS Analysis Pipeline" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" python_template_version="@PYTHON_TEMPLATE_VERSION@" profile="@PROFILE@">
<macros>
<import>../macros.xml</import>
</macros>
<requirements>
<expand macro="chap-requirement" />
</requirements>
<command detect_errors="exit_code"><![CDATA[
cp '$input' data.csv &&
CHAP --config '$config' &&
]]></command>
<inputs>
<param type="data" name="config" format="yaml" />
<param type="data" name="input" format="csv" />
</inputs>
<outputs>
<data name="output" format="json" />
</outputs>
<tests>
<test>
<param name="config" value="config.yaml"/>
<param name="input" value="data.csv"/>
</test>
</tests>
<help><![CDATA[
CHESS Analysis Pipeline (CHAP):
To run it on command line you'll use:
CHAP --config CONFIG
To run it on command line you'll use:
CHAP --config CONFIG
To run it within galaxy you'll only need to upload your
required configuration pipeline and necessary data.
]]></help>
<citations>
<citation type="bibtex">
@misc{githubChessAnalysisPipeline,
author = {LastTODO, FirstTODO},
year = {TODO},
title = {ChessAnalysisPipeline},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://github.com/CHESSComputing/ChessAnalysisPipeline},
}</citation>
</citations>
To run it within galaxy you'll only need to upload your
required configuration pipeline and necessary data.
]]></help>
<citations>
<expand macro="chap-citation" />
</citations>
</tool>
71 changes: 33 additions & 38 deletions galaxy-tools/inference/chapmlaas.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
<tool id="CHAP_inference_demo" name="CHAP MLaaS" version="0.1.0+galaxy0" python_template_version="3.5" profile="21.05">
<requirements>
<requirement type="package" version="2.28.2">requests</requirement>
<requirement type="package" version="0.0.2">chessanalysispipeline</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
cp '$input' data.csv &&
cp '$image' img.png &&
CHAP --config '$config' &&
cp preds.json '$output'
]]></command>
<inputs>
<param type="data" name="config" format="yaml" />
<param type="data" name="input" format="csv" />
<param type="data" name="image" format="png" />
</inputs>
<outputs>
<data name="output" format="json" />
</outputs>
<tests>
<test>
<param name="config" value="config.yaml"/>
<param name="input" value="data.csv"/>
<param name="image" value="img.png"/>
</test>
</tests>
<help><![CDATA[
<tool id="CHAP_inference_demo" name="CHAP MLaaS" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" python_template_version="@PYTHON_TEMPLATE_VERSION@" profile="@PROFILE@">
<macros>
<import>../macros.xml</import>
</macros>
<requirements>
<requirement type="package" version="2.28.2">requests</requirement>
<expand macro="chap-requirement" />
</requirements>
<command detect_errors="exit_code"><![CDATA[
cp '$input' data.csv &&
cp '$image' img.png &&
CHAP --config '$config' &&
cp preds.json '$output'
]]></command>
<inputs>
<param type="data" name="config" format="yaml" />
<param type="data" name="input" format="csv" />
<param type="data" name="image" format="png" />
</inputs>
<outputs>
<data name="output" format="json" />
</outputs>
<tests>
<test>
<param name="config" value="config.yaml"/>
<param name="input" value="data.csv"/>
<param name="image" value="img.png"/>
</test>
</tests>
<help><![CDATA[
CHESS Analysis Pipeline (CHAP) with Machine Learning as a Service (MLaaS)
To run it you need the following:
Expand All @@ -45,15 +48,7 @@ pipeline:
filename: preds.json
]]></help>
<citations>
<citation type="bibtex">
@misc{githubChessAnalysisPipeline,
author = {Kuznetsov, Valentin},
year = {2023},
title = {ChessAnalysisPipeline},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://github.com/CHESSComputing/ChessAnalysisPipeline},
}</citation>
</citations>
<citations>
<expand macro="chap-citation" />
</citations>
</tool>
12 changes: 12 additions & 0 deletions galaxy-tools/macros.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<macros>
<token name="@TOOL_VERSION@">PACKAGE_VERSION</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@PROFILE@">21.09</token>
<token name="@PYTHON_TEMPLATE_VERSION@">3.11</token>
<xml name="chap-requirement">
<requirement type="package" version="@TOOL_VERSION@">chessanalysispipeline</requirement>
</xml>
<xml name="chap-citation">
<citation type="doi">10.5281/zenodo.7963532</citation>
</xml>
</macros>
12 changes: 12 additions & 0 deletions galaxy-tools/saxswaxs/det.poni
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Nota: C-Order, 1 refers to the Y axis, 2 to the X axis
# Calibration done at Wed May 24 10:05:27 2023
poni_version: 2
Detector: Pilatus300k
Detector_config: {}
Distance: 1
Poni1: 0
Poni2: 0
Rot1: 0
Rot2: 0
Rot3: 0
Wavelength: 1.54e-10
15 changes: 7 additions & 8 deletions galaxy-tools/saxswaxs/integration.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
tool_type: integration
title: saxs_azimuthal
title: reduced_data
integration_type: azimuthal
detectors:
- prefix: PIL5
poni_file: PIL5.poni
mask_file: PIL5.tif
radial_units: q_A^-1
radial_min: 0.0
radial_max: 0.21821
- prefix: det
poni_file: det.poni
radial_units: q_nm^-1
radial_min: 0.01372382
radial_max: 5.47580553
radial_npt: 200
azimuthal_units: chi_deg
azimuthal_min: -180.0
azimuthal_max: 180.0
azimuthal_npt: 180
azimuthal_npt: 180
24 changes: 9 additions & 15 deletions galaxy-tools/saxswaxs/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@ title: test_1d
station: id3b
experiment_type: SAXSWAXS
sample:
name: sample_14_align
name: sample_name
spec_scans:
- spec_file: test_1d
scan_numbers:
- 1
- spec_file: test_scans
scan_numbers: [1, 2, 3]
independent_dimensions:
- label: samx
- label: mtr_0
units: mm
data_type: spec_motor
name: samx
presample_intensity:
data_type: scan_column
name: ic3
dwell_time_actual:
data_type: scan_column
name: sec_2
postsample_intensity:
data_type: scan_column
name: diode
name: mtr_0
- label: mtr_1
units: mm
data_type: spec_motor
name: mtr_1
77 changes: 36 additions & 41 deletions galaxy-tools/saxswaxs/reduce.xml
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
<tool id="CHAP_saxswaxs_reduce" name="SAXSWAXS Reduce Map" version="0.1.0+galaxy0" python_template_version="3.5" profile="21.05">
<requirements>
<requirement type="package" version="0.0.8">chessanalysispipeline</requirement>
<requirement type="package" version="1.0.1">nexusformat</requirement>
<requirement type="package" version="2023.3.0">pyfai</requirement>
<requirement type="package" version="1.10.7">pydantic</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
pip --exists-action i install certif-pyspec==1.5.3 &&
cp '$mapconfig' map.yaml &&
cp '$integrationconfig' integration.yaml &&
CHAP --config '$__tool_directory__/pipeline.yaml'
]]></command>
<inputs>
<param type="data" name="mapconfig" format="yaml" />
<param type="data" name="integrationconfig" format="yaml" />
</inputs>
<outputs>
<data name="reduceddata" label="Map of reduced data" format="nex" from_work_dir="map_reduceddata.nxs"/>
</outputs>
<tests>
<test>
<param name="mapconfig" value="map.yaml"/>
<param name="integrationconfig" value="integration.yaml"/>
<output name="reduceddata" value="map_reduceddata.nxs"/>
</test>
</tests>
<help><![CDATA[
usage: PROG [-h] [--config CONFIG] [--verbose]
<tool id="CHAP_saxswaxs_reduce" name="SAXSWAXS Reduce Map" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" python_template_version="@PYTHON_TEMPLATE_VERSION@" profile="@PROFILE@">
<macros>
<import>../macros.xml</import>
</macros>
<requirements>
<expand macro="chap-requirement" />
<requirement type="package" version="1.0.1">nexusformat</requirement>
<requirement type="package" version="2023.3.0">pyfai</requirement>
<requirement type="package" version="1.10.7">pydantic</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
pip --exists-action i install certif-pyspec==1.5.3 &&
cp '$mapconfig' map.yaml &&
cp '$integrationconfig' integration.yaml &&
CHAP --config '$__tool_directory__/pipeline.yaml'
]]></command>
<inputs>
<param type="data" name="mapconfig" format="yaml" />
<param type="data" name="integrationconfig" format="yaml" />
</inputs>
<outputs>
<data name="reduceddata" label="Map of reduced data" format="nex" from_work_dir="map_reduceddata.nxs"/>
</outputs>
<tests>
<test>
<param name="mapconfig" value="map.yaml"/>
<param name="integrationconfig" value="integration.yaml"/>
<output name="reduceddata" value="map_reduceddata.nxs"/>
</test>
</tests>
<help><![CDATA[
usage: PROG [-h] [--config CONFIG] [--verbose]
options:
-h, --help show this help message and exit
--config CONFIG Input configuration file
--verbose verbose output
]]></help>
<citations>
<citation type="bibtex">
@misc{githubChessAnalysisPipeline,
author = {LastTODO, FirstTODO},
year = {TODO},
title = {CHAPSAXSWAXSdemo},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://github.com/CHESSComputing/ChessAnalysisPipeline},
}</citation>
</citations>
]]></help>
<citations>
<expand macro="chap-citation" />
</citations>
</tool>
22 changes: 22 additions & 0 deletions galaxy-tools/saxswaxs/test_scans
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#F test_scans
#E 1684937343
#O0 mtr_0
#o0 mtr_0
#S 1 ascan mtr_1 -1 1 2 1
#P0 -1
#L mtr_1 counter_0
-1 0.5970827916509526
0 0.8235129241022665
1 0.5112369186482792
#S 2 ascan mtr_1 -1 1 2 1
#P0 0
#L mtr_1 counter_0
-1 0.5993819559229079
0 0.7377995537968701
1 0.1865718135324972
#S 3 ascan mtr_1 -1 1 2 1
#P0 1
#L mtr_1 counter_0
-1 0.9943311654787657
0 0.07937636730740139
1 0.021956904524402576
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion galaxy-tools/tomo/tomo_combine.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<tool id="CHAP_tomo_combine" name="Tomo Combine" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@" python_template_version="@PYTHON_TEMPLATE_VERSION@">
<tool id="CHAP_tomo_combine" name="Tomo Combine" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" python_template_version="@PYTHON_TEMPLATE_VERSION@">
<description>Combine tomography stacks</description>
<macros>
<import>../macros.xml</import>
<import>tomo_macros.xml</import>
</macros>
<expand macro="requirements"/>
Expand Down
3 changes: 2 additions & 1 deletion galaxy-tools/tomo/tomo_find_center.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<tool id="CHAP_tomo_find_center" name="Tomo Find Center" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@" python_template_version="@PYTHON_TEMPLATE_VERSION@">
<tool id="CHAP_tomo_find_center" name="Tomo Find Center" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" python_template_version="@PYTHON_TEMPLATE_VERSION@">
<description>Find rotation axis centers for the tomography stacks</description>
<macros>
<import>../macros.xml</import>
<import>tomo_macros.xml</import>
</macros>
<expand macro="requirements"/>
Expand Down
Loading

0 comments on commit ee1df7d

Please sign in to comment.