Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unicode Decode Error #295

Closed
yb520abab opened this issue May 21, 2024 · 2 comments · Fixed by #296
Closed

Error: Unicode Decode Error #295

yb520abab opened this issue May 21, 2024 · 2 comments · Fixed by #296

Comments

@yb520abab
Copy link

Hi,

Thank you for providing such a great tool! I encountered a "Unicode Decode Error: 'ascii' codec can't decode byte 0xe2 in position 1103: ordinal not in range(128)". I converted all my gene symbols into gene IDs, and I converted them into UTF-8 format. The format of gene IDs look right to me. The error asked me to trace back to the file "find_enrichment.py" but I don't have the access to edit the script or other scripts. Did anyone else also encounter the similar problem? Many thanks!

@tanghaibao
Copy link
Owner

@yb520abab

Would you mind pasting the traceback message here? The error says that you have non-standard character 'â' in the file.
It may be that find_enrichment.py isn't reading the file with utf-8. The other solution is to identify the character 'â' and replace it with something else.

@yb520abab
Copy link
Author

@tanghaibao
Hi, I checked my files and there isn't any non-standard character 'â' in the files. Here's the traceback message: Traceback (most recent call last):
File "scripts/find_enrichment.py", line 44, in
main()
File "scripts/find_enrichment.py", line 31, in main
obj = GoeaCliFnc(GoeaCliArgs().args)
File "/u/home/y/yebi24/.conda/envs/be298/lib/python3.6/site-packages/goatools/cli/find_enrichment.py", line 232, in init
_study, _pop = self.rd_files(*self.args.filenames[:2])
File "/u/home/y/yebi24/.conda/envs/be298/lib/python3.6/site-packages/goatools/cli/find_enrichment.py", line 416, in rd_files
study, pop = self._read_geneset(study_fn, pop_fn)
File "/u/home/y/yebi24/.conda/envs/be298/lib/python3.6/site-packages/goatools/cli/find_enrichment.py", line 424, in read_geneset
study = frozenset(
.strip() for _ in open(study_fn) if .strip())
File "/u/home/y/yebi24/.conda/envs/be298/lib/python3.6/site-packages/goatools/cli/find_enrichment.py", line 424, in
study = frozenset(
.strip() for _ in open(study_fn) if _.strip())
File "/u/home/y/yebi24/.conda/envs/be298/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants