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

Expressions in Janis #8

Open
illusional opened this issue Feb 27, 2020 · 0 comments
Open

Expressions in Janis #8

illusional opened this issue Feb 27, 2020 · 0 comments

Comments

@illusional
Copy link
Member

illusional commented Feb 27, 2020

The more complex workflows that we build, the more we've felt the feed for some mechanism to transform some value at runtime. in CWL, this could be a Javascript expression in a valueFrom box. In WDL this would be functions available within the Standard Library.

Essentially, we can define some "Operator" class, and override all the python operations to build up a tree of operations. When we translate to CWL / WDL, we can unwind these expressions, and operators will have a standard library or Javascript equivalent.

The ground work for it has been tested here: PMCC-BioinformaticsCore/janis-core#5, but I think it'll be worth pulling it out separately.

This is an addition to the language and should be backwards compatible.

For example:

wf.input("inp1", int, value=1)
wf.input("inp2, str, value="Hi")


wf.inp1 > 2  #  GreaterThanOperator(InputSelector("inp1") > 2)
to_upper_case(wf.inp2) == "HI" # EqualityOperator(UpperCaseOperator(InputSelector("inp2")), "HI")

Backwards compatibility

This might change the structure of some input bindings on CWL, depending on where the expressions are used, however no code changes should be required, as it's an introduction to the Janis API.

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 a pull request may close this issue.

1 participant