# GTDB files for Taxonomy build

**URL:** https://forum.qiime2.org/t/gtdb-files-for-taxonomy-build/23106
**Category:** User Support
**Tags:** taxonomy, feature-classifier, dada2
**Created:** [May 18, 2022, 1:40pm UTC](https://forum.qiime2.org/t/gtdb-files-for-taxonomy-build/23106 "2022-05-18T13:40:49Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)
#### Post date: [May 19, 2022, 2:17pm UTC](https://forum.qiime2.org/t/gtdb-files-for-taxonomy-build/23106/8 "2022-05-19T14:17:27Z")

</div>

> [@biojack](#):
>
> But what about repeating IDs?

Those IDs are not repeating. I noted my initial reply, here _is_ the ID below. That is, the standard FASTA header format considers anything prior to the first space the full ID.  
`>RS_GCF_000213495.1~NZ_AFHD01000036.1`

> [@biojack](#):
>
> I tried `reps` file and I totally dislike it. Because it has just only one sequence for each species, not only for each gene.

Yes, this is intended for the rep seqs, as outlined [here](https://gtdb.ecogenomic.org/methods#updating-gtdb-species-representatives).

**Here is another approach to import everything for use as a classifier:**

Download and extract full ssu file:

```auto
wget https://data.gtdb.ecogenomic.org/releases/release202/202.0/genomic_files_all/ssu_all_r202.tar.gz

tar -xvf ssu_all_r202.tar.gz

```

Extract and parse the FASTA header and write to file:

```auto
# Pull the header, keep the first two items (seqID and Taxonomy label), remove '>', and replace ' ' (space) with '\t' (tab)
egrep '^>' ssu_all_r202.fna | cut -d ' ' -f1,2 | sed 's/>//; s/ /\t/' > ssu_all_r202_tax.tsv

```

Then import as a taxonomy file:

```auto
qiime tools import \
    --input-path ssu_all_r202_tax.tsv \
    --type 'FeatureData[Taxonomy]' \
    --input-format 'HeaderlessTSVTaxonomyFormat' \
    --output-path ssu_all_r202_tax.qza

```

Then import the FASTA file as is:

```auto
qiime tools import \
    --input-path ssu_all_r202.fna \
    --type 'FeatureData[Sequence]' \
    --output-path ssu_all_r202_seqs.qza

```

Perform QA/QC through [RESCRIPt](https://forum.qiime2.org/t/processing-filtering-and-evaluating-the-silva-database-and-other-reference-sequence-data-with-rescript/15494) if needed. Then build classifier:

```auto
qiime feature-classifier fit-classifier-naive-bayes \
    --i-reference-reads ssu_all_r202_seqs.qza \
    --i-reference-taxonomy ssu_all_r202_tax.qza \
    --o-classifier gtdb_classifier.qza

```

Test classifier:

```auto
qiime feature-classifier classify-sklearn \
  --i-classifier gtdb_classifier.qza \
  --i-reads rep-seqs.qza \
  --p-n-jobs 4 \
  --o-classification taxonomy.qza

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

```

I just tested this locally and it appears to work. Let us know if this works for you too.

---

_[View the full topic](https://forum.qiime2.org/t/gtdb-files-for-taxonomy-build/23106)._
