# Qiime 2 issue ! Semantic type SampleData\[Sequences\] is invalid

**URL:** <https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038>\
**Category:** User Support\
**Created:** [April 22, 2025, 8:19am UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038 "2025-04-22T08:19:57Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)\
**Post date:** [April 22, 2025, 8:19am UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/1 "2025-04-22T08:19:57Z")

</div>

HELLO,

I merged R1 and R2 of FASTQ FILES and i converted those files to FNA files using the following command line :  
sed -n '1~4s/^@/\>/p;2~4p' INFILE.fastq \> OUTFILE.fasta  
I imported data into a QIIME2 artifact using the following command line :  
qiime tools import   
--input-path seqs.fna   
--output-path seqs.qza   
--type 'SampleData[Sequences]'  
File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/q2cli/builtin/tools.py", line 852, in _import  
artifact = qiime2.sdk.Artifact.import\_data(  
File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/qiime2/sdk/result.py", line 315, in import\_data  
output\_dir\_fmt = pm.get\_directory\_format(type_)  
File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/qiime2/sdk/plugin\_manager.py", line 388, in get\_directory\_format

An unexpected error has occurred:

Semantic type SampleData[Sequences] is invalid, either because it doesn't have a compatible directory format, or because it's not registered.

See above for debug info.

How can i fix this issue ?

---

<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:** [April 22, 2025, 8:31am UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/2 "2025-04-22T08:31:20Z")

</div>

Hello!

> [@M\_F](#):
>
> I merged R1 and R2 of FASTQ FILES and i converted those files to FNA files using the following command line :  
> sed -n '1~4s/^@/\>/p;2~4p' INFILE.fastq \> OUTFILE.fasta

So you did it for all your samples?

> [@M\_F](#):
>
> Semantic type SampleData[Sequences] is invalid, either because it doesn't have a compatible directory format, or because it's not registered.

My guess is that the plugin expects here

> [@M\_F](#):
>
> --input-path seqs.fna

a path to the directory with fasta files that you got for your samples.

Best,

---

<div class="post-metadata">

**Author:** ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)\
**Post date:** [April 22, 2025, 11:16am UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/3 "2025-04-22T11:16:37Z")

</div>

@timanix  
The path to the directory with fasta files is correct , i merged and converted fastq files for all samples as i previously mentioned.

Can you indicate how to fix the issue ?

File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/q2cli/builtin/tools.py", line 852, in _import  
artifact = qiime2.sdk.Artifact.import\_data(  
File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/qiime2/sdk/result.py", line 315, in import\_data  
output\_dir\_fmt = pm.get\_directory\_format(type_)  
File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/qiime2/sdk/plugin\_manager.py", line 388, in get\_directory\_format

An unexpected error has occurred:

Semantic type SampleData[Sequences] is invalid, either because it doesn't have a compatible directory format, or because it's not registered.

---

<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:** [April 22, 2025, 11:25am UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/4 "2025-04-22T11:25:33Z")

</div>

> [@M\_F](#):
>
> The path to the directory with fasta files is correct , i merged and converted fastq files for all samples as i previously mentioned.

Did you merge all samples to one fasta file you are referring to in the command?  
Still, the directory format requires a **directory with fasta files** as input (one for each sample) instead of the full path to the fasta file.

`--input-path path_to_directory_with_fasta_files`

If you need to import only one fasta file, as, for example, representative sequences, then check the [importing tutorial](https://docs.qiime2.org/2024.10/tutorials/importing/#sequences-without-quality-information-i-e-fasta) for the example.

UPDATE  
Thanks to @Nicholas_Bokulich there is an correction:

> [@M\_F](#):
>
> SampleData[Sequences]

Should be:

`SampleData[Sequence]`

Best,

---

<div class="post-metadata">

**Author:** ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)\
**Post date:** [April 22, 2025, 3:57pm UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/6 "2025-04-22T15:57:47Z")

</div>

@timanix

The issue is still not fixed.

I did the check of The path in every command and it is correct  
when i started the analysis,

1. i merged R1 and R2 reads of fastq files of each sample together  
`cat Sample1_R1.fastq Sample1_R2.fastq > merged_Sample1.fastq`
2. i created fna file for each sample by converting fastq file  
`sed -n '1~4s/^@/>/p;2~4p' merged_Sample1.fastq > Sample1.fna`
3. i used the following command line

> [@M\_F](#):
>
> qiime tools import  
> --input-path Sample1.fna  
> --output-path Sample1.qza  
> --type 'SampleData[Sequences]'

Even by replacing 'SampleData[Sequences]' by SampleData[Sequence] the problem is still not fixed.

Any suggestion to fix the issue ?

Thanks

---

<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:** [April 22, 2025, 4:15pm UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/7 "2025-04-22T16:15:47Z")

</div>

Hi again

As I already wrote, the input path should lead to the **directory** , in which you store fasta files, **not the file itself**.  
Put all your fasta files into **one folder** and indicate the path to **that folder** (not fasta file!) and try again.  
It will import all fastas (samples) that are stored in that folder.

---

<div class="post-metadata">

**Author:** ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)\
**Post date:** [April 22, 2025, 4:32pm UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/9 "2025-04-22T16:32:44Z")

</div>

Hi @timanix  
I put all fna files into one folder and i indicated the path to that folder.

The issue is still not fixed  
Traceback (most recent call last):  
File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/q2cli/builtin/tools.py", line 852, in _import  
artifact = qiime2.sdk.Artifact.import\_data(  
File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/qiime2/sdk/result.py", line 315, in import\_data  
output\_dir\_fmt = pm.get\_directory\_format(type_)  
File "/opt/anaconda/envs/qiime2/lib/python3.10/site-packages/qiime2/sdk/plugin\_manager.py", line 388, in get\_directory\_format  
raise TypeError(  
TypeError: Semantic type SampleData[Sequence] is invalid, either because it doesn't have a compatible directory format, or because it's not registered.

An unexpected error has occurred:

Semantic type SampleData[Sequence] is invalid, either because it doesn't have a compatible directory format, or because it's not registered.

See above for debug info.

---

<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:** [April 22, 2025, 5:35pm UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/10 "2025-04-22T17:35:38Z")

</div>

Could you share with me the screenshot of the command you are running in the terminal, including the error message, also the screenshot of the content of the directory with fasta files. Could you also send me couple of fasta files via personal message? Let me know if you can't send me a message - this functionality was restricted due to recent spam wave.

Best,

---

<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:** [April 23, 2025, 7:51am UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/15 "2025-04-23T07:51:43Z")

</div>

Hi Meriem

It appears that the type SampleData[Sequences] cannot be used for your data.  
Could you share with us the initial purpose of your manipulations?

> [@M\_F](#):
>
> I merged R1 and R2 of FASTQ FILES and i converted those files to FNA files using the following command line :  
> sed -n '1~4s/^@/\>/p;2~4p' INFILE.fastq \> OUTFILE.fasta

What is the goal of performing this step?

If your goal is to import such sequences as representative sequences, then you need to follow this tutorial for each sample:

> [@timanix](#):
>
> If you need to import only one fasta file, as, for example, representative sequences, then check the [importing tutorial](https://docs.qiime2.org/2024.10/tutorials/importing/#sequences-without-quality-information-i-e-fasta) for the example.

Note, that in this case, you should indicate the path to each fasta file as you intially did, but provide anothe type `FeatureData[Sequence]`

If your goal is to use your samples for creating ASV / OTU tables, then you should import fastq files, not fasta files.

Do you have any specific reason for converting fastq files to fasta?

Best,  
Timur

---

<div class="post-metadata">

**Author:** ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)\
**Post date:** [April 24, 2025, 6:21am UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/16 "2025-04-24T06:21:15Z")

</div>

Hi @timanix ,  
I merged R1 and R2 of FASTQ FILES and i converted those files to FNA files using the following command line :  
sed -n '1~4s/^@/\>/p;2~4p' INFILE.fastq \> OUTFILE.fasta  
The goal of performing this step is to convert FASTQ files to FNA files that can be processed by QIIME2.  
I thought that there is no tutorial provided by QIIME2 to process directly FASTQ files and to convert them to qza files.  
Could you share the tutorial that enables me to process directly FASTQ files ?  
I will create OTU tables, PCA, Heatmaps, PCO plots....

Thanks

---

<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:** [April 24, 2025, 6:52am UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/18 "2025-04-24T06:52:42Z")

</div>

Hi Meriem,

Thank you for clarification!

> [@M\_F](#):
>
> The goal of performing this step is to convert FASTQ files to FNA files that can be processed by QIIME2.

Nope, Qiime2 accepts fastq files for processing.

> [@M\_F](#):
>
> Could you share the tutorial that enables me to process directly FASTQ files ?

For example, [this one](https://docs.qiime2.org/2024.10/tutorials/moving-pictures/) is good. But after importing and before denoising with dada2, I would add cutadapt to remove primers.

Check out importing tutorial (I shared it already in previous posts), there are a lot of options to import fastq files.

Best,

---

<div class="post-metadata">

**Author:** ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)\
**Post date:** [April 24, 2025, 12:42pm UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/19 "2025-04-24T12:42:49Z")

</div>

Hi @timanix ,

Thanks for the reply.

The FASTQ files are already demultiplexed , barcodes and primers are also trimmed.

I need just a tutorial to convert merged paired end (R1+R2) FASTQ files to qza files that could be processed by QIIME2.

Please share this tutorial or the command line.

Thanks

---

<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:** [April 24, 2025, 12:56pm UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/20 "2025-04-24T12:56:46Z")

</div>

Both tutorials i shared (importing and moving pictures) are for the data you are dealing with.  
First check importing tutorial how to import demultiplexed reads that you have.  
Then go to the Moving pictures tutorial and start from the commands after demultiplexing.  
Please ensure that you read the tutorials first before asking any additional questions.

Best,

---

<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:** [May 25, 2025, 7:01pm UTC](https://forum.qiime2.org/t/qiime-2-issue-semantic-type-sampledata-sequences-is-invalid/33038/22 "2025-05-25T19:01:11Z")

</div>

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