Error in metadatafile

Hello All
I am trying to calculate diversity
and while given medata file I am getting an error
etadata file must be encoded as UTF-8 or ASCII. The following error occurred when decoding the file:

'utf-8' codec can't decode byte 0xa8 in position 10: invalid start byte

There may be more errors present in the metadata file. To get a full report, sample/feature metadata files can be validated with Keemei: https://keemei.qiime2.org

Find details on QIIME 2 metadata requirements here: Metadata in QIIME 2 — QIIME 2 2019.10.0 documentation
Please suggest Narwani_metadata.tsv (123 Bytes) S1Metadata.tsv (123 Bytes) S2.Metadata.tsv (123 Bytes)
I am attach all the three files.
Thanks in advance

Hello @divyaprince321,
first, I suggest that google sheets plugin keemei. I would suggest getting your metadata uploaded to google sheets and using that plugin because it might easily tell you the error. And then you would be good to go. :qiime2:

If that fails and you still can't find the solution. I'd love to get more information on this because I am little confused. Could you include the command you ran to get that error. Currently I am unsure which of the 3 metadata files you are using.

I hope this helps !
Chloe :turtle:

Hi Cherman2
Thank You for response
I am not aware of google sheet plugin keemi.
I ran the following command
qiime diversity core-metrics-phylogenetic --i-phylogeny phylogeny/S1_fast.tree.qza --m-metadata-file metadataS1.qzv --i-table S1_final/clustered_table_cr-97.qza --p-sampling-depth 1 --output-dir S1_core_1
More the three files are different and I need to generate the metadata fie for all these files.
hope you understand
thanks

Hi @divyaprince321
The original error message is indicating that your metadata file contains invalid characters that QIIME 2 cannot read. This is often caused by creating metadata files in excel, copying and pasting from websites, or sometimes from special characters that are not unicode compatible. The error message is telling you exactly what the character is and its position in the file.
I will re-iterate my advice from above: give keemei a try, it will detect and report all the errors with your metadata file in one go, so can be a time saver.
Good luck!
Chloe :turtle:

2 Likes

Thanks Chloe
I am done with google sheet plugin Keemei, after preparing it when I validated through Keemei and qiime2 it gave a cheering message showing metadata file validated.
However again after running the command It gave the error.
qiime diversity core-metrics-phylogenetic --i-phylogeny phylogeny/S1_fast.tree.qza --m-metadata-file metadataS1.qzv --i-table S1_final/clustered_table_cr-97.qza --p-sampling-depth 1 --output-dir S1_core_1
There was an issue with loading the file metadataS1.qzv as metadata:

Metadata file must be encoded as UTF-8 or ASCII. The following error occurred when decoding the file:

‘utf-8’ codec can’t decode byte 0xd6 in position 10: invalid continuation byte

There may be more errors present in the metadata file. To get a full report, sample/feature metadata files can be validated with Keemei: https://keemei.qiime2.org

Find details on QIIME 2 metadata requirements here: https://docs.qiime2.org/2019.10/tutorials/metadata/
To my little knowledge the error is in sequence file some where, because prior to this command I ran the biom summarize command to set up the sampling depth in this command
it gave the same error
biom summarize-table -i S1_final/clustered_table_cr-97.qza
Traceback (most recent call last):
File “/home/qiime2/miniconda/envs/qiime2-2019.10/bin/biom”, line 11, in
sys.exit(cli())
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/site-packages/biom/cli/table_summarizer.py”, line 48, in summarize_table
table = load_table(input_fp)
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/site-packages/biom/parse.py”, line 660, in load_table
table = parse_biom_table(fp)
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/site-packages/biom/parse.py”, line 403, in parse_biom_table
c = fp.read(1)
File “/home/qiime2/miniconda/envs/qiime2-2019.10/lib/python3.6/codecs.py”, line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xfd in position 14: invalid start byte
Please suggest and if you want I will send my files personally.
thank you

This seems to be the issue. You need to use your metadata.tsv not the metadata.qzv (A visualization).
Hope this helps!
Chloe :turtle:

A post was split to a new topic: how to root a phylogeny?

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