Hi there,
I am trying to develop a tool suite that acts standalone and is also integrated with QIIME2. My function takes as input, among other things, an ordination and a metadatafile. The ordination oddly enough, is passed through without error when using both the standalone and qiime2 versions. However, the metadata throws an error because it has not been transformed from QIIME2 type Metadata to pd.DataFrame, whereas the ordination has no problem transforming from PCoAResult to skbio.OrdinationResults.
In a _visualizer.py
file I have defined:
def hulls_plots(
output_dir: str,
ordination: skbio.OrdinationResults,
metadata: pd.DataFrame,
...)
In my plugin_setup.py
I have:
from qiime2.plugin import Metadata
from q2_types.ordination import PCoAResults
from ch.q2._visualizer import hulls_plots
plugin.visualizers.register_function(
function=hulls_plots,
inputs={
'ordination': PCoAResults,
},
parameters={
'metadata': Metadata,
...
For reference, I have been using gemelli as a roadmap on how to format my plugin. Any clarity on what might be going on under the hood and how to fix it would be greatly appreciated. For now, I have a hack-y fix that I'm not 100% satisfied with (checking type and transforming if need be)
THank you again!