robinandeer / puzzle

Variant caller GUI + genetic disease analysis
https://robinandeer.gitbooks.io/puzzle/content/
MIT License
22 stars 7 forks source link

File "cyvcf2/cyvcf2.pyx", line 155, in cyvcf2.cyvcf2.VCF.__init__ (cyvcf2/cyvcf2.c:7106) TypeError: Expected bytes, got path #227

Closed J35P312 closed 8 years ago

J35P312 commented 8 years ago

Hello there! Recently I installed the latest version of puzzle, it was installed without any apparent error, however when I run the test example I get the following error:

Traceback (most recent call last): File "/home/jesper/miniconda2/envs/test_puzzle/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/home/jesper/miniconda2/envs/test_puzzle/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/jesper/Downloads/puzzle_test/puzzle/puzzle/main.py", line 19, in sys.exit(cli()) File "/home/jesper/miniconda2/envs/test_puzzle/lib/python2.7/site-packages/click/core.py", line 716, in call return self.main(_args, _kwargs) File "/home/jesper/miniconda2/envs/test_puzzle/lib/python2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/home/jesper/miniconda2/envs/test_puzzle/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/jesper/miniconda2/envs/test_puzzle/lib/python2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, _ctx.params) File "/home/jesper/miniconda2/envs/test_puzzle/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(_args, _kwargs) File "/home/jesper/miniconda2/envs/test_puzzle/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), args, *_kwargs) File "/home/jesper/Downloads/puzzle_test/puzzle/puzzle/cli/view.py", line 107, in view variant_type = get_variant_type(file) File "/home/jesper/Downloads/puzzle_test/puzzle/puzzle/utils/get_file_info.py", line 48, in get_variant_type variants = VCF(variant_source) File "cyvcf2/cyvcf2.pyx", line 155, in cyvcf2.cyvcf2.VCF.init (cyvcf2/cyvcf2.c:7106) TypeError: Expected bytes, got path

Any ideas on how to fix it ? Regards Jesper

moonso commented 8 years ago

I'll have a look!

moonso commented 8 years ago

This seems to be a version problem with cyvcf2. If you downgrade version to 0.2.8 it should work. I've updated the requrements file

J35P312 commented 8 years ago

Thanks, now it works perfectly!

brentp commented 8 years ago

Hi, I just happened to see this, could you try 0.4.0 (in bioconda)? And let me know how/if you can reproduce it there?

colindaven commented 8 years ago

I just got this error using a newer version of cyvcf2 if that helps, also with the test data (as per the tutorial https://robinandeer.gitbooks.io/puzzle/content/topics/tutorial.html )

pip list | grep cyvcf2 cyvcf2 (0.4.2)

Works fine after installing 0.2.8 as above

brentp commented 8 years ago

This error is because puzzle is sending a path object to cyvcf2 instead of string or bytes. I suspect wrapping the call in str() would suffice.