Hello, all!
I am developing a plugin that (among other things) I would like to be able to take two or more SampleData
Artifacts and merge them together (basically a SQL join). However, I am unsure how to specify in the plugin setup that any Artifact of base SampleData
should be a valid input (or if this is even supported in the underlying Q2 plugin architecture).
For example, SampleData[AlphaDiversity]
& SampleData[LogRatios]
should be a valid pair of inputs as well as SampleData[Sequences]
& SampleData[SongbirdStats]
.
My current function looks like this:
plugin.methods.register_function(
function=aggregate_sample_data,
inputs={"foo": List[SampleData]},
input_descriptions={"foo": "a"},
outputs=[("aggregated_sample_data", SampleData[AggregatedSampleData])],
output_descriptions={"aggregated_sample_data": "b"},
description="c",
name="Aggregate Sample Data",
)
This results in the following error:
Traceback (most recent call last):
File "qiimecraft/plugin_setup.py", line 71, in <module>
inputs={"sample_data": List[SampleData]},
File "/miniconda3/envs/qiimecraft/lib/python3.6/site-packages/qiime2/core/type/grammar.py", line 171, in __getitem__
% (field,))
TypeError: Field SampleData[{type}] is not complete type expression.
Is what I’m trying to do possible in the Qiime2 architecture? I know that qiime metadata tabulate
can kind of accomplish this but there are a couple issues with that approach:
- My understanding is that this will filter the constituent inputs to their inner join - I’d like essentially an outer join where every sample is represented even if it is absent in other inputs.
- I would like the output of this function to be of type
SampleData
rather than a visualization.
Thanks!