malonge / RagTag

Tools for fast and flexible genome assembly scaffolding and improvement

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RagTag patch bug

r-poloni opened this issue · comments

Hi, I am using RagTag to to scaffold (with scaffold command) and then fill the gaps in a PacBio genome I have, using as a reference another PacBio genome, chromosome-scale. However, the program stucks almost immediatly. It seems a problem of python asking for strings but receiving binary files from the last command, but seems something that cannot be fixed with a quick look.
Thank you in advance!

This is the output I get from slurm (.err file afterwords)

Thu Mar 2 10:13:50 2023 --- VERSION: RagTag v2.1.0
Thu Mar 2 10:13:50 2023 --- WARNING: This is a beta version of ragtag patch
Thu Mar 2 10:13:50 2023 --- CMD: ragtag.py patch -u hifiasm_0.16.1_Eg_no_HiC.bp.p_ctg.gfa_newscaffolds.fa purged.fa
Thu Mar 2 10:13:50 2023 --- INFO: Running: ragtag_splitasm.py -o /ragtag/patch/ragtag_output/ragtag.patch.ctg.agp /ragtag/patch/hifiasm_0.16.1_Eg_no_HiC.bp.p_ctg.gfa_newscaffolds.fa > /ragtag/patch/ragtag_output/ragtag.patch.ctg.fasta 2> /ragtag/patch/ragtag_output/ragtag.patch.err
Traceback (most recent call last):
File "/ragtag_2.1.0/bin/ragtag_patch.py", line 518, in
main()
File "/ragtag_2.1.0/bin/ragtag_patch.py", line 318, in main
run_oae(cmd, reference_ctg_fn, ragtag_log)
File "/ragtag_2.1.0/lib/python3.6/site-packages/ragtag_utilities/utilities.py", line 126, in run_oae
raise RuntimeError('Failed : %s > %s 2> %s. Check stderr file for details.' % (" ".join(cmd), out, err))
RuntimeError: Failed : ragtag_splitasm.py -o /ragtag/patch/ragtag_output/ragtag.patch.ctg.agp /ragtag/patch/hifiasm_0.16.1_Eg_no_HiC.bp.p_ctg.gfa_newscaffolds.fa > /ragtag/patch/ragtag_output/ragtag.patch.ctg.fasta 2> /ragtag/patch/ragtag_output/ragtag.patch.err. Check stderr file for details.

ragtag.patch.err

[fai_load] build FASTA index.
Traceback (most recent call last):
File "/env/ragtag_2.1.0/bin/ragtag_splitasm.py", line 111, in
main()
File "/env/ragtag_2.1.0/bin/ragtag_splitasm.py", line 65, in main
gap_coords = [(i.start(), i.end()) for i in re.finditer(r'N+', seq) if i.end() - i.start() > min_gap_size]
File "/env/ragtag_2.1.0/lib/python3.6/re.py", line 229, in finditer
return _compile(pattern, flags).finditer(string)
TypeError: cannot use a string pattern on a bytes-like object

Hi there,

Looks like your fasta file is incorrectly formatted. Try to use the fasta file with other standard tools to confirm that it's properly formatted. For example, perhaps your fasta file is compressed with gzip rather than bgzip? If not this, it will be some other small formatting issue.

Hi, thank you for the answer. The file works perfectly with other programs and also with RagTag scaffold, so it seems strange that it is not well formatted.