Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved CTD to galaxy conversion #54

Merged
merged 123 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 113 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
896c380
test data: initial commit
bernt-matthias Jul 6, 2019
c549147
add unit tests
Tomnl Jul 9, 2019
2a4ae8d
switch CTDopts branch
bernt-matthias Jul 15, 2019
81f5465
fixed CTDopts branch name
bernt-matthias Jul 15, 2019
1ebc562
improved indentation of float.ctd
bernt-matthias Jul 15, 2019
79e516d
update test results
bernt-matthias Jul 15, 2019
8d58f90
added test files for bool, in/out files
bernt-matthias Jul 15, 2019
c8ec983
- added filetypes to test call
bernt-matthias Jul 16, 2019
a2efdb1
added filetypes.txt
bernt-matthias Jul 16, 2019
c3947af
advanced repeats were not advanced
bernt-matthias Jul 16, 2019
1376b84
add missing tests
bernt-matthias Jul 16, 2019
616074d
make help and command CDATA
bernt-matthias Jul 6, 2019
b94253f
render all bools are rendered as booleans
bernt-matthias Jul 17, 2019
d4e1965
improved handling of selects & always render optional
bernt-matthias Jul 18, 2019
84cd70f
fix specification of select default value
bernt-matthias Jul 18, 2019
c966a9d
fix indentation of advanced parameters in command block
bernt-matthias Jul 18, 2019
e33b637
use argument attribute, remove size attribute
bernt-matthias Jul 6, 2019
828f6ba
int and float wo default need empty value attribute
bernt-matthias Jul 19, 2019
0dfe02e
simplify code for advanced node generation
bernt-matthias Jul 19, 2019
216bea1
Itemlist (wo restrictions) as comma separated list
bernt-matthias Jul 22, 2019
c7d3905
remove duplicate format entries in inputs
bernt-matthias Jul 22, 2019
0c23fd0
remove sanitizer from input files
bernt-matthias Jul 22, 2019
e40979a
infile input needs no help info that a comma separated list is needed
bernt-matthias Jul 23, 2019
0f08f32
bool input for optional outputs
bernt-matthias Jul 23, 2019
269e8d5
further simplify cli generation
bernt-matthias Jul 23, 2019
54032d1
link input files to identifier.ext
bernt-matthias Jul 24, 2019
bcbc524
added code to autogenerate a simple test for unit tests
bernt-matthias Jul 26, 2019
a573a70
test w expect_num_outputs and some bug fixes in cli generation
bernt-matthias Jul 26, 2019
e926ad7
add bool as in ctd 1.7
bernt-matthias Jul 26, 2019
1b63455
allow for list outputs
bernt-matthias Jul 26, 2019
d40c31b
multiple outputs:
bernt-matthias Aug 11, 2019
3d6ccf3
make default data type txt
bernt-matthias Nov 11, 2019
134d66a
cont.
bernt-matthias Nov 13, 2019
8b68ea2
fixed category in test ctd files
bernt-matthias Nov 13, 2019
d772ea2
add argument attribute
bernt-matthias Nov 13, 2019
ab94c12
- add option to integrate automatically generated tests
bernt-matthias Nov 13, 2019
8e419b2
- improve parsing of hardcoded values file
bernt-matthias Nov 16, 2019
0d0ee61
cont
bernt-matthias Nov 26, 2019
5aaa7d0
switch to exit_code (instead of aggressive)
bernt-matthias Nov 26, 2019
732d0a4
switched to yml hased hardcoder
bernt-matthias Nov 26, 2019
1123e37
switch to json hardcoder
bernt-matthias Nov 27, 2019
a193c91
add special case for booleans
bernt-matthias Nov 27, 2019
af2dcef
big update
bernt-matthias Dec 9, 2019
e92ea6d
remove . from element identifiers
bernt-matthias Dec 9, 2019
aab3495
fixed output handling
bernt-matthias Dec 10, 2019
3c2902c
updates: no if for optional strings
bernt-matthias Dec 13, 2019
6981bed
improvements test macros, type conversion, command line
bernt-matthias Dec 19, 2019
9779959
single quotes for itemlist strings
bernt-matthias Dec 19, 2019
84bef83
fixes for listitems
bernt-matthias Dec 20, 2019
bbef513
fixed ofile command line handling
bernt-matthias Dec 21, 2019
33fc035
outfile handling improvements
bernt-matthias Dec 29, 2019
4c3f53a
add missing attributes to output boolean
bernt-matthias Dec 29, 2019
b768604
update test data
bernt-matthias Dec 29, 2019
2e676ee
add script to create Galaxy tool xml files for tests
bernt-matthias Dec 29, 2019
da3a9ae
revert to double quotes .. for now
bernt-matthias Dec 30, 2019
0b49233
hardcoding CTD restrictions, format selector
bernt-matthias Jan 8, 2020
04ffc0f
fix optional restricted itemlists
bernt-matthias Jan 11, 2020
652f6ea
remove value attrribute from selects
bernt-matthias Jan 12, 2020
eb27e68
use a available server but unavailable URL in tests
bernt-matthias Jan 14, 2020
b04e191
add test for param, label and help generation
bernt-matthias Jan 14, 2020
4a4149c
simplify and improve label/help generation
bernt-matthias Jan 14, 2020
8539619
add Galaxy section analoguous to CTD nodes
bernt-matthias Jan 16, 2020
0882c5b
sections: description -> title
bernt-matthias Jan 17, 2020
30f7062
sections: title and help
bernt-matthias Jan 17, 2020
83c09cb
prototype for CTD based input
bernt-matthias Jan 18, 2020
260768a
also parse params + test only generation
bernt-matthias Jan 23, 2020
11d0103
update test
bernt-matthias Jan 24, 2020
5ee83cc
python3 and pep8
bernt-matthias Jan 24, 2020
3e704ef
f
bernt-matthias Jan 24, 2020
036061e
make formats sorted
bernt-matthias Jan 24, 2020
519ce2f
fix
bernt-matthias Jan 24, 2020
7398716
update test data for filetype sorting
bernt-matthias Jan 27, 2020
218efde
no lint but test
bernt-matthias Jan 27, 2020
94ac13b
testing improvements and fixes
bernt-matthias Jan 27, 2020
8211b52
also rename select in the tests
bernt-matthias Jan 27, 2020
45ed5de
add debug msgwq
bernt-matthias Jan 27, 2020
3aff090
try to use planemo with deactivated conda env
bernt-matthias Jan 28, 2020
5a1085b
try to switch to pip
bernt-matthias Jan 28, 2020
8646134
fix test data
bernt-matthias Jan 28, 2020
0cb3d32
fill_ctd: galaxyfy json reading
bernt-matthias Feb 4, 2020
369888b
remove codecov from travis test
bernt-matthias Feb 4, 2020
47cb609
remove unnecessary prints from test script
bernt-matthias Feb 4, 2020
68415c1
test generation fixes and more
bernt-matthias Feb 4, 2020
a9062f3
simplify code for cli mapping generation
bernt-matthias Feb 4, 2020
e500936
add nodes to tests
bernt-matthias Feb 10, 2020
eac138e
fixes fixes fixes
bernt-matthias Mar 2, 2020
9ec21d6
fix for outputs in sections
bernt-matthias Mar 2, 2020
573390e
adds ftype to all test outputs
bernt-matthias Mar 4, 2020
74b6e24
use CTDopts from env
bernt-matthias Mar 25, 2020
b4739e2
remove optional from bool params
bernt-matthias Apr 7, 2020
3fa1a9b
add optional output for generated ctd file
bernt-matthias Apr 9, 2020
02ebdb8
fix
bernt-matthias Apr 9, 2020
de43e45
improved handling of hardcoded parameters
bernt-matthias Apr 21, 2020
a27c28c
hardcoded parameters:
bernt-matthias Apr 25, 2020
0b44371
fix bug in fill_ctd
bernt-matthias Apr 25, 2020
6936529
add parameter to specify tool profile
bernt-matthias Apr 25, 2020
0c23edd
only overwrite type parameter if not set
bernt-matthias Apr 27, 2020
ba29677
fix creation of hardcoder json for multi level keys
bernt-matthias Apr 29, 2020
086688e
output prefix parameters etc.
bernt-matthias Aug 4, 2020
0b0e26a
remove input type parameters, optional output select
bernt-matthias Aug 4, 2020
8147bd7
fix output filters
bernt-matthias Aug 5, 2020
9123853
improvements to formats handling in tests
bernt-matthias Aug 6, 2020
c3c48ab
don't produce empty sections in Galaxy xml
bernt-matthias Sep 21, 2020
4f1af20
make optional outputs optional
bernt-matthias Oct 5, 2020
8112569
make optional outputs optional
bernt-matthias Oct 5, 2020
3f09e9d
Merge branch 'topic/cdata' of https://github.com/bernt-matthias/CTDCo…
bernt-matthias Oct 6, 2020
037b5a7
use correct variable
bernt-matthias Oct 9, 2020
406e91e
use full parameter name for hardcoder
bernt-matthias Oct 12, 2020
aa58872
add tool category to help text
bernt-matthias Dec 2, 2020
920c172
Merge branch 'topic/cdata' of https://github.com/bernt-matthias/CTDCo…
bernt-matthias Dec 2, 2020
958f574
Revert "add tool category to help text"
bernt-matthias Dec 3, 2020
192fe42
allow to specify wrapper version with bump file
bernt-matthias Dec 4, 2020
4912610
allow for inputs with the same identifier
bernt-matthias Feb 5, 2021
fa54b48
use latest CTDOpts for testing
bernt-matthias Feb 8, 2021
0446544
fix test case
bernt-matthias Feb 8, 2021
588b50f
update test data
bernt-matthias Feb 8, 2021
b7a40b7
few testing fixes
bernt-matthias Feb 8, 2021
b044b08
change format only for non defaults
bernt-matthias Feb 8, 2021
35e5c54
exclude some unsupported/nonsense test cases
bernt-matthias Feb 10, 2021
67d36e0
import os
bernt-matthias Feb 10, 2021
2ed0959
update docs
bernt-matthias Feb 10, 2021
966007f
flake8 fixes
bernt-matthias Feb 10, 2021
9247ce5
use continuous integers instead of dataset id
bernt-matthias Feb 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
language: python
python:
- "3.6"

