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

a bytes-like object is required, not 'dict' #141

Open
mabh5 opened this issue Nov 23, 2022 · 6 comments
Open

a bytes-like object is required, not 'dict' #141

mabh5 opened this issue Nov 23, 2022 · 6 comments

Comments

@mabh5
Copy link

mabh5 commented Nov 23, 2022

hello,

I am running ragtag scaffold in order to fill in gaps between contigs using a reference genome. everything seems to run fine up until the very end when I get the error:

raise RuntimeError('Failed : %s > %s 2> %s. Check stderr file for details.' % (" ".join(cmd), out, err))

when I look into ragtag.scaffold.err this is what I get:

Traceback (most recent call last):
  File "/home/mh/anaconda3/envs/ragtag/bin/ragtag_agp2fa.py", line 79, in <module>
    main()
  File "/home/mh/anaconda3/envs/ragtag/bin/ragtag_agp2fa.py", line 69, in main
    sys.stdout.write(reverse_complement(fai.fetch(agp_line.comp, agp_line.comp_beg-1, agp_line.comp_end)))
  File "/home/mh/anaconda3/envs/ragtag/lib/python3.6/site-packages/ragtag_utilities/utilities.py", line 48, in reverse_complement
    return seq.translate(complements)[::-1]
TypeError: a bytes-like object is required, not 'dict'

the code I am running is as follows:

ragtag.py scaffold --mm2-params '-x asm10' genomic.fa combined.fasta -u

any idea on how to fix this error?

@2218301020
Copy link

Have you fixed the error? I encountered the same issue.

@mabh5
Copy link
Author

mabh5 commented Apr 7, 2023

I did, but not using RagTag. at this point in the RagTag assembly you should have a .agp file. I used the .agp file with agptools (https://github.com/WarrenLab/agptools) to finish the assembly step that kept failing in this step in RagTag. This is what that looks like:

agptools assemble combined.fasta ragtag.scaffold.agp > corrected_scaffolds.fasta

combined.fasta = the original contig assembly fasta file that you put into RagTag
ragtag.scaffold.agp = the new file that ragtag assembled (this file has all the data on how the contigs fit together)
corrected_scaffolds = the name that you want to name your scaffold assembly.

this worked decently quickly for me and seemed to have given me a good final scaffold assembly!

@Yogesh1-11
Copy link

same error

@hrpelg
Copy link

hrpelg commented Aug 27, 2023

I got same error:

Traceback (most recent call last):
File "/workspace/appscratch/miniconda/ragtag/bin/ragtag_agp2fa.py", line 79, in
main()
File "/workspace/appscratch/miniconda/ragtag/bin/ragtag_agp2fa.py", line 69, in main
sys.stdout.write(reverse_complement(fai.fetch(agp_line.comp, agp_line.comp_beg-1, agp_line.comp_end)))
File "/workspace/appscratch/miniconda/ragtag/lib/python3.6/site-packages/ragtag_utilities/utilities.py", line 48, in reverse_complement
return seq.translate(complements)[::-1]
TypeError: a bytes-like object is required, not 'dict'

@mabh5
Copy link
Author

mabh5 commented Aug 27, 2023

Not sure if RagTag ever found a fix to this issue, but my fix is in this reply: #141 (comment)

@hrpelg
Copy link

hrpelg commented Aug 27, 2023

Thanks, I am going that way but having a hard time installing screed package needed for the agptools :-)

I will sort it using bioconda instead of pip I guess

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

4 participants