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

Conversation

bernt-matthias
Copy link
Collaborator

This is the result of my work for the auto generation of the Galaxy OpenMS wrappers.

superseeds #50 and #46

@bernt-matthias
Copy link
Collaborator Author

ping @Tomnl @bgruening

@bgruening
Copy link
Contributor

@bernt-matthias can you run this and create a PR against galaxyp/openms ...?

Thanks a lot, this is awesome!

@bernt-matthias
Copy link
Collaborator Author

This is comming soon. Still fighting with a few failing tests (yeah we have tests :) ).

this will also soon be ready galaxyproject/galaxy#8109 .. maybe we should check if we can have this in 20.01

@bgruening
Copy link
Contributor

Jupp, I think retargeting to 20.01 could work. That's a cool present! Thanks so much.

@Tomnl
Copy link
Contributor

Tomnl commented Jan 9, 2020

This is great! Thanks @bernt-matthias !

ping @RJMW

@RJMW
Copy link

RJMW commented Jan 9, 2020

Wow! - Thanks for the all the efforts @bernt-matthias

Tomnl and others added 22 commits January 27, 2020 19:40
- removed test file from OpenMS
- fixed xsd link
- extended select, i/o file test data
OpenMS (ctd 1.6.2) uses string with restriction true/false for booleans
- those with default false are flags, ie `-param`
- otherwise `-param false` needs to be given

for simplification the neccessary command line is now stored directly in
the true/falsevalue attributes

also added more docs
selects:
- add possibility of selects with multiple=true from ITEMLIST
- just add single quotes around all option values

optional:
- optional was only set for params with restrictions
  now its always set (one might remove it for bools...)

also add more documentation
dont set it via the param's value attribute, but the selected attribute
of the options (the latter was already the case)
- add quotes for multiple,optional file inputs
- remove the (now deprecated) size attribute of text fields
- moved parameter to argument attribute
- allow for empty defaults in int/float inputs
also restored quoting in ifile and repeats
Previously itemlists wo restrictions were rendered as repeats. Problem
is that repeats do not allow to enter default values. Also a select is
no option since the user can't add values

So I suggest to use a text field allowing for comma separated list of
strings, integers, or floats. The correctness of the input is verified
by by validators and sanitizers.

I'm optimistic that listitems do not contain ',' (which would be a
problem), since restrictions of restricted itemslists are given as comma
separated list.
also added itemlists with default to ctd
@mr-c
Copy link
Collaborator

mr-c commented Feb 8, 2021

Hello @bernt-matthias !

I'm working on the CWL export, and I see that you've made a lot of fixes that I have, or that I need. Do you anticipate being able to merge soon?

Or shall we peel off some of these fixes into other "bite-sized" PRs and merge them individually?

@bernt-matthias
Copy link
Collaborator Author

Hi @mr-c .. good point. I would be happy about comments and to get this merged.

I would say that this is functional. We used this branch for the release of OpenMS Galaxy tools for version 2.5 and 2.6.

But:

  • update of the docs would be nice. in particular parameter hardcoding etc.
  • I guess also the failing tests should be considered

.travis.yml Outdated

# - 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

.travis.yml Outdated
Comment on lines 48 to 50
# 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

and enable planemo lint
@mr-c
Copy link
Collaborator

mr-c commented Feb 8, 2021

FAIL: test_galaxy_cli_bool_ctd (tests.test_galaxy_cli.GalaxyCliTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/WorkflowConversion/CTDConverter/tests/test_galaxy_cli.py", line 51, in test_galaxy_cli_bool_ctd
    self._compare_cli_output('bool')
  File "/home/travis/build/WorkflowConversion/CTDConverter/tests/test_galaxy_cli.py", line 48, in _compare_cli_output
    self.assertEqual(new_l[i].rstrip(), old_l[i].rstrip())
AssertionError: '#import os.path' != ''
- #import os.path
+ 

@mr-c
Copy link
Collaborator

mr-c commented Feb 9, 2021

PyTests pass!

Looks like some of the planemo-run tests fail. Shall we skip them and merge?

ofile-mult (Test #1): failed
ofile-mult-typeparam (Test #1): failed

@bernt-matthias
Copy link
Collaborator Author

I will fix this this afternoon / tomorrow .. just need to remove a few test cases which are unreasonable (I think).

if the format of an output is determined by a select
then set the select-default as format of the output
and add `<change_format><when>` only for the other choices
@mr-c
Copy link
Collaborator

mr-c commented Feb 10, 2021

so close, back to the error seen in #54 (comment)

@bernt-matthias
Copy link
Collaborator Author

Just discussing with OpenMS developers that a change analogous to 4912610 might also be necessary for outputs :(

@bernt-matthias
Copy link
Collaborator Author

Wait, this is already happening :) .. But I was thinking about to change this slightly.

Now for list input / outputs we create a folder PARAMETER_NAME/GALAXY_UNIQUE_DATASET_ID/ and place the symlink with the name label.ext in there.

I'm thinking about using an integers 0,1,2... instead of GALAXY_UNIQUE_DATASET_ID would be a bit nicer.

And should be easy to implement.

@bernt-matthias
Copy link
Collaborator Author

Hah. Tests are passing. Give me a bit for the last step...

@bernt-matthias
Copy link
Collaborator Author

OK. If tests here and there galaxyproteomics/tools-galaxyp#555 are passing its ready.

@bernt-matthias
Copy link
Collaborator Author

Looks good now. Last failing OpenMS tool is fixed. You may merge if you like.

For another automatic tool generation project (https://github.com/hexylena/argparse2tool/) I would like to reuse the ParameterHardcoder, i.e.

class ParameterHardcoder:

and

def parse_hardcoded_parameters(hardcoded_parameters_file):

Do you think its worth to factor this out into a separate project or should I just import CTDconverter?

Btw. argparse2tool can also generate CWL tools.

@mr-c
Copy link
Collaborator

mr-c commented Feb 10, 2021

Looks good now. Last failing OpenMS tool is fixed. You may merge if you like.

Huzzah! I don't have write access to this repository yet, otherwise I would merge it :-)

Do you think its worth to factor this out into a separate project or should I just import CTDconverter?

This isn't a javascript project, so I'd say that isn't enough for a separate package :-P

@jpfeuffer jpfeuffer merged commit 84c5867 into WorkflowConversion:master Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants