# Error feature classifier:extract reference reads

**URL:** https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748
**Category:** Technical Support
**Created:** [September 30, 2020, 4:08am UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748 "2020-09-30T04:08:33Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![uth](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/u/c57346/32.png) [@uth](https://forum.qiime2.org/u/uth)
#### Post date: [September 30, 2020, 4:08am UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/1 "2020-09-30T04:08:33Z")

</div>

Hi,

I'm trying to extract reference reads from a qiime2 compatible PhytoRef database. [[Oceanic\_database/PhytoRef at master · ndu-bioinfo/Oceanic\_database · GitHub](https://github.com/ndu-UCSD/Oceanic_database/tree/master/PhytoRef)].  
I have worked with this database before (trained the classifier with the provided files : Phyto\_16S\_plastid\_qiime2.qza and Phyto\_16S\_plastid\_taxonomy.qza) and it worked perfectly alright.  
I'm trying to use the same files again for another project, and when I try to extract reads it gives the following error:  
**(1/1) Invalid value for "--i-sequences": 'qiime2-compatible-phytoref-**  
\*\* files/Phyto\_16S\_plastid\_qiime2.qza' is not a QIIME 2 Artifact (.qza)\*\*

I really can't understand why this is happening. Any help is much appreciated!

Many thanks in advance!

Uth

---

<div class="post-metadata">

### Author: ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)
#### Post date: [September 30, 2020, 5:57pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/2 "2020-09-30T17:57:38Z")

</div>

Hi @uth,

Can you tell us what QIIME 2 version you are running and the OS, as well as copy & paste the exact commands you ran, as well as the full error message you get. Adding the `--verbose` flag would be very useful as well.

In future posts, these would be a great a minimum info starting point.  
Thanks!

---

<div class="post-metadata">

### Author: ![uth](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/u/c57346/32.png) [@uth](https://forum.qiime2.org/u/uth)
#### Post date: [October 6, 2020, 12:23am UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/3 "2020-10-06T00:23:09Z")

</div>

Hi,

Thanks a lot for the response. I apologise for the late reply!!!

Below is the command I used

**qiime feature-classifier extract-reads --i-sequences qiime2-compatible-phytoref-files/Phyto\_16S\_plastid\_qiime2.qza --p-f-primer GTGCCAGCMGCCGCGGTAA --p-r-primer GGACTACHVGGGTWTCTAAT --o-reads reference-seqs-phytoref.qza --verbose**

ERROR:  
Usage: qiime feature-classifier extract-reads [OPTIONS]

Extract sequencing-like reads from a reference database.

Inputs:  
--i-sequences ARTIFACT FeatureData[Sequence]  
[required]  
Parameters:  
--p-f-primer TEXT forward primer sequence [required]  
--p-r-primer TEXT reverse primer sequence [required]  
--p-trunc-len INTEGER read is cut to trunc-len if trunc-len is positive.  
Applied before trim-left. [default: 0]  
--p-trim-left INTEGER trim-left nucleotides are removed from the 5' end  
if trim-left is positive. Applied after trunc-len.  
[default: 0]  
--p-identity NUMBER minimum combined primer match identity threshold.  
[default: 0.8]  
--p-min-length INTEGER Minimum amplicon length. Shorter amplicons are  
Range(0, None) discarded. Applied after trimming and truncation, so  
be aware that trimming may impact sequence  
retention. Set to zero to disable min length  
filtering. [default: 50]  
--p-max-length INTEGER Maximum amplicon length. Longer amplicons are  
Range(0, None) discarded. Applied before trimming and truncation,  
so plan accordingly. Set to zero (default) to  
disable max length filtering. [default: 0]  
--p-n-jobs INTEGER Number of seperate processes to run.  
Range(1, None) [default: 1]  
--p-batch-size VALUE Int % Range(1, None) | Str % Choices('auto')  
Number of sequences to process in a batch. The  
`auto` option is calculated from the number of  
sequences and number of jobs specified.  
[default: 'auto']  
Outputs:  
--o-reads ARTIFACT FeatureData[Sequence]  
[required]  
Miscellaneous:  
--output-dir PATH Output unspecified results to a directory  
--verbose / --quiet Display verbose output to stdout and/or stderr  
during execution of this action. Or silence output  
if execution is successful (silence is golden).  
--citations Show citations and exit.  
--help Show this message and exit.

```
                There was a problem with the command:                     

```

(1/1) Invalid value for "--i-sequences": 'qiime2-compatible-phytoref-  
files/Phyto\_16S\_plastid\_qiime2.qza' is not a QIIME 2 Artifact (.qza)

I'm running this on a linux server.

Thanks again!  
Uth

---

<div class="post-metadata">

### Author: ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)
#### Post date: [October 6, 2020, 3:14am UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/4 "2020-10-06T03:14:42Z")

</div>

Hi @uth,  
Thanks for the update.

> [@Mehrbod\_Estaki](#):
>
> Can you tell us what QIIME 2 version you are running

The error is telling you that it can't find the `qiime2-compatible-phytoref-files/Phyto_16S_plastid_qiime2.qza` file in the directory you are telling it to. Can you double-check to make sure that this file is indeed there and not instead in the current directory that you are running that command from?

Check with `ls qiime2-compatible-phytoref-files/`

And is this command exactly as you typed it into terminal?

```auto
qiime feature-classifier extract-reads --i-sequences qiime2-compatible-phytoref-files/Phyto_16S_plastid_qiime2.qza --p-f-primer GTGCCAGCMGCCGCGGTAA --p-r-primer GGACTACHVGGGTWTCTAAT --o-reads reference-seqs-phytoref.qza --verbose

```

And not something you copied from another document that may have added some weird characters? For example sometimes `--` in certain text editors can behave as -- instead and that can cause problems.

Try copying the below directly to terminal:

```bash
qiime feature-classifier extract-reads \
--i-sequences qiime2-compatible-phytoref-files/Phyto_16S_plastid_qiime2.qza \
--p-f-primer GTGCCAGCMGCCGCGGTAA \
--p-r-primer GGACTACHVGGGTWTCTAAT \
--o-reads reference-seqs-phytoref.qza \
--verbose

```

Let us know how that goes.

---

<div class="post-metadata">

### Author: ![uth](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/u/c57346/32.png) [@uth](https://forum.qiime2.org/u/uth)
#### Post date: [October 7, 2020, 11:36pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/5 "2020-10-07T23:36:29Z")

</div>

Hi @Mehrbod_Estaki,

Thanks a lot for the response.

The qiime2 version I'm running is **2019.10**.

"And is this command exactly as you typed it into terminal?"...I usually type the command and tab complete it. I also copy pasted the command you have posted but the error is the same.

"Check with `ls qiime2-compatible-phytoref-files/`" : I did this and the file is there

**(qiime2-2019.10) uth@nightowl:~/Uth/classifier-files/qiime2-compatible-phytoref-files$ ll -h**  
**total 7.4M**  
**drwxrwxr-x 2 uth uth 4.0K Jan 9 2020 ./**  
**drwxrwxr-x 6 uth uth 4.0K Sep 24 23:07 ../**  
**-rw-rw-r-- 1 uth uth 63K Jan 9 2020 Phyto\_16S\_plastid\_qiime2.qza**  
**-rw-rw-r-- 1 uth uth 63K Jan 9 2020 Phyto\_16S\_plastid\_taxonomy.qza**

Thanks in advance  
Uthpala

---

<div class="post-metadata">

### Author: ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)
#### Post date: [October 8, 2020, 4:01am UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/6 "2020-10-08T04:01:34Z")

</div>



---

<div class="post-metadata">

### Author: ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)
#### Post date: [October 8, 2020, 8:35am UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/7 "2020-10-08T08:35:24Z")

</div>

Hi @uth,

I don't think you typed `ls qiime2-compatible-phytoref-files/` as I mentioned but rather you typed `ll -h` while you were in the `qiime2-compatible-phytoref-files` directory itself.  
Anyways, I believe the issue is as before, you are just not providing the right path to the file.

If you are running your command from the `qiime2-compatible-phytoref-files`directory in which you pasted the ls output from above, then you don't need to include the `qiime2-compatible-phytoref-files/` part because you are already in that directory.  
So, just remove that and you should be ok.

In other words just:

```bash
qiime feature-classifier extract-reads \
--i-sequences Phyto_16S_plastid_qiime2.qza \
--p-f-primer GTGCCAGCMGCCGCGGTAA \
--p-r-primer GGACTACHVGGGTWTCTAAT \
--o-reads reference-seqs-phytoref.qza \
--verbose

```

Should do.

Alternative you can just write the full absolute path from root `/` and then you'll always point to the right location regardless of which directory you're in.

---

<div class="post-metadata">

### Author: ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)
#### Post date: [October 8, 2020, 8:35am UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/8 "2020-10-08T08:35:53Z")

</div>



---

<div class="post-metadata">

### Author: ![uth](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/u/c57346/32.png) [@uth](https://forum.qiime2.org/u/uth)
#### Post date: [October 28, 2020, 4:18am UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/9 "2020-10-28T04:18:20Z")

</div>

Hi @Mehrbod_Estaki,

I'm extremely sorry for the late reply. I couldn't get anything to work so I went ahead with a classifier I trained with the same files a long time ago without extracting reads.

I have copy pasted the error again. I ran the codes with and without specifying paths (by changing the directory). please see below

**ls qiime2-compatible-phytoref-files/**  
Phyto\_16S\_plastid\_qiime2.qza Phyto\_16S\_plastid\_taxonomy.qza

**uth@nightowl:~/Uthpala/classifier-files$**  
**qiime feature-classifier extract-reads --i-sequences qiime2-compatible-phytoref-files/Phyto\_16S\_plastid\_qiime2.qza --p-f-primer GTGCCAGCMGCCGCGGTAA --p-r-primer GGACTACHVGGGTWTCTAAT --o-reads reference-seqs-phytoref.qza --verbose**  
Usage: qiime feature-classifier extract-reads [OPTIONS]

Extract sequencing-like reads from a reference database.

Inputs:  
--i-sequences ARTIFACT FeatureData[Sequence]  
[required]  
Parameters:  
--p-f-primer TEXT forward primer sequence [required]  
--p-r-primer TEXT reverse primer sequence [required]  
--p-trunc-len INTEGER read is cut to trunc-len if trunc-len is positive.  
Applied before trim-left. [default: 0]  
--p-trim-left INTEGER trim-left nucleotides are removed from the 5' end  
if trim-left is positive. Applied after trunc-len.  
[default: 0]  
--p-identity NUMBER minimum combined primer match identity threshold.  
[default: 0.8]  
--p-min-length INTEGER Minimum amplicon length. Shorter amplicons are  
Range(0, None) discarded. Applied after trimming and truncation, so  
be aware that trimming may impact sequence  
retention. Set to zero to disable min length  
filtering. [default: 50]  
--p-max-length INTEGER Maximum amplicon length. Longer amplicons are  
Range(0, None) discarded. Applied before trimming and truncation,  
so plan accordingly. Set to zero (default) to  
disable max length filtering. [default: 0]  
--p-n-jobs INTEGER Number of seperate processes to run.  
Range(1, None) [default: 1]  
--p-batch-size VALUE Int % Range(1, None) | Str % Choices('auto')  
Number of sequences to process in a batch. The  
`auto` option is calculated from the number of  
sequences and number of jobs specified.  
[default: 'auto']  
Outputs:  
--o-reads ARTIFACT FeatureData[Sequence]  
[required]  
Miscellaneous:  
--output-dir PATH Output unspecified results to a directory  
--verbose / --quiet Display verbose output to stdout and/or stderr  
during execution of this action. Or silence output  
if execution is successful (silence is golden).  
--citations Show citations and exit.  
--help Show this message and exit.

```
                There was a problem with the command:                     

```

(1/1) Invalid value for "--i-sequences": 'qiime2-compatible-phytoref-  
files/Phyto\_16S\_plastid\_qiime2.qza' is not a QIIME 2 Artifact (.qza)

**uth@nightowl:~/Uthpala/classifier-files/qiime2-compatible-phytoref-files$**  
\*_qiime feature-classifier extract-reads \*_  
\*_\> --i-sequences Phyto\_16S\_plastid\_qiime2.qza \*_  
\*_\> --p-f-primer GTGCCAGCMGCCGCGGTAA \*_  
\*_\> --p-r-primer GGACTACHVGGGTWTCTAAT \*_  
\*_\> --o-reads reference-seqs-phytoref.qza \*_  
**\> --verbose**  
Usage: qiime feature-classifier extract-reads [OPTIONS]

Extract sequencing-like reads from a reference database.

Inputs:  
--i-sequences ARTIFACT FeatureData[Sequence]  
[required]  
Parameters:  
--p-f-primer TEXT forward primer sequence [required]  
--p-r-primer TEXT reverse primer sequence [required]  
--p-trunc-len INTEGER read is cut to trunc-len if trunc-len is positive.  
Applied before trim-left. [default: 0]  
--p-trim-left INTEGER trim-left nucleotides are removed from the 5' end  
if trim-left is positive. Applied after trunc-len.  
[default: 0]  
--p-identity NUMBER minimum combined primer match identity threshold.  
[default: 0.8]  
--p-min-length INTEGER Minimum amplicon length. Shorter amplicons are  
Range(0, None) discarded. Applied after trimming and truncation, so  
be aware that trimming may impact sequence  
retention. Set to zero to disable min length  
filtering. [default: 50]  
--p-max-length INTEGER Maximum amplicon length. Longer amplicons are  
Range(0, None) discarded. Applied before trimming and truncation,  
so plan accordingly. Set to zero (default) to  
disable max length filtering. [default: 0]  
--p-n-jobs INTEGER Number of seperate processes to run.  
Range(1, None) [default: 1]  
--p-batch-size VALUE Int % Range(1, None) | Str % Choices('auto')  
Number of sequences to process in a batch. The  
`auto` option is calculated from the number of  
sequences and number of jobs specified.  
[default: 'auto']  
Outputs:  
--o-reads ARTIFACT FeatureData[Sequence]  
[required]  
Miscellaneous:  
--output-dir PATH Output unspecified results to a directory  
--verbose / --quiet Display verbose output to stdout and/or stderr  
during execution of this action. Or silence output  
if execution is successful (silence is golden).  
--citations Show citations and exit.  
--help Show this message and exit.

```
                There was a problem with the command:                     

```

(1/1) Invalid value for "--i-sequences": 'Phyto\_16S\_plastid\_qiime2.qza' is  
not a QIIME 2 Artifact (.qza)

Many thanks!  
Uthpala

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [October 28, 2020, 2:22pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/11 "2020-10-28T14:22:10Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [October 28, 2020, 11:55pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/13 "2020-10-28T23:55:18Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [October 28, 2020, 11:55pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/14 "2020-10-28T23:55:21Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [October 29, 2020, 2:35pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/16 "2020-10-29T14:35:50Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [October 29, 2020, 2:35pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/17 "2020-10-29T14:35:55Z")

</div>



---

<div class="post-metadata">

### Author: ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)
#### Post date: [October 29, 2020, 8:11pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/18 "2020-10-29T20:11:08Z")

</div>

Hi @uth,

This is a bit odd because I'm able to run this command with no problems using the latest Q2-2020.8 version when I download that file from the github page.

You are using a rather old version of Qiime2 (qiime2-2019.10 if I'm not mistaken) and it's possible that just updating to the newest version will resolve the issue, which is something that actually was fixed in later versions according to @thermokarst . If that doesn't resolve it could you also run `qiime tools validate Phyto_16S_plastid_qiime2.qza` and report the outcome, make sure you're providing the correct path to this file too of course in your command.

---

<div class="post-metadata">

### Author: ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)
#### Post date: [October 29, 2020, 8:11pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/19 "2020-10-29T20:11:12Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 13, 2020, 5:30pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/20 "2020-11-13T17:30:10Z")

</div>

A post was split to a new topic: [Error: no such option: --p-min-length](https://forum.qiime2.org/t/error-no-such-option-p-min-length/17444)

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 16, 2020, 6:25pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/21 "2020-11-16T18:25:39Z")

</div>

A post was merged into an existing topic: [Error: no such option: --p-min-length](https://forum.qiime2.org/t/error-no-such-option-p-min-length/17444/5)

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 16, 2020, 6:26pm UTC](https://forum.qiime2.org/t/error-feature-classifier-extract-reference-reads/16748/22 "2020-11-16T18:26:18Z")

</div>


