# mismatch between taxonomy and sequence data that download from NCBI using qiime rescript get-ncbi-data

**URL:** https://forum.qiime2.org/t/mismatch-between-taxonomy-and-sequence-data-that-download-from-ncbi-using-qiime-rescript-get-ncbi-data/33130
**Category:** Technical Support
**Tags:** taxonomy, ncbi, rescript
**Created:** [May 13, 2025, 10:32am UTC](https://forum.qiime2.org/t/mismatch-between-taxonomy-and-sequence-data-that-download-from-ncbi-using-qiime-rescript-get-ncbi-data/33130 "2025-05-13T10:32:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Si\_Vivy](https://forum.qiime2.org/user_avatar/forum.qiime2.org/si_vivy/32/20936_2.png) [@Si\_Vivy](https://forum.qiime2.org/u/Si_Vivy)
#### Post date: [May 13, 2025, 10:32am UTC](https://forum.qiime2.org/t/mismatch-between-taxonomy-and-sequence-data-that-download-from-ncbi-using-qiime-rescript-get-ncbi-data/33130/1 "2025-05-13T10:32:19Z")

</div>

Hello !  
I am trying to download COI data from NCBI with this code:

```css
qiime rescript get-ncbi-data \
 --p-query '(cytochrome c oxidase subunit I[gene] OR cytochrome oxidase subunit 1[gene] OR cytochrome oxidase subunit I[gene] OR COX1[gene] OR CO1[gene] OR COI[gene] OR COXI[gene] NOT environmental sample[Title] NOT environmental samples[Title] NOT environmental[Title] NOT uncultured[Title] NOT unclassified[Title] NOT unidentified[Title] NOT unverified[Title] NOT txid2[ORGN] NOT txid2157[ORGN] NOT txid10239[ORGN])' \
 --verbose --p-logging-level INFO \
 --p-n-jobs 8 \
 --o-sequences CO1_sequences.qza \
 --o-taxonomy CO1_taxonomy.qza

```

And then I export CO1\_sequences.qza, and CO1\_taxonomy.qza using the code below:

```css
qiime tools export \
  --input-path CO1_sequences.qza \
  --output-path exported-seq-co1

qiime tools export \
  --input-path CO1_taxonomy.qza \
  --output-path exported-taxonomy-co1

```

Subsequently, I converted the .fasta file in the exported-seq-co1 folder to .tsv format and compared it with the taxonomy data in the exported-taxonomy-co1 folder. I discovered that not all sequence IDs (accessions) present in CO1\_sequences are found in CO1\_taxonomy, and I am uncertain about the reason for this discrepancy.

Thanks for helping me!

---

<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 13, 2025, 1:46pm UTC](https://forum.qiime2.org/t/mismatch-between-taxonomy-and-sequence-data-that-download-from-ncbi-using-qiime-rescript-get-ncbi-data/33130/2 "2025-05-13T13:46:14Z")

</div>

Hi @Si_Vivy,

Thank you for providing your commands. Very helpful! 🙂

This thread may help explain the issue:

> [@dereplication error with data collected from \`get-ncbi-data\` command](https://forum.qiime2.org/t/dereplication-error-with-data-collected-from-get-ncbi-data-command/16164):
>
> A collection of sequence and taxonomy data were obtained running @BenKaehler's fantastic get-ncbi-data command within [RESCRIPt](https://forum.qiime2.org/t/using-rescript-to-compile-an-sequence-databases-and-taxonomy-classifiers-from-ncbi-genbank/15947). Raw sequence data collected from get-ncbi-data are [available here](https://osf.io/khup2/) Raw taxonomy data collected from get-ncbi-data are [available here](https://osf.io/wbd63/) I had intended on filtering and dereplicating these sequences using a series of RESCRIPt commands: cull-seqs and filter-seqs-length to filter, and dereplicate to ... well, dereplicate. While the filtering commands completed successfully…

-Mike

---

<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 13, 2025, 3:52pm UTC](https://forum.qiime2.org/t/mismatch-between-taxonomy-and-sequence-data-that-download-from-ncbi-using-qiime-rescript-get-ncbi-data/33130/3 "2025-05-13T15:52:15Z")

</div>

Hi @Si_Vivy,

I was able to successfully run your command without issue via QIIME 2 version `2025.4`. That is, both files contained the same IDs.

I ran:

```auto
qiime rescript get-ncbi-data \   
 --p-query '(cytochrome c oxidase subunit I[gene] OR cytochrome oxidase subunit 1[gene] OR cytochrome oxidase subunit I[gene] OR COX1[gene] OR CO1[gene] OR COI[gene] OR COXI[gene] NOT environmental sample[Title] NOT environmental samples[Title] NOT environmental[Title] NOT uncultured[Title] NOT unclassified[Title] NOT unidentified[Title] NOT unverified[Title] NOT txid2[ORGN] NOT txid2157[ORGN] NOT txid10239[ORGN])' \
 --verbose --p-logging-level INFO \
 --p-n-jobs 8 \
 --o-sequences CO1_sequences.qza \
 --o-taxonomy CO1_taxonomy.qza

```

Then I was able to successfully run the following command. Which should fail if the IDs between the two do not match :

```auto
qiime rescript dereplicate \
    --i-sequences CO1_sequences.qza \
    --i-taxa CO1_taxonomy.qza \
    --p-threads 10 \
    --output-dir CO1_derep \
    --verbose

```

To further ensure that the files contained the same information in both the sequence and taxonomy files I ran the following:

```auto
qiime tools export \
    --input-path CO1_sequences.qza \
    --output-path CO1_sequences_export

qiime tools export \
    --input-path CO1_taxonomy.qza \
    --output-path CO1_taxonomy_export 

# grab IDs and save to file
cat CO1_sequences_export/dna-sequences.fasta | egrep '^>' | sed 's/>//' > seq_ids.txt
cat CO1_taxonomy_export/taxonomy.tsv | tail -n +2 | cut -d $'\t' -f 1 > tax_ids.txt

# run diff to see if there are any differences (the IDs should be in the same order):
diff seq_ids.txt tax_ids.txt

```

The diff command revealed no differences between the IDs in the FASTA and Taxonomy files. I am guessing that there was a network issue, or something that caused the files to files to be incomplete, and/or the version of QIIME 2 / RESCRIPt is an older version? 🤷‍♂️

---

<div class="post-metadata">

### Author: ![Si\_Vivy](https://forum.qiime2.org/user_avatar/forum.qiime2.org/si_vivy/32/20936_2.png) [@Si\_Vivy](https://forum.qiime2.org/u/Si_Vivy)
#### Post date: [May 19, 2025, 7:58am UTC](https://forum.qiime2.org/t/mismatch-between-taxonomy-and-sequence-data-that-download-from-ncbi-using-qiime-rescript-get-ncbi-data/33130/4 "2025-05-19T07:58:44Z")

</div>

Hi Mike,

Thanks so much for your reply; the problem was solved when I used version 2025.4.

vivy

---

<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: [June 19, 2025, 1:59pm UTC](https://forum.qiime2.org/t/mismatch-between-taxonomy-and-sequence-data-that-download-from-ncbi-using-qiime-rescript-get-ncbi-data/33130/5 "2025-06-19T13:59:12Z")

</div>

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