Issue viewing artifact as qiime2 metadata

Hi,
I have been having some issues with converting the taxonomy.qza artifact into a qiime2 visualizer after taxonomy has been assigned using the following command:

There was an issue with viewing the artifact taxonomy.qza as QIIME 2 Metadata:

qiime metadata tabulate --m-input-file taxonomy.qza --o-visualization taxonomy.qzv

An error message comes up which is pasted below:
CategoricalMetadataColumn does not support values with leading or trailing whitespace characters. Column ‘Taxon’ has the following value: 'D_0__Bacteria;D_1__Bacteroidetes;D_2__Ignavibacteria;D_3__OPB56;D_4__uncultured bacterium ’

I think the issues is whitespace in the taxonomy.qza. How should this be rectified?

Many thanks

Mark

Hi @mcunningham48,

I agree, I think you do have a white space in your taxonomy. Im wondering how you got there, though. Could you describe how you got to the taxonomy artefact?

Best,
Justine

hi @jwdebelius i am getting the same error. if you could help me on this… ??

Hi @hafizmtalha,

If you’re getting the same error, the same solution should work: you need to remove the white spaces. I dont have additional context to know where they’re coming in, so its hard to diagnos further.

Best,
Justine

Hi, I am having the same problem following training a new classifier for 16S V3V4 using the Silva database.
The full code to create and train the classifier is below. When testing the classifier I get an error as follows: -

There was an issue with viewing the artifact taxonomy.qza as QIIME 2 Metadata:

CategoricalMetadataColumn does not support values with leading or trailing whitespace characters. Column ‘Taxon’ has the following value: 'D_0__Bacteria;D_1__Firmicutes;D_2__Bacilli;D_3__Lactobacillales;D_4__Carnobacteriaceae;D_5__Alloiococcus;D_6__bacterium '

Code to train create and train classifier: -

#Training feature classifiers with q2-feature-classifier

#import sequences
qiime tools import --type ‘FeatureData[Sequence]’ --input-path SILVA_132_QIIME_release/rep_set/rep_set_16S_only/99/silva_132_99_16S.fna --output-path silva_132_99_16S.qza

#import taxonomy
qiime tools import --type ‘FeatureData[Taxonomy]’ --input-format HeaderlessTSVTaxonomyFormat --input-path SILVA_132_QIIME_release/taxonomy/16S_only/99/majority_taxonomy_7_levels.txt --output-path ref-taxonomy.qza

#extract reference reads
qiime feature-classifier extract-reads --i-sequences silva_132_99_16S.qza --p-f-primer CCTACGGGNGGCWGCAG --p-r-primer GACTACHVGGGTATCTAATCC --o-reads ref-seqs.qza

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

#test the classifier
qiime feature-classifier classify-sklearn --i-classifier classifier.qza --i-reads rep-seqs.qza --o-classification taxonomy.qza

#visualise
qiime metadata tabulate --m-input-file taxonomy.qza --o-visualization taxonomy.qzv

Please could you advice on how to overcome this problem with white spaces?

Thanks,

Amy

Hi @act,

Welcome to the forum!

I’m not sure where the white spaces are coming into your reference files! Its been a while since I trained a silva classifier, but I would use your favorite text editor to find and remove the white spaces there, train the classifier, and then go forward.

Best,
Justine

Hi @act,

One more suggestion: could you try upgrading to 2019.10 and summarizing your metadata again?

Best,
Justine

2 Likes

Hi @jwdebelius,
Removing the white spaces was not successful, but upgrading to 2019.10 worked!
Thanks for the tip :slight_smile:
Amy

4 Likes