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

Union input types #10

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

Union input types #10

illusional opened this issue Feb 27, 2020 · 0 comments

Comments

@illusional
Copy link
Member

illusional commented Feb 27, 2020

Tools can often accept multiple input types, and that's something we want to reflect in Janis.

The simplest union types

It would be simple to add a Union(String, Int) operator into Janis and let the type system reflect this.

Localisation makes this harder

When you mix types that require localisation or secondary files. For example:

  • Union(String, File) is not easy to replicate in WDL:

    • if the input is a File, we want to localise the input, else we'll just pass the coerced string to this input.
  • Union(BamBai, CramCrai) is even harder to replicate in both.

    • If the input is an indexed bam, we'll index the main file and bam separately, the crai uses a different index.

Solution

It's not practical to generate a specification in CWL and WDL that can accurately reflect this case. Instead, we'll likely generate multiple versions of the workflow schema, depending on what the input(s) are. This way we won't necessarily clash if the same tool is used with different types of inputs.

Likely, the Union will have a default type for when you just translate it.

Backwards compatibility

This will add a new DataType called Union, the introduction of which should not affect current workflows. With internal changes relating to this, our biggest goal is to keep the current API as is, and changes would only be required for tools hoping to take advantage of this feature.

So we're anticipating that previous workflows will be compatible with no code changes.

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

No branches or pull requests

1 participant