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

UnicodeEncodeError: 'ascii' codec can't encode characters #464

Open
sitahoo opened this issue Jan 10, 2025 · 1 comment
Open

UnicodeEncodeError: 'ascii' codec can't encode characters #464

sitahoo opened this issue Jan 10, 2025 · 1 comment

Comments

@sitahoo
Copy link

sitahoo commented Jan 10, 2025

Hi, when i run rMATs 4.2.0 ,i got this error message:
Traceback (most recent call last):
File "/share/work/biosoft/conda/miniconda3/envs/rmats/bin/rmats.py", line 596, in
main()
File "/share/work/biosoft/conda/miniconda3/envs/rmats/bin/rmats.py", line 564, in main
run_pipe(args)
File "rmatspipeline/rmatspipeline.pyx", line 3865, in rmats.rmatspipeline.run_pipe
File "", line 15, in string.from_py.__pyx_convert_string_from_py_std__in_string
UnicodeEncodeError: 'ascii' codec can't encode characters in position 85-89: ordinal not in range(128)

I wander why this error occurs and how to solve it?
thanks,
Hu

@EricKutschera
Copy link
Contributor

This is the line for the error:
https://github.com/Xinglab/rmats-turbo/blob/v4.2.0/rMATS_pipeline/rmatspipeline/rmatspipeline.pyx#L3865

It's calling a compiled function and one of the arguments is the bam file names. My guess is that one of your bam file names or one of the directory names in the path of a bam file includes a unicode character. The compiled code can only handle ascii characters: https://github.com/Xinglab/rmats-turbo/blob/v4.2.0/rMATS_pipeline/rmatspipeline/rmatspipeline.pyx#L9

I was able to get a similar error message by using a bam file with Æ in the name. I think you can avoid this issue by renaming your input files to use only ascii characters. Alternatively, it may be possible to recompile the code yourself with the cython encoding parameters from this post: cython/cython#2819 (comment)

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

No branches or pull requests

2 participants