tanghaibao / jcvi

Python library to facilitate genome assembly, annotation, and comparative genomics
BSD 2-Clause "Simplified" License
745 stars 187 forks source link

faSize: cannot execute binary file #441

Closed aaronphillips7493 closed 2 years ago

aaronphillips7493 commented 2 years ago

Hey,

I had to re-install jcvi/ALLMAPS because my last install was not working. When I try to build a chain file I get the following error message:

$ python -m jcvi.formats.chain fromagp primary_contig_scaffolds_renamed_Chr.agp oryza.primary_contigs.hypo.polish.long_short.fasta primary_contig_scaffolds_renamed_Chr.fasta 
[17:04:13] DEBUG    Load file `primary_contig_scaffolds_renamed_Chr.agp`                                                                                                                          base.py:33
           DEBUG    faSize -detailed /Users/aaronphillips/Desktop/Omicsbox/Oa-KR_genome_annotation/2022_annotate_scaffolds/oryza.primary_contigs.hypo.polish.long_short.fasta                   base.py:1185
                    >oryza.primary_contigs.hypo.polish.long_short.fasta.sizes                                                                                                                               
/bin/bash: /Users/aaronphillips/.local/bin/faSize: cannot execute binary file
           DEBUG    Load file `oryza.primary_contigs.hypo.polish.long_short.fasta.sizes`                                                                                                          base.py:33
Traceback (most recent call last):
  File "/Users/aaronphillips/miniconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/aaronphillips/miniconda3/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/aaronphillips/.local/lib/python3.9/site-packages/jcvi/formats/chain.py", line 313, in <module>
    main()
  File "/Users/aaronphillips/.local/lib/python3.9/site-packages/jcvi/formats/chain.py", line 84, in main
    p.dispatch(globals())
  File "/Users/aaronphillips/.local/lib/python3.9/site-packages/jcvi/apps/base.py", line 110, in dispatch
    globals[action](sys.argv[2:])
  File "/Users/aaronphillips/.local/lib/python3.9/site-packages/jcvi/formats/chain.py", line 151, in fromagp
    componentsizes = Sizes(componentfasta).mapping
  File "/Users/aaronphillips/.local/lib/python3.9/site-packages/jcvi/formats/sizes.py", line 68, in __init__
    ctgs, sizes = zip(*sizes)
ValueError: not enough values to unpack (expected 2, got 0)

You will notice that there is an issue with faSize ("faSize: cannot execute binary file"), which leads to an empty "*sizes" file and causes the crash (I think). Do you know why this might be? I followed the install steps. I have changed the dependencies faSize, concorde, and liftOver to executable with: chmod 755

I don't recall having this issue in the past. Any help would be greatly appreciated.

Thanks, Aaron :)

aaronphillips7493 commented 2 years ago

I should add that this happens for the ALLMAPS-testdata as well.

tanghaibao commented 2 years ago

@aaronphillips7493

You may need to download a binary that works on your machine: https://hgdownload.soe.ucsc.edu/admin/exe/

To see if it works, just run the binary and see if you see the printed help.

An alternative way is to remove faSize from your path. jcvi will instead use a Python implementation (slower) to calculate the sizes for the sequences in the FASTA file.

Haibao