install:
- sudo apt-get update
# - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needed?

# wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
# else
# wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
# fi
# - bash miniconda.sh -b -p $HOME/miniconda
# - export PATH="$HOME/miniconda/bin:$PATH"
# - hash -r
# - conda config --set always_yes yes --set changeps1 no --set auto_activate_base False
# - conda update -q conda
# - conda init
# - source activate
# - conda info -a
#
# # - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
# # - source activate test-environment
# - conda config --add channels conda-forge
# - conda config --add channels bioconda
# - conda config --add channels anaconda
# - conda config --add channels workflowconversion
#
# - conda install python=$TRAVIS_PYTHON_VERSION
# # TODO could be replaced by conda package once it is merged and released
# - git clone -b topic/no-1-2x https://github.com/bernt-matthias/CTDopts $HOME/CTDopts
# - cd $HOME/CTDopts
# - python setup.py install
# - conda install -c conda-forge lxml
# - conda install -c conda-forge ruamel.yaml
# - conda install libxml2
# - cd $TRAVIS_BUILD_DIR
# - python setup.py install
# - conda install coverage green codecov

# - virtualenv .venv
# - . .venv/bin/activate
- pip install git+https://github.com/bernt-matthias/CTDopts@topic/no-1-2x
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WorkflowConversion:master is up to date with all commits from bernt-matthias:topic/no-1-2x.

