No limit on number of inputs in plugin

Hi,
Can you have an unlimited number of inputs for a qiime2 plugin? i.e. not set an upper limit, and you can input n qzas to the plugin?
Thank you

2 Likes

Hey @haiderdiana, welcome to the forum!

Yes, you will want to use either List[SomeType] or Set[SomeType] (the former gives you a python list, whereas the latter is a python set).

4 Likes

Suppose my input is SampleData[AlphaDiversity] and I want the user to be able to input n SampleData[AlphaDiversity], when I register my function, I should write in the inputs
inputs = {
‘foo’: List[AlphaDiversity]} ? or
‘foo’: List[SampleData[AlphaDiversity]]?
}?

I suppose this is a new q2-type and I would need to write a transformer for it?

1 Like

Hey @haiderdiana,

You’ll want the second one: List[SampleData[AlphaDiversity]], and since List is a builtin, you don’t need a new transformer or anything. All of the entries will be transformed to your type-annotation and provided as a list of those things (whatever the annotation was).

2 Likes