feature-classifier classify-sklearn ERROR

Hi,

I am keep getting the error at this step while running for fungal ITS taxonomy assignment for representative sequences, could you please advise why this is happening. I am not getting any error with 16s data. could you please share the tutorial for fungal ITS data. I am following this:Q2-ITSxpress: A tutorial on a QIIME 2 plugin to trim ITS sequences

Currently I am using Qiime2:2019.04

]$ qiime feature-classifier classify-sklearn --i-classifier classifier.qza --i-reads rep-seqs.qza --o-classification taxonomy.qza
Plugin error from feature-classifier:

** pop from empty list**

Debug info has been saved to /tmp/qiime2-q2cli-err-_nf2280e.log
$ vi /tmp/qiime2-q2cli-err-_nf2280e.log

Traceback (most recent call last):
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/q2cli/commands.py", line 311, in __call__
    results = action(**arguments)
  File "</opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/decorator.py:decorator-gen-353>", line 2, in classify_sklearn
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
    output_types, provenance)
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/qiime2/sdk/action.py", line 365, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/q2_feature_classifier/classifier.py", line 214, in classify_sklearn
    reads, classifier, read_orientation=read_orientation)
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/q2_feature_classifier/classifier.py", line 169, in _autodetect_orientation
    result = list(zip(*predict(first_n_reads, classifier, confidence=0.)))
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/q2_feature_classifier/_skl.py", line 45, in predict
    for chunk in _chunks(reads, chunk_size)) for m in c)
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 917, in __call__
    if self.dispatch_one_batch(iterator):
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 759, in dispatch_one_batch
    self._dispatch(tasks)
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 716, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/sklearn/externals/joblib/_parallel_backends.py", line 182, in apply_async
    result = ImmediateResult(func)
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/sklearn/externals/joblib/_parallel_backends.py", line 549, in __init__
    self.results = batch()
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 225, in __call__
    for func, args, kwargs in self.items]
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 225, in <listcomp>
    for func, args, kwargs in self.items]
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/q2_feature_classifier/_skl.py", line 52, in _predict_chunk
    return _predict_chunk_with_conf(pipeline, separator, confidence, chunk)
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/q2_feature_classifier/_skl.py", line 79, in _predict_chunk_with_conf
    classes = [cls for cls in classes if cls[0].pop(0) == level]
  File "/opt/gridware/depots/54e7fb3c/el7/pkg/apps/qiime2/2019.4.0/bin/lib/python3.6/site-packages/q2_feature_classifier/_skl.py", line 79, in <listcomp>
    classes = [cls for cls in classes if cls[0].pop(0) == level]
IndexError: pop from empty list
1 Like

Hi @Yogesh_Gupta,
Have you tried searching the forum archives for past examples of this error? This error has been discussed a couple times

It sounds like there is something wrong with the taxonomy file that you are using, e.g., see here:

Good luck!

Hi @Nicholas_Bokulich,

Thanks for your quick response, I am struggling at this step for both Fungal and custom arsenic database.

Arsenic taxonomy file I have downloaded from NCBI, it looks like this, could you please advise what is the problem in it and how I can get rid of it:

AAAK03000116.1  Bacteria; Firmicutes; Bacilli; Lactobacillales; Enterococcaceae; Enterococcus   Enterococcus faecium DO
AAAL02000001.1  Bacteria; Proteobacteria; Gammaproteobacteria; Xanthomonadales; Xanthomonadaceae; Xylella       Xylella fastidiosa Dixon
AACD01000079.1  Eukaryota; Fungi; Dikarya; Ascomycota; Pezizomycotina; Eurotiomycetes; Eurotiomycetidae; Eurotiales; Aspergillaceae; Aspergillus        Aspergillus nidulans FGSC A4
AACS02000002.1  Eukaryota; Fungi; Dikarya; Basidiomycota; Agaricomycotina; Agaricomycetes; Agaricomycetidae; Agaricales; Psathyrellaceae; Coprinopsis   Coprinopsis cinerea okayama7#130
AADV02000002.1  Bacteria; Cyanobacteria; Oscillatoriophycideae; Chroococcales; Aphanothecaceae; Crocosphaera    Crocosphaera watsonii WH 8501
AADV02000014.1  Bacteria; Cyanobacteria; Oscillatoriophycideae; Chroococcales; Aphanothecaceae; Crocosphaera    Crocosphaera watsonii WH 8501
AADV02000142.1  Bacteria; Cyanobacteria; Oscillatoriophycideae; Chroococcales; Aphanothecaceae; Crocosphaera    Crocosphaera watsonii WH 8501
AADV02000157.1  Bacteria; Cyanobacteria; Oscillatoriophycideae; Chroococcales; Aphanothecaceae; Crocosphaera    Crocosphaera watsonii WH 8501
AADV02000160.1  Bacteria; Cyanobacteria; Oscillatoriophycideae; Chroococcales; Aphanothecaceae; Crocosphaera    Crocosphaera watsonii WH 8501
AADV02000163.1  Bacteria; Cyanobacteria; Oscillatoriophycideae; Chroococcales; Aphanothecaceae; Crocosphaera    Crocosphaera watsonii WH 8501
AAEK01000011.1  Bacteria; Firmicutes; Bacilli; Bacillales; Bacillaceae; Bacillus; Bacillus cereus group Bacillus cereus G9241
AAEK01000037.1  Bacteria; Firmicutes; Bacilli; Bacillales; Bacillaceae; Bacillus; Bacillus cereus group Bacillus cereus G9241
AAEW02000007.1  Bacteria; Proteobacteria; Deltaproteobacteria; Desulfuromonadales; Desulfuromonadaceae; Desulfuromonas  Desulfuromonas acetoxidans DSM 684
AAEW02000015.1  Bacteria; Proteobacteria; Deltaproteobacteria; Desulfuromonadales; Desulfuromonadaceae; Desulfuromonas  Desulfuromonas acetoxidans DSM 684

HI @Yogesh_Gupta,
See the topic I linked to above, it describes the issue you are having with your custom database.

Hi @Nicholas_Bokulich,

Thanks, yes I can see there is some problem in my taxonomy file, for some gene, it is not complete and at some places semicolon is also missing. I am trying to fix it.

Thanks for your help and time.

Regards
Yogesh

These are problems that will need to be fixed, but the more specific problem with your taxonomy file that is causing this particular issue is that the different taxa have uneven numbers of ranks. E.g., the bacteria have 6 semicolon-delimited ranks, but the fungi have 10.

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