But the reverse is not true, and is the source of at least one of the failing tests

bernt-matthias/CTDopts@topic/no-1-2x...WorkflowConversion:master#diff-a55c430e446e6696bb3f110ad5ce8607e83273a276ce6aaef8816a285b014503R50

- pip install lxml ruamel.yaml planemo
- cd $TRAVIS_BUILD_DIR
- python setup.py install
script:
- python setup.py test
# TODO fail expected due to
# https://github.com/galaxyproject/galaxy/pull/9081 which will be in 20.01 and
# empty.xml (no inputs) could be removed and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still the case? The mentioned PR was merged last year

# - planemo l tests/test-data/

# planemo test content of tests/test-data (this is OK, because the previous
# tests ensure equality of the xmls that are generated and those in the package)
- export PATH=$(pwd)/tests/test-data:$PATH && planemo t tests/test-data/

# after_script:
# - python -m codecov
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,33 @@ CTDs can contain an `<executablePath>` element that will be used when executing
The following invocation of the converter will use `/opt/suite/bin` as a prefix when providing the executable path in the output files for any input CTD that lacks the `<executablePath>` section:

$ python convert.py [FORMAT] -x /opt/suite/bin ...


### Bump wrapper versions

There are two ways to bump tool versions.

- Definition of a `@GALAXY_VERSION@` token in the macros file. This can be used to bump all tools at once. Tool versions will be `@TOOL_VERSION@+galaxy@GALAXY_VERSION@`.
- Use the `--bump-file` parameter to specify the wrapper version of a subset of the tools in a json file that maps tool names/ids to a wrapper version. Tool version will be set to `@TOOL_VERSION@+galaxyX`, where `X` is the version found in the json file or `0` if not found.

In case of an update of the tool version, i.e. `@TOOL_VERSION@`, in the first case `@GALAXY_VERSION@` should be reset to 0 and the dictionary in the bump file should be emptied otherwise.

Rationale: the auto-generation of the tool xml files would overwrite the
wrapper version when regenerated. Hence it needs to be specified externally,
e.g. in the macros.xml or in the bump file.

### Tests

Tests for Galaxy tools are generated with:

```
PATH=$(pwd)/tests/test-data/:$PATH
for i in tests/test-data/*ctd
do
b=$(basename $i .ctd)
python convert.py galaxy -i tests/test-data/$b.ctd -o tests/test-data/$b.xml -m tests/test-data/macros.xml -f tests/test-data/filetypes.txt --test-test -p tests/test-data/hardcoded_params.json --tool-version 5.0.011
done
```


[CTDopts]: https://github.com/genericworkflownodes/CTDopts
[CTDSchema]: https://github.com/WorkflowConversion/CTDSchema
Expand Down
2 changes: 1 addition & 1 deletion common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ def __str__(self):
return self.msg

def __unicode__(self):
return self.msg
return self.msg
Loading