galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.37k stars 989 forks source link

Adding "select" as parameter type of input parameters #8159

Closed FredericBGA closed 3 years ago

FredericBGA commented 5 years ago

tested on usegalaxy.eu (19_05) and SnpEff build

We can use Simple inputs used for workflow logic as input parameter for Remove sequence version label as it's a Boolean.

We can't use Simple inputs used for workflow logic as input parameter for Parse Genbank into Fasta as it's a select (Yes / No)

Is it possible to do that in another way? Or do we have to wait for a new commit?

I understand that it can be tricky because the displayed values (ie: GenBank) are not necessary the values used in command line (ie: gb).

The main goal I use Simple inputs used for workflow logic is to find these parameters at the top of the page when a workflow is launched, and when the same tool is used several times in a workflow. It avoids users to set same parameters several times.

7496 is a similar issue.

mvdbeek commented 5 years ago

No, it's not possible at the moment, and as you mentioned it's not that straightforward, but we'll think about how to do this.

FredericBGA commented 5 years ago

@mvdbeek Thank you. Do you think (in a first move) that we can use text as Parameter type that would be able to connect with a select parameter? And let the person who build/use the workflow set a usable value that will fit the need of the tool.

mvdbeek commented 5 years ago

Just brainstorming here a little:

So the idea is that the you'd have a text field that is configured not at runtime but when the workflow is defined ? The downside here is that this would not be very flexible, and to turn this into a select field you'd have to list the valid options manually (and you somehow need to know what those valid values are).

I was thinking that maybe we could have a real workflow select style parameter that you can connect to select parameters. When you run the workflow you would only be presented with options that are the intersection of all connected and valid options (To avoid selecting invalid values). But the problem there is that whatever value you choose here might not have the same meaning (say you select "yes" as the value, whose meaning is "yes, do action x" in tool A and "yes, don't do action x" in tool B). If that's the case the workflow author could (re-)write the label of the workflow parameter so that it makes more sense, and maybe it's not such a common case that you'd select the same option value to multiple steps in a workflow where the steps are distinct tools.

This would be less of a concern for https://github.com/galaxyproject/galaxy/issues/7496 since the dbkey is a stronger convention.

mvdbeek commented 5 years ago

For the record I asked @jmchilton what he's thinking about this, and his response was

I don't know about the UI - but I feel like there should be a select option for workflow input parameters that matches tools. I'm not sure about inheriting the options - seems like a second step down the road after we got just a fully customizable one working

So perhaps a gxformat2 workflow could look like this:

class: GalaxyWorkflow
inputs:
  input_fastq:
    type: data
  input_param_select_genome:
    type: select
    options:
      - dm6:
         label: Drosophila melanogaster genome release 6
      - mm10
      - hg38
steps:
  alignment:
    tool_id: bwa
    tool_version: 1.0.0
    in:
      input:
        source: input_fastq
      genome:
        source: input_param_select_genome

I think that'd work nicely for selecting dbkeys and simple select parameters.

For more conditional logic one could use an expression tool to produce a derivative of the parameter, for instance setting genome size dependent on the genome parameter, or selecting a dbkey for common sequence contaminants for a given species.

FredericBGA commented 5 years ago

@mvdbeek I was talking of text field only if is was simpler to implement as a first move. And I would like to be able to configure it at runtime of course. And this could work for reference genome as well. Right now I can't use an input parameter for the reference genome (or any select choices ie: yes/no, Genkank/FASTa/EMBL etc.).

In a workflow with Blast, Bedtools etc... Blast and Bedtools can use the same reference genome. Blast for the alignment, Bedtools to grab the sequence. It's nice to be able to set this parameter only once. And I can have several Blast launched in a single workflow (on several databases that never change : Rice, Arabido, Maize) but I want to change output (Tabular / HTML / XML). In the current situation I have to change the parameter three times. If I could use a text parameter instead, of course like you said I will have to list the valid options manually (please enter 5 for Blast XML, 2 for HTML, please use a valid database like ZMA_B73_REF_V4 etc.) but it's better than nothing.

But the problem there is that whatever value you choose here might not have the same meaning (say you select "yes" as the value, whose meaning is "yes, do action x" in tool A and "yes, don't do action x" in tool B).

I not sure that I understand. I was not talking about that, using same input parameter for different tools!

I was thinking that maybe we could have a real workflow select style parameter that you can connect to select parameters.

Perfect!

mvdbeek commented 3 years ago

Got these since 20.01: https://github.com/galaxyproject/galaxy/pull/9086

innovate-invent commented 3 years ago

How are you able to specify name-value select boxes? Currently it appears the only option is value-value