Specify when output if optional vs required

Is there a way to specify an output is optional when defining parameters for a plugin?

I am sure this is an easy one that I am missing in the Dev Documentation. :sweat_smile:

1 Like

Hey there @A_Bennett!

Turns out, its not such a straightforward problem to solve! We have it on our radar, but we don’t support it at the moment. Maybe we can chat more about your specific case to come up with a workaround? Let us know!


Hey @thermokarst,

I am expanding the functionality of RESCRPt to pull taxonomy without an associated FASTA. This is useful for data from databases like FunGene. Everything in the code is working as expected, except the plugin requires outfile.fa. My current code dumps an empty file. If it isn’t a straightforward problem, maybe I can make this its own function? I think the entry would be different, but it would ultimately utilize the existing code. Does that seem like a plausible workaround?

Hi @A_Bennett !

Yes one option would be to create a new action that only grabs taxonomies, not sequences. But this might also be redundant since it sounds like you would be using the existing get-ncbi-data action.

I recommend outputting an empty sequence file instead. While outputting an empty file seems illogical, it might be the easiest approach here, and there is precedence for this including in RESCRIPt.

For example, the get-silva-data action has an option of whether or not to download the sequences (or only taxonomy):

If False, the sequences simply are not downloaded, only the files necessary to assemble the taxonomy. This creates the issue you have now; QIIME 2 wants you to output something. So return an empty file. This is what get-silva-data does here:

Other precedence for this approach: some plugins have actions that filter out reads based on some criteria but also return those discarded reads as a separate artifact (e.g., q2-quality-control’s exclude-seqs method). If no reads are discarded, that artifact contains an empty fasta.

I recommend we move any more implementation-specific discussion to GitHub.