I was using Vsearch classifier. I faced with this error:
Plugin error from feature-classifier:
** 'Identifier 173 was reported in taxonomic search results, but was not present in the reference taxonomy.'**
with Verbose:
ata/dna-sequences.fasta 100%
3603404 nt in 8135 seqs, min 390, max 471, avg 443
Masking 100%
Counting k-mers 100%
Creating k-mer index 100%
Searching 100%
Matching query sequences: 992 of 2222 (44.64%)
Traceback (most recent call last):
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4381, in get_value
return libindex.get_value_box(s, key)
File "pandas/_libs/index.pyx", line 52, in pandas._libs.index.get_value_box
File "pandas/_libs/index.pyx", line 48, in pandas._libs.index.get_value_at
File "pandas/_libs/util.pxd", line 113, in pandas._libs.util.get_value_at
File "pandas/_libs/util.pxd", line 98, in pandas._libs.util.validate_indexer
TypeError: 'str' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/_consensus_assignment.py", line 104, in import_blast_format_assignments
t = ref_taxa[id]
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/pandas/core/series.py", line 868, in getitem
result = self.index.get_value(self, key)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4389, in get_value
raise e1
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4375, in get_value
tz=getattr(series.dtype, 'tz', None))
File "pandas/_libs/index.pyx", line 81, in pandas._libs.index.IndexEngine.get_value
File "pandas/_libs/index.pyx", line 89, in pandas._libs.index.IndexEngine.get_value
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: '173'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/commands.py", line 311, in call
results = action(**arguments)
File "</home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/decorator.py:decorator-gen-355>", line 2, in classify_consensus_vsearch
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
output_types, provenance)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py", line 365, in callable_executor
output_views = self._callable(**view_args)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/_vsearch.py", line 37, in classify_consensus_vsearch
unassignable_label=unassignable_label)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/_consensus_assignment.py", line 29, in _consensus_assignments
output.name, ref_taxa, unassignable_label=unassignable_label)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/_consensus_assignment.py", line 109, in import_blast_format_assignments
'taxonomy.').format(str(id)))
KeyError: 'Identifier 173 was reported in taxonomic search results, but was not present in the reference taxonomy.'
--i-query RepresenDenoisedmcrSeasalt1.2.qza
--i-reference-reads RefSequencesmcrA.qza
--i-reference-taxonomy Reftaxonomy.qza
--p-strand 'plus'
--p-unassignable-label Unassigned
--o-classification VsearchtaxonomyformcrA.qza
--verbose
Running external command line application. This may print messages to stdout and/or stderr.
The command being run is below. This command cannot be manually re-run as it will depend on temporary files that no longer exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/_consensus_assignment.py", line 104, in import_blast_format_assignments
t = ref_taxa[id]
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/pandas/core/series.py", line 868, in getitem
result = self.index.get_value(self, key)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4389, in get_value
raise e1
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4375, in get_value
tz=getattr(series.dtype, 'tz', None))
File "pandas/_libs/index.pyx", line 81, in pandas._libs.index.IndexEngine.get_value
File "pandas/_libs/index.pyx", line 89, in pandas._libs.index.IndexEngine.get_value
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: '173'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/commands.py", line 311, in call
results = action(**arguments)
File "</home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/decorator.py:decorator-gen-355>", line 2, in classify_consensus_vsearch
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
output_types, provenance)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py", line 365, in callable_executor
output_views = self._callable(**view_args)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/_vsearch.py", line 37, in classify_consensus_vsearch
unassignable_label=unassignable_label)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/_consensus_assignment.py", line 29, in _consensus_assignments
output.name, ref_taxa, unassignable_label=unassignable_label)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/_consensus_assignment.py", line 109, in import_blast_format_assignments
'taxonomy.').format(str(id)))
KeyError: 'Identifier 173 was reported in taxonomic search results, but was not present in the reference taxonomy.'
Plugin error from feature-classifier:
'Identifier 173 was reported in taxonomic search results, but was not present in the reference taxonomy.'
I used another classifier. different error recieved:
qiime feature-classifier fit-classifier-sklearn \
--i-reference-reads RefSequencesformcrA.qza
--i-reference-taxonomy Reftaxonomy.qza
--p-classifier-specification text
--o-classifier classifier.qza
--verbose
/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/classifier.py:101: UserWarning: The TaxonomicClassifier artifact that results from this method was trained using scikit-learn version 0.20.2. 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/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/commands.py", line 311, in call
results = action(**arguments)
File "</home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/decorator.py:decorator-gen-345>", line 2, in fit_classifier_sklearn
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
output_types, provenance)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py", line 365, in callable_executor
output_views = self._callable(**view_args)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_feature_classifier/classifier.py", line 130, in fit_classifier_sklearn
spec = json.loads(classifier_specification)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This visualizer produces an interactive barplot visualization of
taxonomies. Interactive features include multi-level sorting, plot
recoloring, sample relabeling, and SVG figure export.
Inputs:
--i-table ARTIFACT FeatureTable[Frequency]
Feature table to visualize at various taxonomic
levels. [required]
--i-taxonomy ARTIFACT FeatureData[Taxonomy]
Taxonomic annotations for features in the provided
feature table. All features in the feature table must
have a corresponding taxonomic annotation. Taxonomic
annotations that are not present in the feature table
will be ignored. [required]
Parameters:
--m-metadata-file METADATA...
(multiple The sample metadata.
arguments will be
merged) [required]
Outputs:
--o-visualization VISUALIZATION
[required]
Miscellaneous:
--output-dir PATH Output unspecified results to a directory
--verbose / --quiet Display verbose output to stdout and/or stderr
during execution of this action. Or silence output if
execution is successful (silence is golden).
--citations Show citations and exit.
--help Show this message and exit.
There was a problem with the command:
(1/1) Invalid value for "--i-taxonomy": Expected an artifact of at least type
FeatureData[Taxonomy]. An artifact of type TaxonomicClassifier was provided.
You provided the wrong input file (check out this post from @Mehrdad, the same issue, just with the inverse artifacts). You need to provide the FeatureData[Taxonomy] artifact created by one of the training methods in q2-feature-classifier.
That's the key line. Your reference and taxonomy files do not appear to match. There must be several issues with these files, judging from the errors you are reporting with the sklearn-based classifier. I recommend hand-checking those files, ensure that all IDs match, and use qiime tools validate on the imported artifacts to make sure the formats are valid.
Sure the main items are different!(my seq platform is HiSeq Illumina, software package is Qiime2 and the functional gene is mcrA), but I was able to import the database into .qza format which is acceptable to Qiime2. Right? If their content and layout of the two files are the case, firstly is there a way to modify the files compatible with Qiime2? Or how to fix it? Secondly, I never use Muthor. I am analyzing a functional gene, mcrA. To do that, I need a special database like SILVA or Greenegens that's why I mentioned this paper because it possesses the database.
Thanks for help Colin.
Now that I know you are using the mcrA gene, I understand why you need a different database in order to assign taxonomy. (SILVA and greengenes will not work.)
It sounds like you have tried both the sci-kit learn classifier, and the vsearch LCA one. For these to work, you have all the input files in the right formats.
My only advice here is to keep trying your options like you doing now (good job! ) and solve each error as you discover it. This process takes time, but I know you can do it and we are here to help.
I'm not 100% sure what the problem is at this point, the two files you've provided seem reasonable with respect to their semantic types. Although I did notice that your taxonomic file was more or less exclusively Archaea (which may be your goal, I'm not sure).
As you see, it gives too low taxa. I am sure the output could not be straightforward. I ran the Blast+ classifier. Other classifiers faild except Blast+. Also, you are right! This database is exclusively related to a type of Archea called methanogens. Anyhow, I got stuck this stage.
I sent too messages about this problem, so I do not want to waste the forum's time. Is it possible to send you message in private? @ebolyen
I'm glad you got the BLAST+ taxonomy working. This graph looks good to me.
As you see, it gives too low taxa.
I don't think these classifications are too low, I think they are appropriately low. Getting species level taxonomy is hard, especially if you are using a non-16S marker gene with a smaller reference database.
You can still make PCoA plots and alpha diversity plots without taxonomy at all. Imperfect taxonomy is no reason to stop the paper.
Colin
P.S. Most conversations on the forums are fully public. This way more people can help out.