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

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 ?

Hello!

So you did it for all your samples?

My guess is that the plugin expects here

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

Best,

@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.

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 for the example.

UPDATE
Thanks to @Nicholas_Bokulich there is an correction:

Should be:

SampleData[Sequence]

Best,

1 Like

@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

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

Any suggestion to fix the issue ?

Thanks

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.

1 Like

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.

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,

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?

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:

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

2 Likes

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

Hi Meriem,

Thank you for clarification!

Nope, Qiime2 accepts fastq files for processing.

For example, this one 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,

1 Like

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

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,

3 Likes