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 in parsing #3

Closed
tnn111 opened this issue Jul 16, 2019 · 10 comments
Closed

Error in parsing #3

tnn111 opened this issue Jul 16, 2019 · 10 comments

Comments

@tnn111
Copy link

tnn111 commented Jul 16, 2019

I get the following errors:

Parsing assembly_graph_with_scaffolds.gfa...
Finish parsing.
Extracting edge sequences from assembly_graph_with_scaffolds.gfa...
No information about contig mappings to the reference genome
No information about edge mappings to the reference genome
Building JSON files...
Traceback (most recent call last):
File "/global/homes/t/torben/opt/anaconda3/envs/AGB/bin/agb.py", line 153, in
main()
File "/global/homes/t/torben/opt/anaconda3/envs/AGB/bin/agb.py", line 145, in main
with open(TEMPLATE_PATH) as f: html = f.read()
File "/global/homes/t/torben/opt/anaconda3/envs/AGB/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6389: ordinal not in range(128)

The command was

agb.py --graph assembly_graph_with_scaffolds.gfa -a spades

I installed everything exactly as in the instructions.

Any ideas?

almiheenko added a commit that referenced this issue Jul 23, 2019
@almiheenko
Copy link
Owner

Hi,

I couldn't reproduce this issue but added a workaround that should fix any encoding errors. Please let me know if you still have this problem. Thank you!

Best regards,
Alla

@asafpr
Copy link

asafpr commented Oct 22, 2019

I had the same issue. The solution that worked for me is to change all read/write to bytes instead of strings and then encoding/decoding. i.e. open(file, 'rb')

@TomHarrop
Copy link

I'm having the same issue with 9c1b39c. I've also tried export PYTHONIOENCODING=utf8 but it didn't help.

Extracting edge sequences from output/030_flye/denovo_full/assembly_graph.gfa...
No information about contig mappings to the reference genome
No information about edge mappings to the reference genome
Building JSON files...
Traceback (most recent call last):
  File "/usr/local/bin/agb.py", line 154, in <module>
    main()
  File "/usr/local/bin/agb.py", line 147, in main
    html = embed_css_and_scripts(html)
  File "/usr/local/lib/python3.6/dist-packages/agb_src/scripts/utils.py", line 221, in embed_css_and_scripts
    with open(fpath) as f: contents = f.read()
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3300: ordinal not in range(128)

almiheenko added a commit that referenced this issue Dec 4, 2019
@almiheenko
Copy link
Owner

Hi Tom,
I've committed an additional fix for this issue and updated a conda package. Please let me know if you have any issues.

Thanks
Alla

@bestweicheng
Copy link

I have the same problem (download yesterday )

@TomHarrop
Copy link

Hi @almiheenko , thanks for the reply.

That doesn't fix it. Here's the error I get in a41ac9e:

Extracting edge sequences from output/030_flye/denovo_full/assembly_graph.gfa...
No information about contig mappings to the reference genome
No information about edge mappings to the reference genome
Building JSON files...
Traceback (most recent call last):
  File "/usr/local/bin/agb.py", line 154, in <module>
    main()
  File "/usr/local/bin/agb.py", line 147, in main
    html = embed_css_and_scripts(html)
  File "/usr/local/lib/python3.6/dist-packages/agb_src/scripts/utils.py", line 221, in embed_css_and_scripts
    with os.io.open(fpath, 'r', encoding="utf-8") as f: contents = f.read()
AttributeError: module 'os' has no attribute 'io'

Is it a mistake here?

with os.io.open(fpath, 'r', encoding="utf-8") as f: contents = f.read()

kbseah added a commit to kbseah/AGB that referenced this issue May 5, 2020
 * fix typo for `io.open`
 * write HTML output as UTF-8 because template read as UTF-8
almiheenko added a commit that referenced this issue May 5, 2020
Fix encoding error (issues #3 and #8)
@almiheenko
Copy link
Owner

This issue should be fixed by now, thanks to @kbseah.
Conda package is updated.

Please feel free to re-open if you still have any issues

@pbravakos
Copy link

Hi,
I tried to run the program today and got the following error:

Parsing assembly_graph_with_scaffolds.gfa...
Finish parsing.
Extracting edge sequences from assembly_graph_with_scaffolds.gfa...
No information about contig mappings to the reference genome
No information about edge mappings to the reference genome
Building JSON files...
Traceback (most recent call last):
  File "/home1/pbravakos/Software/miniconda3/envs/AGB/bin/agb.py", line 154, in <module>
    main()
  File "/home1/pbravakos/Software/miniconda3/envs/AGB/bin/agb.py", line 147, in main
    html = embed_css_and_scripts(html)
  File "/home1/pbravakos/Software/miniconda3/envs/AGB/lib/python3.6/site-packages/agb_src/scripts/utils.py", line 221, in embed_css_and_scripts
    with os.io.open(fpath, 'r', encoding="utf-8") as f: contents = f.read()
AttributeError: module 'os' has no attribute 'io'

@Dmitry-Antipov
Copy link

Messy workaround for this problem - install AGB from conda, activate environment as described in manual but run not conda's version but an AGB instance just cloned from github.

@hiroshisuga
Copy link

Manually removing "os.io." from that line worked for me.

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

8 participants