importing FASTQ file issue

Hi there! I am having issues with importing a bunch of FASTQ files (amplicon sequencing data 16S V4V5) into Qiime2 to creat .qza files. I am working within Compute Canada and using singularity to run the qiime command because Compute Canada doesn't support Anaconda (see this page for Qiime installation on Compute Canada - QIIME - CC Doc). Here is the command I am working with:

singularity exec /home/jlb686/projects/def-aslang/jlb686/amplicon-data/qiime2-2021.11.sif qiime tools import --type casava-18-paired-end-demultiplexed --input-path . --output-path casava-PE-sequences.qza

And this is the output I recieve:

Traceback (most recent call last):
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/q2cli/builtin/", line 157, in import_data
artifact = qiime2.sdk.Artifact.import_data(type, input_path,
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/sdk/", line 240, in import_data
type_ = qiime2.sdk.parse_type(type_)
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/sdk/", line 68, in parse_type
type_expr = _parse.ast_to_type(_parse.string_to_ast(string))
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/core/type/", line 32, in string_to_ast
return _expr(expr.value)
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/core/type/", line 60, in _expr
left = _expr(expr.left)
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/core/type/", line 60, in _expr
left = _expr(expr.left)
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/core/type/", line 60, in _expr
left = _expr(expr.left)
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/core/type/", line 61, in _expr
right = _expr(expr.right)
File "/opt/conda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/core/type/", line 71, in _expr
raise ValueError("Unknown expression: %r" % node)
ValueError: Unknown expression: <class '_ast.Constant'>

An unexpected error has occurred:

Unknown expression: <class '_ast.Constant'>

See above for debug info.

I recieve the same error message whether I run the command in a job script or not. Anyone know any fixes? Thanks!


Fortunately, it looks like the problem is probably not with singularity, so we should be more easily able to help you :smile: I would review the importing data docs and modify your command a bit. You want your --type to be a quoted string of a QIIME 2 semantic type, most likely 'SampleData[PairedEndSequencesWithQuality]', and you need to specify an --input-format. Also, I would actually move one folder up, so that you are not working directly in the folder where your FASTQs are stored, but rather specify it with --input-path.

Hope this helps, let me know if you have any further questions :slightly_smiling_face:


Thanks Keegan! I gave it another go using this command:

singularity exec /home/jlb686/projects/def-aslang/jlb686/amplicon-data/qiime2-2021.11.sif qiime tools import --type SampleData[PairedEndSequencesWithQuality] --input-path rawdata/*001.fastq.gz --output-path PEsequences.qza

but I recieved this error message - which says my filenames do not exist:

Usage: qiime tools import [OPTIONS]

Import data to create a new QIIME 2 Artifact. See
for usage examples and details on the file types and associated semantic
types that can be imported.

--type TEXT The semantic type of the artifact that will be
created upon importing. Use --show-importable-types
to see what importable semantic types are available
in the current deployment. [required]
--input-path PATH Path to file or directory that should be imported.
--output-path ARTIFACT Path where output artifact should be written.
--input-format TEXT The format of the data to be imported. If not
provided, data must be in the format expected by the
semantic type provided via --type.
--show-importable-types Show the semantic types that can be supplied to
--type to import data into an artifact.
Show formats that can be supplied to --input-format
to import data into an artifact.
--help Show this message and exit.

              There were some problems with the command:

(1/2) Invalid value for '--input-path': Path
'rawdata/ATPU02_S326_L001_R1_001.fastq.gz' does not exist.
(2/2) Got unexpected extra arguments

My files are named "Sample_ID"_L001_R1_001.fastq.gz, and it only says some of the files do not exist, there are 20+ other files that seem to not be included in the error message. Do you know what the unexpected extra arguments might be?


--input-path here is looking for directions to the directory(folder) where your data is stored, rather than directions to each individual datafile itself, in your case it looks like you have stored all of your files in the folder titled rawdata, so simply provide that to --input-path.

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