qiita-spots / qiita

Qiita - A multi-omics databasing effort
http://qiita.microbio.me
BSD 3-Clause "New" or "Revised" License
120 stars 80 forks source link

After recent Qiita update, "Principal Coordinate Analysis Biplot [pcoa_biplot] (qiime2 2022.11.1)" now fails #3266

Closed ElDeveloper closed 1 year ago

ElDeveloper commented 1 year ago

Error executing Principal Coordinate Analysis Biplot [pcoa_biplot]: ['Traceback (most recent call last):\n', ' File "/home/qiita/miniconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/qiita_client/plugin.py", line 265, in call\n success, artifacts_info, error_msg = task(\n', ' File "/home/qiita/miniconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/qiita_client/plugin.py", line 105, in call\n return self.function(qclient, server_url, job_id, output_dir)\n', ' File "/home/qiita/qiita_spots/qp-qiime2/qp_qiime2/qp_qiime2.py", line 536, in call_qiime2\n atype = Q2_QIITA_SEMANTIC_TYPE[str(q2artifact.type)]\n', 'KeyError: "PCoAResults % Properties('biplot')"\n']

Using 'Unweighted Unifrac PCoA results', and a collapsed, rarefied, 'relative frequency table'


Reported by @ekunselman https://github.com/biocore/emperor/issues/814

antgonza commented 1 year ago

Looking much closer to this issue, the problem is how the output is defined in that method (pcoa_biplot) and I'm not sure what is the best way forward. Specifically,

In [9]: pm.plugins['diversity'].methods['pcoa'].signature.outputs['pcoa']
Out[9]: ParameterSpec(qiime_type=PCoAResults, view_type=<class 'skbio.stats.ordination._ordination_results.OrdinationResults'>, default=NOVALUE, description='The resulting PCoA matrix.')

In [10]: pm.plugins['diversity'].methods['pcoa_biplot'].signature.outputs['biplot']
Out[10]: ParameterSpec(qiime_type=PCoAResults % Properties('biplot'), view_type=<class 'skbio.stats.ordination._ordination_results.OrdinationResults'>, default=NOVALUE, description='The resulting PCoA matrix.')

as you can see the issue is the Properties value, which AFAIK is the only parameter in the default plugins to have that property. Is there a reason to be this way?

Anyway, we can hardcode something but just wondering if having a Property is actually required; @ElDeveloper what do you think?

antgonza commented 1 year ago

A full fix for this would be to support the Properties definition in the qp-qiime2 plugin; however, at this point I'm not sure this is necessary as there is only one method/output that uses that. Thus, decided to go with the simplest solution via https://github.com/qiita-spots/qp-qiime2/pull/78.

ElDeveloper commented 1 year ago

For completeness, you are right that q2-diversity only uses this as syntactic sugar. However q2-emperor uses this to determine whether it should display a biplot or a standard plot. And q2-emperor.plot will throw an error if there are "arrows" in the ordination, unless ignore-pcoa-features is set to True.

antgonza commented 1 year ago

Do you think this is related to https://github.com/qiita-spots/qiita/issues/3255 ?

ElDeveloper commented 1 year ago

Might be? I am actually confused as to how that biplot was loaded in the system in the first place. Considering the Properties exception reported in this issue.