mikolmogorov / Ragout

Chromosome-level scaffolding using multiple references
Other
149 stars 27 forks source link

TypeError using HAL alingment #61

Closed stefjanson closed 4 years ago

stefjanson commented 4 years ago

Hi,

I'm trying to use Ragout v2.3 with a HAL alignment but i keep running into an error: TypeError: a bytes-like object is required, not 'str'

To trouble shoot i use the following example dataset: https://github.com/fenderglass/Ragout/files/1167683/hal_example.tar.gz

I use the following command: ./bin/ragout examples/hal_example/cholerae.rcp --outdir examples/hal_example/out/ --refine -t 16 -s hal

Best, Stef

mikolmogorov commented 4 years ago

There is inconsistency between new and old HAL APIs, which is currently causing the issue. I am planning to work on this in the near future. In the mean time, please see #60 and #46 for workarounds.

Mikhail

mikolmogorov commented 4 years ago

In addition, could you post the full log file?

stefjanson commented 4 years ago

Hi,

Thank you for the reply.

My work-around was converting to MAF with the following command: hal2maf assembly/alignment.hal assembly/alignment.maf

The full log for using HAL: [09:54:22] INFO: Starting Ragout v2.3 Traceback (most recent call last): File "./bin/ragout", line 32, in sys.exit(main()) File "/home/s.janson/Ragout/ragout/main.py", line 295, in main _run_ragout(args) File "/home/s.janson/Ragout/ragout/main.py", line 172, in _run_ragout synteny_sizes = _get_synteny_scale(recipe, synteny_backend) File "/home/s.janson/Ragout/ragout/main.py", line 145, in _get_synteny_scale scale = config.vals["blocks"][synteny_backend.infer_block_scale(recipe)] File "/home/s.janson/Ragout/ragout/synteny_backend/hal.py", line 43, in infer_block_scale tokens = line.split(",") TypeError: a bytes-like object is required, not 'str'

mikolmogorov commented 4 years ago

@stefjanson thanks! In fact, looks like this error is unrelated to HAL - but rather an artifact of the recent Python2 -> Python3 transition. I will fix it in the near future.

bernard-kim commented 4 years ago

Hi Mikhail,

I was able to fix this issue pretty straightforwardly (I think) by adding the decode() method to line 43 in ragout/synteny_backend/hal.py

tokens = line.decode().split(",")

However issues remain with hal2mafMP.py -- I will provide details in #60.

mikolmogorov commented 4 years ago

@bernard-kim thanks! Fixed via https://github.com/fenderglass/Ragout/pull/65