# problem training taxonomic Naive Bayes classifier with SILVA database

**URL:** <https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641>\
**Category:** Technical Support\
**Tags:** feature-classifier, rescript\
**Created:** [June 27, 2024, 2:55pm UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641 "2024-06-27T14:55:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ja.morillo](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ja.morillo/32/4245_2.png) [@ja.morillo](https://forum.qiime2.org/u/ja.morillo)\
**Post date:** [June 27, 2024, 2:55pm UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/1 "2024-06-27T14:55:10Z")

</div>

Dear colleagues,

I am having trouble getting a 16S SILVA classifier in the QIIME 2024.4 environment. The goal is to obtain a classifier for the region defined by the primers B969F (ACGCGHNRAACCTTACC) and BA1406R (ACGGGCRGTGWGTRCAA) based on SILVA 138.1. It does not work: using a mock commuity with 8 known bacterial strains, I get a weard eukaryotic classification-. I am following the tutorial: [Processing, filtering, and evaluating the SILVA database (and other reference sequence data) with RESCRIPt](https://forum.qiime2.org/t/processing-filtering-and-evaluating-the-silva-database-and-other-reference-sequence-data-with-rescript/15494)

To my surprise, after doing some debugging, I noticed that the classifier for the complete 16S region also doesn't work (so the issue seems not related with the specific region). I am pasting the code here - only the part get the full 16S classifier - . There is probably a mistake that I can´t see.

By the way, the pretrained classifier downloaded from QIIME for the complete 16S region ([https://data.qiime2.org/2024.2/common/silva-138-99-nb-classifier.qza](https://data.qiime2.org/2024.2/common/silva-138-99-nb-classifier.qza)), that I am actually trying to replicate here, does actually work (correct taxonomy based on the mock sample); could you possibly share the exact code used to produce it, so I can try to replicate it?

I have also noticed than that the QIIME website classifier is approximately twice as large (519,178 KB) as the one I get with this script (213,312 KB), so I suspect that at some step I might be losing perhaps most of the prokaryotes (?).

Thank you very much again,  
Jose.

### import and prepare sequences SILVA 138.1

qiime rescript get-silva-data   
--p-version '138.1'   
--p-target 'SSURef\_NR99'   
--o-silva-sequences silva-138.1-ssu-nr99-rna-seqs.qza   
--o-silva-taxonomy silva-138.1-ssu-nr99-tax.qza   
--parallel   
--verbose

qiime rescript reverse-transcribe   
--i-rna-sequences silva-138.1-ssu-nr99-rna-seqs.qza   
--o-dna-sequences silva-138.1-ssu-nr99-seqs.qza

qiime rescript cull-seqs   
--i-sequences silva-138.1-ssu-nr99-seqs.qza   
--o-clean-sequences silva-138.1-ssu-nr99-seqs-cleaned.qza

qiime rescript filter-seqs-length-by-taxon   
--i-sequences silva-138.1-ssu-nr99-seqs-cleaned.qza   
--i-taxonomy silva-138.1-ssu-nr99-tax.qza   
--p-labels Archaea Bacteria Eukaryota   
--p-min-lens 900 1200 1400   
--o-filtered-seqs silva-138.1-ssu-nr99-seqs-filt.qza   
--o-discarded-seqs silva-138.1-ssu-nr99-seqs-discard.qza

qiime rescript dereplicate   
--i-sequences silva-138.1-ssu-nr99-seqs-filt.qza   
--i-taxa silva-138.1-ssu-nr99-tax.qza   
--p-mode 'uniq'   
--o-dereplicated-sequences silva-138.1-ssu-nr99-seqs-derep-uniq.qza   
--o-dereplicated-taxa silva-138.1-ssu-nr99-tax-derep-uniq.qza   
--p-threads 30

### Train Full 16S classifier

qiime feature-classifier fit-classifier-naive-bayes   
--i-reference-reads silva-138.1-ssu-nr99-seqs-derep-uniq.qza   
--i-reference-taxonomy silva-138.1-ssu-nr99-tax-derep-uniq.qza   
--o-classifier silva-138.1-ssu-nr99-full16S-classifier.qza

---

<div class="post-metadata">

**Author:** ![ja.morillo](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ja.morillo/32/4245_2.png) [@ja.morillo](https://forum.qiime2.org/u/ja.morillo)\
**Post date:** [June 28, 2024, 1:03pm UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/2 "2024-06-28T13:03:45Z")

</div>

An update that might help: I just tried using the pre-trained classifier available on the Qiime website in the newest version 2024.5 (silva-138-99-nb-classifier.qza, [https://data.qiime2.org/classifiers/sklearn-1.4.2/silva/silva-138-99-nb-classifier.qza](https://data.qiime2.org/classifiers/sklearn-1.4.2/silva/silva-138-99-nb-classifier.qza)); it also doesn't work for my mock (all are eykaryotic assignments), and suspiciously it weighs almost exactly the same as the "wrong" classifier I generated with the previous pipeline in the version 2024.2 (213.131 KB):

conda activate qiime2-amplicon-2024.5

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.5/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy.qza   
--p-n-jobs 30   
--verbose

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_CHECK.qzv

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 1, 2024, 9:52am UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/3 "2024-07-01T09:52:27Z")

</div>

Hi @ja.morillo ,  
I just ran a quick test run with the 2024.5 pre-trained classifier and it appears to be working fine.

So I am not sure why you are getting some strange results. Two possibilities come to mind:

1. try specifying the `--p-read-orientation` parameter with `classify-sklearn`. Particularly if your sequences are in mixed orientations this could cause issues with the classifier, or even if not some of your query sequences could be causing the orientation detector to misbehave.
2. The only real difference between the 2024.2 and 2024.5 classifiers is the database version: SILVA 138 vs. 138.1. This should not lead to massively different results, but it's worth investigating further if my first idea does not lead to more promising results.

Please give that a try and let me know what you find.

> [@ja.morillo](#):
>
> could you possibly share the exact code used to produce it, so I can try to replicate it?

Note that you can always inspect this directly in the `provenance` tab for any QZA or QZV file. Or use provenance replay to extract this information into a script that you can use to replicate.

Good luck!

---

<div class="post-metadata">

**Author:** ![ja.morillo](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ja.morillo/32/4245_2.png) [@ja.morillo](https://forum.qiime2.org/u/ja.morillo)\
**Post date:** [July 2, 2024, 12:56pm UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/5 "2024-07-02T12:56:50Z")

</div>

First of all, thank you very much for the help! I have conducted some tests that I believe might be of interest to share on the forum. Firstly, I downloaded the classifiers again from the Qiime resources website and obtained the provenance using provenance replay (very useful!) for the two full-length SILVA pre-trained classifiers. Main points:

1. I still don't understand why the classifier with the SILVA 138 database (q2.2024.2) is twice as large as the one with the SILVA 138.1 database (q2.2024.5). I would expect a larger size if the database has been expanded.
2. The provenance of both classifiers shows quite a few changes in the code, but most notably, in the case of q2.2024.5, a step involving qiime rescript reverse-transcribe is included, which is NOT present in the provenance of q2.2024.2. Why?
3. Regarding my test sample, everything works fine with q2.2024.2, but I get all eukaryotes with q2.2024.5 (i.e., the same error persists).
4. I tried to train the classifier within q2.2024.5 by omitting the qiime rescript reverse-transcribe step, but without success.
5. I tested all options of --p-read-orientation with classify-sklearn but without results.  
In summary, starting from exactly the same fastq files, everything is working with q2.2024.2 but not with q2.2024.5. My initial intention was to generate a classifier for the specific region of my sequences by updating Qiime, so I believe it is worth investigating this further.

Below are the scripts I used, and the provenance results for both pre-trained Qiime2 classifiers.

###################### TAXONOMY q2-2024.2 ######################

conda activate qiime2-amplicon-2024.2

cd ~/qiime2/analysis/Starling2021/debug\_cutadapt\_q2-2024.2

mkdir taxo

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.2/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy.qza   
--p-n-jobs 10   
--p-read-orientation auto   
--verbose

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_CHECK.qzv

###################### TAXONOMY q2-2024.5 ######################

conda activate qiime2-amplicon-2024.5

cd ~/qiime2/analysis/Starling2021/debug\_cutadapt\_q2-2024.5

mkdir taxo

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.5/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy.qza   
--p-n-jobs 10   
--p-read-orientation auto   
--verbose

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_CHECK.qzv

# Provenance of both classifiers:

###################### PROVENANCE q2-2024.2 ######################

conda activate qiime2-amplicon-2024.2

cd ~/qiime2/analysis/databases/16S/qiime\_2024.2

wget [https://data.qiime2.org/2024.2/common/silva-138-99-nb-classifier.qza](https://data.qiime2.org/2024.2/common/silva-138-99-nb-classifier.qza)

qiime tools replay-provenance   
--in-fp silva-138-99-nb-classifier.qza   
--out-fp silva-138-99-nb-classifier\_provenance.txt   
--verbose

cat silva-138-99-nb-classifier\_provenance.txt

[only relevant part]

qiime rescript get-silva-data   
--p-version 138   
--p-target SSURef\_NR99   
--p-include-species-labels   
--p-rank-propagation   
--p-download-sequences   
--o-silva-sequences silva-sequences-0.qza   
--o-silva-taxonomy silva-taxonomy-0.qza

qiime rescript cull-seqs   
--i-sequences silva-sequences-0.qza   
--p-num-degenerates 5   
--p-homopolymer-length 8   
--p-n-jobs 1   
--o-clean-sequences clean-sequences-0.qza

qiime rescript filter-seqs-length-by-taxon   
--i-sequences clean-sequences-0.qza   
--i-taxonomy silva-taxonomy-0.qza   
--p-labels Archaea Bacteria Eukaryota   
--p-min-lens 900 1200 1400   
--o-filtered-seqs filtered-seqs-0.qza   
--o-discarded-seqs XX\_discarded\_seqs

qiime rescript dereplicate   
--i-sequences filtered-seqs-0.qza   
--i-taxa silva-taxonomy-0.qza   
--p-mode uniq   
--p-perc-identity 1.0   
--p-threads 1   
--p-rank-handles silva   
--p-no-derep-prefix   
--o-dereplicated-sequences dereplicated-sequences-0.qza   
--o-dereplicated-taxa dereplicated-taxa-0.qza

qiime rescript evaluate-fit-classifier   
--i-sequences dereplicated-sequences-0.qza   
--i-taxonomy dereplicated-taxa-0.qza   
--p-reads-per-batch auto   
--p-n-jobs 1   
--p-confidence 0.7   
--o-classifier classifier-0.qza   
--o-evaluation XX\_evaluation   
--o-observed-taxonomy XX\_observed\_taxonomy

###################### PROVENANCE q2-2024.5 ######################

conda activate qiime2-amplicon-2024.5

cd ~/qiime2/analysis/databases/16S/qiime\_2024.5

wget [https://data.qiime2.org/classifiers/sklearn-1.4.2/silva/silva-138-99-nb-classifier.qza](https://data.qiime2.org/classifiers/sklearn-1.4.2/silva/silva-138-99-nb-classifier.qza)

qiime tools replay-provenance   
--in-fp silva-138-99-nb-classifier.qza   
--out-fp silva-138-99-nb-classifier\_provenance.txt   
--verbose

cat silva-138-99-nb-classifier\_provenance.txt

[only relevant part]

qiime rescript get-silva-data   
--p-version 138.1   
--p-target SSURef\_NR99   
--p-no-include-species-labels   
--p-rank-propagation   
--p-download-sequences   
--o-silva-taxonomy silva-taxonomy-0.qza   
--o-silva-sequences silva-sequences-0.qza

**qiime rescript reverse-transcribe**   
--i-rna-sequences silva-sequences-0.qza   
--o-dna-sequences dna-sequences-0.qza

qiime rescript cull-seqs   
--i-sequences dna-sequences-0.qza   
--p-num-degenerates 5   
--p-homopolymer-length 8   
--p-n-jobs 1   
--o-clean-sequences clean-sequences-0.qza

qiime rescript filter-seqs-length-by-taxon   
--i-sequences clean-sequences-0.qza   
--i-taxonomy silva-taxonomy-0.qza   
--p-labels Archaea Bacteria Eukaryota   
--p-min-lens 900 1200 1400   
--o-filtered-seqs filtered-seqs-0.qza   
--o-discarded-seqs XX\_discarded\_seqs

qiime rescript dereplicate   
--i-sequences filtered-seqs-0.qza   
--i-taxa silva-taxonomy-0.qza   
--p-mode uniq   
--p-perc-identity 1.0   
--p-threads 1   
--p-rank-handles domain phylum class order family genus species   
--p-no-derep-prefix   
--o-dereplicated-taxa dereplicated-taxa-0.qza   
--o-dereplicated-sequences dereplicated-sequences-0.qza

qiime feature-classifier fit-classifier-naive-bayes   
--i-reference-reads dereplicated-sequences-0.qza   
--i-reference-taxonomy dereplicated-taxa-0.qza   
--p-classify--alpha 0.001   
--p-classify--chunk-size 20000   
--p-classify--class-prior null   
--p-no-classify--fit-prior   
--p-no-feat-ext--alternate-sign   
--p-feat-ext--analyzer char\_wb   
--p-no-feat-ext--binary   
--p-feat-ext--decode-error strict   
--p-feat-ext--encoding utf-8   
--p-feat-ext--input content   
--p-feat-ext--lowercase   
--p-feat-ext--n-features 8192   
--p-feat-ext--ngram-range '[7, 7]'   
--p-feat-ext--norm l2   
--p-feat-ext--preprocessor null   
--p-feat-ext--stop-words null   
--p-feat-ext--strip-accents null   
--p-feat-ext--token-pattern '(?u)\b\w\w+\b'   
--p-feat-ext--tokenizer null   
--p-no-verbose   
--o-classifier classifier-0.qza

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 2, 2024, 2:48pm UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/6 "2024-07-02T14:48:45Z")

</div>

Hi @ja.morillo ,  
Thanks for the update and information.

> [@ja.morillo](#):
>
> The provenance of both classifiers shows quite a few changes in the code, but most notably, in the case of q2.2024.5, a step involving qiime rescript reverse-transcribe is included, which is NOT present in the provenance of q2.2024.2. Why?

this step was done internally as part of the `get-silva-data` action in the older version of RESCRIPt. In the more recent release (used in 2024.5) this is done separately. I would not expect this to impact the results.

Similarly, the other difference in provenance (use of `qiime rescript evaluate-fit-classifier ` vs. `qiime feature-classifier fit-classifier-naive-bayes `) should not matter, as `evaluate-fit-classifier` runs a pipeline that includes `fit-classifier-naive-bayes` with the same default parameters.

> [@ja.morillo](#):
>
> I tested all options of --p-read-orientation with classify-sklearn but without results.

Could you please clarify? This did not impact the results?

could you please share:

1. the taxonomy barplot QZVs from each of your tests (each database version and with the results with different read orientations)
2. run `qiime metadata tabulate` with the taxonomy files (from 2024.2 and 2024.5) and send the QZVs
3. run `qiime feature-table tabulate-seqs` with the `representative_sequences.qza ` and send the output.

---

<div class="post-metadata">

**Author:** ![ja.morillo](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ja.morillo/32/4245_2.png) [@ja.morillo](https://forum.qiime2.org/u/ja.morillo)\
**Post date:** [July 3, 2024, 11:44am UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/7 "2024-07-03T11:44:20Z")

</div>

Thank you for explaining the changes between both versions of RESCRIPt. It's clear now.

You are right, I was not very clear in my comments about the effects of the options for `--p-read-orientation` with `classify-sklearn`. What I meant to say is that using ´--p-read-orientation reverse-complement´ with q2.2024.5, did not improve the results (taxonmy is incorrect with all optoins). Of course, it impacted the `q2.2024.2` taxonomy (with reverse-complement, wrong; auto and same,OK).

This sample is a mock community of 8 strains, that was mixed with a soil sample (that was for a paticular test; but with q2.2024.2 barplots qzv you will see the 8 main bacteria).

I am sending you all the files that you asked for along with the code I used.

# q2.2024.2 qzv(s):

[tabulate-seq\_same-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/l9u0rTRKrXRtji9NmEMgOUHpR8x.qzv) (346.0 KB)  
[tabulate-seq\_auto-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/zFiuAEEP7rqZBlnljMHyqKk4Zyn.qzv) (346.5 KB)  
[tabulate-seq\_reverse-complement-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/vjf306XHUCoEdG584CHE9KtHsdS.qzv) (341.4 KB)  
[taxa\_barplot\_same-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/2ezzzDxUYPipKAjbsF9hDygTPjD.qzv) (401.8 KB)  
[taxa\_barplot\_auto-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/2RL2xsluK8q1sQsdqshoBzZYsXw.qzv) (401.8 KB)  
[taxa\_barplot\_reverse-complement-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/vb9jW4o2S3j0KmVMEd08f5BHQsE.qzv) (388.5 KB)  
[taxonomy\_same-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/o1s3OaEpiqFVzvh3dN1eNTGa0bp.qzv) (1.3 MB)  
[taxonomy\_auto-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/7S6zDOnby5Qch67NqRfkVbBo85x.qzv) (1.3 MB)  
[taxonomy\_reverse-complement-2024.2.qzv](https://forum.qiime2.org/uploads/short-url/bHJly5N1wUzHqk29dt8hROf4IpW.qzv) (1.3 MB)

# q2.2024.5 qzv(s):

[tabulate-seq\_same-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/PS6dX4PY6rxRths0GJlzRfPWbB.qzv) (348.1 KB)  
[tabulate-seq\_auto-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/lHBH1F1IBRxDunAEwrZ4FPodBHQ.qzv) (344.0 KB)  
[tabulate-seq\_reverse-complement-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/sdqaWOj1avSACoZGHhR5APzbcy.qzv) (344.1 KB)  
[taxa\_barplot\_same-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/vxkYhDDLsHdoNN6iVXLwr3AzsEt.qzv) (402.8 KB)  
[taxa\_barplot\_auto-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/7XemfMwAYmEq5zkoTjhusrU9KZp.qzv) (392.1 KB)  
[taxa\_barplot\_reverse-complement-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/kpmEYauQw8RL68tNYLWxqnqWmjZ.qzv) (392.1 KB)  
[taxonomy\_same-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/AfAjUUnFU1VKhkGBN8UB1aukjgU.qzv) (1.3 MB)  
[taxonomy\_auto-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/wchAZNhf98MGVII9BJivz6EfEA3.qzv) (1.3 MB)  
[taxonomy\_reverse-complement-2024.5.qzv](https://forum.qiime2.org/uploads/short-url/2CpOpRKyJ1YbgVkyyML2SoIrciX.qzv) (1.3 MB)

Many thanks in advance for checking this!

############# q2.2024.2 #############

cd ~/qiime2/analysis/Starling2021/debug\_classifiers/q2.2024.2

conda activate qiime2-amplicon-2024.2

## Import data

qiime tools import   
--type 'SampleData[PairedEndSequencesWithQuality]'   
--input-path ./manifest\_debug.tsv   
--output-path demux-paired-end.qza   
--input-format PairedEndFastqManifestPhred33V2

qiime demux summarize   
--i-data demux-paired-end.qza   
--o-visualization demux-paired-end.qzv

## Cutadapt

qiime cutadapt trim-paired   
--i-demultiplexed-sequences demux-paired-end.qza   
--p-cores 30   
--p-front-f ACGCGHNRAACCTTACC   
--p-adapter-f TTGYACWCACYGCCCGT   
--p-front-r ACGGGCRGTGWGTRCAA   
--p-adapter-r GGTAAGGTTYNDCGCGT   
--p-error-rate 0.1   
--p-indels   
--p-overlap 3   
--p-match-read-wildcards True   
--p-match-adapter-wildcards True   
--o-trimmed-sequences trimmed.qza   
--p-times 1   
--p-discard-untrimmed   
--verbose \> cutadapt\_log.txt

qiime demux summarize   
--i-data trimmed.qza   
--o-visualization trimmed.qzv

## DADA2

qiime dada2 denoise-paired   
--i-demultiplexed-seqs trimmed.qza   
--p-trim-left-f 0   
--p-trim-left-r 0   
--p-trunc-len-f 205   
--p-trunc-len-r 215   
--output-dir dada2   
--p-n-threads 30   
--p-pooling-method pseudo   
--verbose

qiime tools export --input-path dada2/denoising\_stats.qza --output-path dada2/

# results DADA2

qiime metadata tabulate   
--m-input-file dada2/denoising\_stats.qza   
--o-visualization dada2/stats-dada2.qzv

# ASVs stats:

qiime feature-table summarize   
--i-table dada2/table.qza   
--o-visualization dada2/table.qzv

## TAXONOMY

mkdir taxo

# check three --p-read-orientation options:

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.2/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy\_auto.qza   
--p-n-jobs 15   
--p-read-orientation auto   
--verbose

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.2/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy\_same.qza   
--p-n-jobs 15   
--p-read-orientation same   
--verbose

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.2/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy\_reverse-complement.qza   
--p-n-jobs 15   
--p-read-orientation reverse-complement   
--verbose

# barplots qzv(s):

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy\_auto.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_auto.qzv

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy\_same.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_same.qzv

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy\_reverse-complement.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_reverse-complement.qzv

# metadata tabulate taxo

qiime metadata tabulate   
--m-input-file taxo/taxonomy\_auto.qza   
--o-visualization taxo/taxonomy\_auto.qzv

qiime metadata tabulate   
--m-input-file taxo/taxonomy\_same.qza   
--o-visualization taxo/taxonomy\_same.qzv

qiime metadata tabulate   
--m-input-file taxo/taxonomy\_reverse-complement.qza   
--o-visualization taxo/taxonomy\_reverse-complement.qzv

# rep seqs qzv(s):

qiime feature-table tabulate-seqs   
--i-data dada2/representative\_sequences.qza   
--i-taxonomy taxo/taxonomy\_auto.qza   
--o-visualization taxo/tabulate-seq\_auto.qzv

qiime feature-table tabulate-seqs   
--i-data dada2/representative\_sequences.qza   
--i-taxonomy taxo/taxonomy\_same.qza   
--o-visualization taxo/tabulate-seq\_same.qzv

qiime feature-table tabulate-seqs   
--i-data dada2/representative\_sequences.qza   
--i-taxonomy taxo/taxonomy\_reverse-complement.qza   
--o-visualization taxo/tabulate-seq\_reverse-complement.qzv

############# q2.2024.5 #############

cd ~/qiime2/analysis/Starling2021/debug\_classifiers/q2.2024.5

conda activate qiime2-amplicon-2024.5

## Import data

qiime tools import   
--type 'SampleData[PairedEndSequencesWithQuality]'   
--input-path ./manifest\_debug.tsv   
--output-path demux-paired-end.qza   
--input-format PairedEndFastqManifestPhred33V2

qiime demux summarize   
--i-data demux-paired-end.qza   
--o-visualization demux-paired-end-2024.5.qzv

## Cutadapt

qiime cutadapt trim-paired   
--i-demultiplexed-sequences demux-paired-end.qza   
--p-cores 30   
--p-front-f ACGCGHNRAACCTTACC   
--p-adapter-f TTGYACWCACYGCCCGT   
--p-front-r ACGGGCRGTGWGTRCAA   
--p-adapter-r GGTAAGGTTYNDCGCGT   
--p-error-rate 0.1   
--p-indels   
--p-overlap 3   
--p-match-read-wildcards True   
--p-match-adapter-wildcards True   
--o-trimmed-sequences trimmed.qza   
--p-times 1   
--p-discard-untrimmed   
--verbose \> cutadapt\_log.txt

qiime demux summarize   
--i-data trimmed.qza   
--o-visualization trimmed-2024.5.qzv

## DADA2

qiime dada2 denoise-paired   
--i-demultiplexed-seqs trimmed.qza   
--p-trim-left-f 0   
--p-trim-left-r 0   
--p-trunc-len-f 205   
--p-trunc-len-r 215   
--output-dir dada2   
--p-n-threads 30   
--p-pooling-method pseudo   
--verbose

qiime tools export --input-path dada2/denoising\_stats.qza --output-path dada2/

# results DADA2

qiime metadata tabulate   
--m-input-file dada2/denoising\_stats.qza   
--o-visualization dada2/stats-dada2-2024.5.qzv

# ASVs stats:

qiime feature-table summarize   
--i-table dada2/table.qza   
--o-visualization dada2/table-2024.5.qzv

## TAXONOMY

mkdir taxo

# check three --p-read-orientation options:

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.5/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy\_auto.qza   
--p-n-jobs 15   
--p-read-orientation auto   
--verbose

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.5/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy\_same.qza   
--p-n-jobs 15   
--p-read-orientation same   
--verbose

qiime feature-classifier classify-sklearn   
--i-classifier ~/qiime2/analysis/databases/16S/qiime\_2024.5/silva-138-99-nb-classifier.qza   
--i-reads dada2/representative\_sequences.qza   
--o-classification taxo/taxonomy\_reverse-complement.qza   
--p-n-jobs 15   
--p-read-orientation reverse-complement   
--verbose

# barplots qzv(s):

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy\_auto.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_auto-2024.5.qzv

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy\_same.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_same-2024.5.qzv

qiime taxa barplot --i-table dada2/table.qza   
--i-taxonomy taxo/taxonomy\_reverse-complement.qza   
--m-metadata-file metadata\_debug.tsv   
--o-visualization taxo/taxa\_barplot\_reverse-complement-2024.5.qzv

# metadata tabulate taxo

qiime metadata tabulate   
--m-input-file taxo/taxonomy\_auto.qza   
--o-visualization taxo/taxonomy\_auto-2024.5.qzv

qiime metadata tabulate   
--m-input-file taxo/taxonomy\_same.qza   
--o-visualization taxo/taxonomy\_same-2024.5.qzv

qiime metadata tabulate   
--m-input-file taxo/taxonomy\_reverse-complement.qza   
--o-visualization taxo/taxonomy\_reverse-complement-2024.5.qzv

# rep seqs qzv(s):

qiime feature-table tabulate-seqs   
--i-data dada2/representative\_sequences.qza   
--i-taxonomy taxo/taxonomy\_auto.qza   
--o-visualization taxo/tabulate-seq\_auto-2024.5.qzv

qiime feature-table tabulate-seqs   
--i-data dada2/representative\_sequences.qza   
--i-taxonomy taxo/taxonomy\_same.qza   
--o-visualization taxo/tabulate-seq\_same-2024.5.qzv

qiime feature-table tabulate-seqs   
--i-data dada2/representative\_sequences.qza   
--i-taxonomy taxo/taxonomy\_reverse-complement.qza   
--o-visualization taxo/tabulate-seq\_reverse-complement-2024.5.qzv

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 3, 2024, 5:26pm UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/8 "2024-07-03T17:26:57Z")

</div>

Hi @ja.morillo ,  
Thanks for preparing all of these files. We can just focus on two:  
[2024.2 same orientation](https://view.qiime2.org/visualization/?src=https://forum.qiime2.org/uploads/short-url/2ezzzDxUYPipKAjbsF9hDygTPjD.qzv)  
[2024.5 same orientation](https://view.qiime2.org/visualization/?src=https://forum.qiime2.org/uploads/short-url/vxkYhDDLsHdoNN6iVXLwr3AzsEt.qzv)

These look more or less the same to me and do not contain Eukaryotes.

Indeed, the "auto" orientation is yielding bad results, as can happen when some query sequences cause the orientation detector to misfire, e.g., due to very noisy query or reference sequences. But it looks like you just need to set orientation to "same" for your samples to get it to classify just fine.

So I still do not see any issue with the 2024.5 release / SILVA 138.1 classifier based on these results.

---

<div class="post-metadata">

**Author:** ![ja.morillo](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ja.morillo/32/4245_2.png) [@ja.morillo](https://forum.qiime2.org/u/ja.morillo)\
**Post date:** [July 11, 2024, 12:07pm UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/9 "2024-07-11T12:07:08Z")

</div>

Hello,

Thank you very much for checking the files, and I apologize for the delay in my response, but I needed time to verify everything properly. Indeed, the "same" orientation generates good results with the QIIME 2024.5 version (sorry for the erroneous check of the qzv). It's interesting that in 2024.2, "auto" also works. Considering that the query sequences are the same, I understand that this is due to changes in the latest version of SILVA used in the QIIME 2024.5 classifier. We will take this into account for future updates. Thank you again for your time and explanations.

Cheers,  
Jose

---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [August 11, 2024, 6:07pm UTC](https://forum.qiime2.org/t/problem-training-taxonomic-naive-bayes-classifier-with-silva-database/30641/10 "2024-08-11T18:07:18Z")

</div>

Closed on August 11, 2024, 6:07pm UTC

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