mdshw5 / pyfaidx

Efficient pythonic random access to fasta subsequences
https://pypi.python.org/pypi/pyfaidx
Other
449 stars 75 forks source link

Version in APT doesn't have correct dependenceis #187

Closed CholoTook closed 2 years ago

CholoTook commented 2 years ago

Hi,

I ran sudo apt install python3-pyfaidx and it created the faidx python script in my path. However, when I run:

faidx Homo_sapiens.GRCh37.dna.primary_assembly.fa.gz

I get the following error:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pyfaidx/__init__.py", line 344, in __init__
    from Bio import bgzf
ModuleNotFoundError: No module named 'Bio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/faidx", line 11, in <module>
    load_entry_point('pyfaidx==0.5.8', 'console_scripts', 'faidx')()
  File "/usr/lib/python3/dist-packages/pyfaidx/cli.py", line 195, in main
    write_sequence(args)
  File "/usr/lib/python3/dist-packages/pyfaidx/cli.py", line 19, in write_sequence
    fasta = Fasta(args.fasta, default_seq=args.default_seq, key_function=eval(args.header_function), strict_bounds=not args.lazy, split_char=args.delimiter, filt_function=filt_function, read_long_names=args.long_names, rebuild=not args.no_rebuild)
  File "/usr/lib/python3/dist-packages/pyfaidx/__init__.py", line 991, in __init__
    self.faidx = Faidx(
  File "/usr/lib/python3/dist-packages/pyfaidx/__init__.py", line 350, in __init__
    raise ImportError(
ImportError: BioPython >= 1.73 must be installed to read block gzip files.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_faidx.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pyfaidx/__init__.py", line 344, in __init__
    from Bio import bgzf
ModuleNotFoundError: No module named 'Bio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/faidx", line 11, in <module>
    load_entry_point('pyfaidx==0.5.8', 'console_scripts', 'faidx')()
  File "/usr/lib/python3/dist-packages/pyfaidx/cli.py", line 195, in main
    write_sequence(args)
  File "/usr/lib/python3/dist-packages/pyfaidx/cli.py", line 19, in write_sequence
    fasta = Fasta(args.fasta, default_seq=args.default_seq, key_function=eval(args.header_function), strict_bounds=not args.lazy, split_char=args.delimiter, filt_function=filt_function, read_long_names=args.long_names, rebuild=not args.no_rebuild)
  File "/usr/lib/python3/dist-packages/pyfaidx/__init__.py", line 991, in __init__
    self.faidx = Faidx(
  File "/usr/lib/python3/dist-packages/pyfaidx/__init__.py", line 350, in __init__
    raise ImportError(
ImportError: BioPython >= 1.73 must be installed to read block gzip files.

When I hit apt search BioPython, I see:

p   python3-biopython Python3 library for bioinformatics                                                                    

So that package should be a dep for python3-pyfaidx I think...

Many thanks for your work on this software!

Sincerely, Dan

mdshw5 commented 2 years ago

Thanks Dan. This would be something to refer to the Debian Med project, who do the debian packaging for this module. As far as I'm concerned though, I would opt to keep biopython as a recommendation, not a dependency. This is the reason I don't have biopython as a dependency for the python package. My reasoning for this used to be that I was supporting python versions that biopython doesn't support, but now I would imagine this is less of an issue. If I make more progress on #164 and #153 I may consider adding explicit dependency.

CholoTook commented 2 years ago

Thanks Matt!

On Sat, 19 Feb 2022 at 18:26, Matt Shirley @.***> wrote:

Thanks Dan. This would be something to refer to the Debian Med https://www.debian.org/devel/debian-med/ project, who do the debian packaging for this module. As far as I'm concerned though, I would opt to keep biopython as a recommendation, not a dependency. This is the reason I don't have biopython as a dependency for the python package. My reasoning for this used to be that I was supporting python versions that biopython doesn't support, but now I would imagine this is less of an issue. If I make more progress on #164 https://github.com/mdshw5/pyfaidx/pull/164 and #153 https://github.com/mdshw5/pyfaidx/issues/153 I may consider adding explicit dependency.

— Reply to this email directly, view it on GitHub https://github.com/mdshw5/pyfaidx/issues/187#issuecomment-1046077851, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANKSZTTVNI77TFUQEZAV25DU37OG5ANCNFSM5OUOXGMQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>