Error ' ' expected after ' " '

Hello,

I am trying to import a manifest file but keep getting an error.

Here is what I am running:

qiime2) dh103@8BFS8B3-LINUX:~$ qiime tools import --type 'SampleData[SequencesWithQuality]' --input-path /home/dh103/Documents/Greta/Cleandata_Manifest2.0.csv --output-path CleanData_demux.qza --input-format SingleEndFastqManifestPhred33V2

and this is the error i am receiving:

Traceback (most recent call last):
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/q2cli/builtin/tools.py", line 157, in import_data
artifact = qiime2.sdk.Artifact.import_data(type, input_path,
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/sdk/result.py", line 277, in import_data
return cls.from_view(type, view, view_type, provenance_capture,
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/sdk/result.py", line 305, in _from_view
result = transformation(view, validate_level)
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/core/transform.py", line 68, in transformation
self.validate(view, level=validate_level)
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/core/transform.py", line 143, in validate
view.validate(level)
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/plugin/model/file_format.py", line 26, in validate
self.validate(level)
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/q2_types/per_sample_sequences/_format.py", line 40, in validate
md = qiime2.Metadata.load(str(self))
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/metadata/metadata.py", line 357, in load
return MetadataReader(filepath).read(into=cls,
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/metadata/io.py", line 71, in read
header = self._read_header()
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/metadata/io.py", line 130, in _read_header
for row in self._reader:
File "/home/dh103/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/metadata/io.py", line 69, in
self._reader = (self._strip_cell_whitespace(row)
_csv.Error: ' ' expected after '"'

An unexpected error has occurred:

' ' expected after '"'

See above for debug info.

I believe qiime2 wants a tab after " but I have not used " when creating my manifest file so I am unsure how to fix this error.

Welcome to the forums!

Would you be willing to post your manifest file so we can take a look at formatting? There's lots of things that can cause ambiguous formatting errors so it's easiest to take a look. :eyes:

1 Like

Yes! Thank you!

Cleandata_Manifest2.0.csv (7.2 KB)

I compared your file to the example in the docs and noticed two things:

  • Your first column is named "id" instead of "sample-id" (not sure that matters)
  • NS0043fastq.gz is named unlike the other files. Should that be NS043.fastq.gz?

Here's the example from the docs you can copy:

# single-end PHRED 33 fastq manifest file for forward reads
sample-id absolute-filepath
sample.1 $PWD/se-33/sample1.fastq.gz
sample2 $PWD/se-33/sample2_S1_L001_R1_001.fastq.gz

Thank you. I changed id to sample-id and fixed NS0043fastq.gz to NS043.fastq.gz but I am still getting the same error.

could the tab it is expecting after the " have to do with saving the file?

Oh! I missed an obvious difference!

That .csv file is comma separated. The manifest should be tab separated!

Look, no commas :point_down:
image

Save that file as a tab separated .tsv file, then try importing again.

here is my new tsv file
Cleandata_manifest4.0 - Sheet1.tsv (7.2 KB)

here is what i have run:

:~$ qiime tools import\

--type 'SampleData[SequencesWithQuality]'
--input-path '/home/dh103/Documents/Greta/Cleandata_manifest4.0 - Sheet1.tsv'
--output-path CleanData_demux.qza
--input-format SingleEndFastqManifestPhred33V2

and this is the new error i am getting

There was a problem importing /home/dh103/Documents/Greta/Cleandata_manifest4.0 - Sheet1.tsv:

/home/dh103/Documents/Greta/Cleandata_manifest4.0 - Sheet1.tsv is not a(n) SingleEndFastqManifestPhred33V2 file:

Filepath on line 1 and column "absolute-filepath" could not be found ($PWD/home/dh103/Desktop/QRF/CleanData/NS001/NS001.fastq.gz) for sample "NS001".

Do I need to be in a working directory to use $PWD in the manifest to be successful?

Hey @StasulliLab,

It looks like you have absolute filepaths (like /home/dh103/Desktop/QRF/CleanData/NS001/NS001.fastq.gz). So you don't want to use $PWD or any other shell variables, as those will be tacked onto the filepath. So what your current error is saying is:

Filepath on line 1 and column "absolute-filepath" could not be found ($PWD/home/dh103/Desktop/QRF/CleanData/NS001/NS001.fastq.gz) for sample "NS001"

$PWD -> /home/dh103/wherever/you/happen/to/be
which means that the final path looks like:
/home/dh103/wherever/you/happen/to/be/home/dh103/Desktop/QRF/CleanData/NS001/NS001.fastq.gz
which won't exist.

So I think if you get rid of the $PWD you'll be on the right track given your data.

3 Likes

Thank you so much! It worked!!

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