Scatterplot NameError: name 'Predictions' is not defined

I’m trying to make a scatterplot of regress-samples-ncv predictions (same sequence of analyses as in this tutorial), which I am able to generate without any issues. However, when I run the following:

qiime sample-classifier scatterplot /
–i-predictions predictions.qza /
–m-truth-file sample-metadata.tsv /
–m-truth-column SAMPLE_TO_DISEASE_ONSET /
–o-visualization visualization_ncv_scatterplot.qzv

I get the following error. I’m a bit at a loss. Thanks in advance for any help.

Traceback (most recent call last):
File “/local/apps/metaseq/”, line 62, in parse_type
type_expr = eval(string, {‘builtins’: {}}, locals_)
File “”, line 1, in
NameError: name ‘Predictions’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/local/apps/metaseq/”, line 11, in
File “/local/apps/metaseq/”, line 722, in call
return self.main(*args, **kwargs)
File “/local/apps/metaseq/”, line 697, in main
rv = self.invoke(ctx)
File “/local/apps/metaseq/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/local/apps/metaseq/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/local/apps/metaseq/”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/local/apps/metaseq/”, line 535, in invoke
return callback(*args, **kwargs)
File “/local/apps/metaseq/”, line 244, in call
arguments, missing_in, verbose, quiet = self.handle_in_params(kwargs)
File “/local/apps/metaseq/”, line 326, in handle_in_params
kwargs, fallback=cmd_fallback)
File “/local/apps/metaseq/”, line 375, in get_value
artifact = qiime2.sdk.Result.load(path)
File “/local/apps/metaseq/”, line 65, in load
archiver = archive.Archiver.load(filepath)
File “/local/apps/metaseq/”, line 301, in load
return cls(path, Format(rec))
File “/local/apps/metaseq/”, line 29, in init
File “/local/apps/metaseq/”, line 72, in init
self.type = sdk.parse_type(type)
File “/local/apps/metaseq/”, line 82, in parse_type
" may be needed to define it." % name)
qiime2.sdk.util.UnknownTypeError: Name ‘Predictions’ is not a defined QIIME type, a plugin may be needed to define it.

Hi @tahooven,
In 2018.8 the Predictions type was separated into ClassifierPredictions and RegressorPredictions. So your error is caused by one of two things:

  1. predictions.qza was generated from an older version
  2. Something funky is going on with your installation.

If #1 is not the obvious issue, could you please report the output of:

  1. qiime tools peek predictions.qza
  2. qiime info


Ok, that answers it. I did the regression with 2018.6 because I needed to work around the force stratification bug in 2018.8.

I will either institute the fix suggested in that post or redo the regression with stratification (which is feasible for me) in 2018.8.

Thanks for your help.

Thanks for confirming! Glad it is an easy fix for you.

Version 2018.11 will be released soon, and the development version already contains the bug fix, so your other options are (a) wait a couple weeks, (b) try installing the dev version.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.