# train a sequence classifier on your own data

**URL:** https://forum.qiime2.org/t/train-a-sequence-classifier-on-your-own-data/33356
**Category:** User Support
**Tags:** classifier, asv, greengenes2
**Created:** [June 27, 2025, 9:17am UTC](https://forum.qiime2.org/t/train-a-sequence-classifier-on-your-own-data/33356 "2025-06-27T09:17:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![chupperts](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/c/ce7236/32.png) [@chupperts](https://forum.qiime2.org/u/chupperts)
#### Post date: [June 27, 2025, 9:17am UTC](https://forum.qiime2.org/t/train-a-sequence-classifier-on-your-own-data/33356/1 "2025-06-27T09:17:18Z")

</div>

Dear,

I’m currently trying to understand the process of building and using a classifier, but I haven’t been able to find clear answers in the tutorials or forums.

To make things clearer, I’ll briefly describe our project:

We aim to analyze the microbiome of piglets at different stages: at weaning (4 weeks), post-weaning (8 weeks), and adulthood (6 months).

I already trained a classifier with files from the greengenes release (2022) for a previous experiment (But I'm not sure I used the best way!). Based on this, I wanted to prepare a new classifier using the following files from the Greengenes2 (2024) release: `2024.09.seqs.fna.qza` and `2024.09.taxonomy.id.tsv.qza` . With this classifier, I will be able to assign taxonomy to my data.

Here are my questions:

1. From this point, is it possible to train a new classifier using my own sequences and taxonomy files, based on the taxonomy already assigned?
2. Would it be better to create separate classifiers for each piglet age group (e.g., one for young piglets and another for adults), or is a single classifier sufficient for all age groups?

Thank you in advance for your help.

---

<div class="post-metadata">

### Author: ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)
#### Post date: [June 27, 2025, 10:29am UTC](https://forum.qiime2.org/t/train-a-sequence-classifier-on-your-own-data/33356/2 "2025-06-27T10:29:23Z")

</div>

Hello!

> [@chupperts](#):
>
> From this point, is it possible to train a new classifier using my own sequences and taxonomy files, based on the taxonomy already assigned?

If you are asking about the technical possibility, then yes, you can train the classifier with your sequences or taxa.  
However, I would not recommend this approach, as it limits the database to the scope of the previously annotated community. You can lose a lot of information!

> [@chupperts](#):
>
> Would it be better to create separate classifiers for each piglet age group (e.g., one for young piglets and another for adults), or is a single classifier sufficient for all age groups?

The single classifier would be better

> [@chupperts](#):
>
> Based on this, I wanted to prepare a new classifier using the following files from the Greengenes2 (2024) release: `2024.09.seqs.fna.qza` and `2024.09.taxonomy.id.tsv.qza` . With this classifier, I will be able to assign taxonomy to my data.

Looks like the best option to me!

Check out [RESCRIPt](https://github.com/bokulich-lab/RESCRIPt) for tutorials on how to train the classifier (though you need to adapt the commands for predownloaded GG2 sequences).

Or check if [GG2](https://github.com/biocore/q2-greengenes2) repo and [this post](https://forum.qiime2.org/t/introducing-greengenes2-2022-10/25291) have some insights.

Best,

---

<div class="post-metadata">

### Author: ![chupperts](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/c/ce7236/32.png) [@chupperts](https://forum.qiime2.org/u/chupperts)
#### Post date: [June 27, 2025, 11:06am UTC](https://forum.qiime2.org/t/train-a-sequence-classifier-on-your-own-data/33356/3 "2025-06-27T11:06:55Z")

</div>

Thank you very much !

---

<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: [July 28, 2025, 5:07pm UTC](https://forum.qiime2.org/t/train-a-sequence-classifier-on-your-own-data/33356/4 "2025-07-28T17:07:28Z")

</div>

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