Wrapper: output file depending on input field, how to "make the link"

Welcome @FTouzain

Hopefully we can help! Let’s break it down and then you can explain if I am misunderstanding something or can help more. :slight_smile:

For this part

The additional input can be an optional input.

This optional input could be 1) never required, or 2) only required when another choice is made, or 3) the wrapper automatically interprets the presence/absence of that optional input and does something different depending on the state at runtime. We have examples of all of these, so please ask if you cannot find an example existing wrapper and we can help to find it!

The first item I noticed is the 1/2 notation for the boolean here.

    <conditional name="option_snp_vcf_summary">
      <param type="select" name="boolean" label="tells if vcf summary output file is created" help="tells if vcf summary output file is created">
        <option value="1">no summary vcf output</option>
	  	    <option value="2">additional vcf summary output</option>

For any (most?) “boolean” value, you’ll need to use TRUE/FALSE instead. Some examples are in the IUC’s tool wrappers here.

Are you using Planemo for your development project yet? If not, I would start there, then see what it reports. The framework will help with all steps to get your wrapper published later on, too.

This section about conditional parameters seems relevant but you can double check me by searching the full docs with your keyword “bool”.

This is likely what you’ll want to do, too!

        <conditional name="algorithm">
            <param name="set_algorithm_params" type="boolean" label="Set Algorithm Parameters">
            </param>
            <when value="true">
                <param argument="-k" label="minimum seed length" type="integer" value="19" />
            </when>
            <when value="false">
            </when>
        </conditional>

Then, for the output renaming, I’m not sure I understand this well yet. Could you explain more about this part?

You can give the output a consistent name in your <outputs> section. Setting up the filter to use your TRUE/FALSE in the filter instead of the “2”. If you are not sure about all the options, this is a good place to start:

I can think of one tool.xml that has optional inputs, and then optional outputs depending on the presence/absence of those optional inputs, that I think should cover what you are trying to do. Or, it may at least help us to clarify! Would you like to review? The macros have many conditional clauses that might be what you want to use too (instead of a boolean at all)!


Please review and we can follow up more. Or if you get this to work, please let us know! :slight_smile: