Error from feature-classifier fit classifier-naive-bayes

Hi, I have trouble to get a classifier from my own dataset. What I did so far:
#Classifier trained with own dataset, using Silva_128_release.tgz

reference: SILVA_128_QIIME_release/rep_set/rep_set_16S_only/99/99_otus_16S.fasta
Taxonomy: SILVA_128_QIIME_release/taxonomy/16S_only/99/majority_taxonomy_all_levels.txt

IMPORT
qiime tools import
–type ‘FeatureData[Sequence]’
–input-path training-feature-classifiers/99_otus_16S.fasta
–output-path training-feature-classifiers/Silva128_16S_99_otus.qza

qiime tools import
–type ‘FeatureData[Taxonomy]’
–input-path training-feature-classifiers/majority_taxonomy_all_levels.tsv
–source-format HeaderlessTSVTaxonomyFormat
–output-path training-feature-classifiers/Silva128_16S_majority_taxonomy.qza

EXTRACT VARIABLE REGION
qiime feature-classifier extract-reads
–i-sequences training-feature-classifiers/Silva128_16S_99_otus.qza
–p-f-primer CCTACGGGNGGCWGCAG
–p-r-primer GACTACHVGGGTATCTAATCC
–p-trunc-len 248
–o-reads training-feature-classifiers/ref_seqs_Silva128_16S_99_otus.qza

TRAIN CLASSIFIER
qiime feature-classifier fit-classifier-naive-bayes
–i-reference-reads training-feature-classifiers/ref_seqs_Silva128_16S_99_otus.qza
–i-reference-taxonomy training-feature-classifiers/Silva128_16S_majority_taxonomy.qza
–o-classifier training-feature-classifiers/Silva128_16S_99_otus_majority_classifier.qza

Then I get a Plugin error from feature-classifier
Debug info:
/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/q2_feature_classifier/classifier.py:101: UserWarning: The TaxonomicClassifier artifact that results from this method was trained using scikit-learn version 0.19.1. It cannot be used with other versions of scikit-learn. (While the classifier may complete successfully, the results will be unreliable.)
warnings.warn(warning, UserWarning)
Traceback (most recent call last):
File “/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/q2cli/commands.py”, line 246, in call
results = action(**arguments)
File “”, line 2, in fit_classifier_naive_bayes
File “/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 228, in bound_callable
output_types, provenance)
File “/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 363, in callable_executor
output_views = self._callable(**view_args)
File “/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/q2_feature_classifier/classifier.py”, line 310, in generic_fitter
pipeline)
File “/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/q2_feature_classifier/_skl.py”, line 32, in fit_pipeline
pipeline.fit(X, y)
File “/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/sklearn/pipeline.py”, line 250, in fit
self._final_estimator.fit(Xt, y, **fit_params)
File “/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/q2_feature_classifier/custom.py”, line 41, in fit
classes=classes)
File “/home/qiime2/miniconda/envs/qiime2-2018.2/lib/python3.5/site-packages/sklearn/naive_bayes.py”, line 522, in partial_fit
dtype=np.float64)
MemoryError

qiime feature-classifier fit-classifier-naive-bayes --i-reference-reads silva132-ref-seqs.qza --i-reference-taxonomy silva132-ref-taxonomy.qza --o-classifier silva132-classifier.qza

After increasing the memory of the VM (35GB) I ran the command like above and got the following error. What is happening? Any comments and solutions are very welcomed!!!

Traceback (most recent call last):
File “/home/qiime2/miniconda/envs/qiime2-2018.4/bin/qiime”, line 11, in
sys.exit(qiime())
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/q2cli/commands.py”, line 294, in call
path = result.save(output)
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/qiime2/sdk/result.py”, line 147, in save
self._archiver.save(filepath)
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/qiime2/core/archive/archiver.py”, line 347, in save
self.CURRENT_ARCHIVE.save(self.path, filepath)
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/site-packages/qiime2/core/archive/archiver.py”, line 162, in save
allowZip64=True) as zf:
File “/home/qiime2/miniconda/envs/qiime2-2018.4/lib/python3.5/zipfile.py”, line 1009, in init
self.fp = io.open(file, filemode)
PermissionError: [Errno 1] Operation not permitted: ‘silva132-classifier.qza’

Hi @Kerstin,

:+1:

The good news is your command worked! The bad news is your filesystem isn’t allowing you to create that file.

I’m not sure why that would be, is the directory you are running the command in writable by your user account?

You will likely see a similar error if you were to run:

touch example-file.txt

If you don’t see an error with that, then something stranger is happening.

Thanks for youre response. So I typed in the command you wrote, touch example-file.txt. I don t get any error message. It only creates an empty file named example-file.txt. I really don t understand what is happening?

Hi @Kerstin,

That’s very strange. You were definitely in the same directory?

Is it possible you do not have enough disk space? I think that’s supposed to give a different error, but I could be wrong.

Does this file already exist: silva132-classifier.qza? What are it’s permissions (if it does exist):

ls -l silva132-classifier.qza

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