gem-pasteur / Integron_Finder

Bioinformatics tool to find integrons in bacterial genomes
GNU General Public License v3.0
64 stars 22 forks source link

ValueError: attempt to get argmin of an empty sequence #92

Closed danyu-uofa closed 3 years ago

danyu-uofa commented 3 years ago

Version of Integron_Finder:

integron_finder version 2.0rc9 Using:

OS

Expected behavior

I am running integron_finder on a set of E. coli genomes using the --local-max and --func-annot options and it works fine for most of them.

Actual behavior

During the integron search for select strains, however, the program will be able to search some replicons for integrons but will fail and exit early, returning (also see screenshot below):

Traceback (most recent call last):
  File "/usr/local/bin/integron_finder", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/integron_finder/scripts/finder.py", line 607, in main
    integron_res, summary = find_integron_in_one_replicon(replicon, config)
  File "/usr/local/lib/python3.9/dist-packages/integron_finder/scripts/finder.py", line 324, in find_integron_in_one_replicon
    integrons = find_integron(replicon, protein_db, attC_default_file, intI_file, phageI_file, config)
  File "/usr/local/lib/python3.9/dist-packages/integron_finder/integron.py", line 80, in find_integron
    phageI = read_hmm(replicon.id, prot_db, phageI_file, cfg)
  File "/usr/local/lib/python3.9/dist-packages/integron_finder/hmm.py", line 150, in read_hmm
    best_evalue = np.argmin(evalue_tmp)
  File "<__array_function__ internals>", line 5, in argmin
  File "/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py", line 1269, in argmin
    return _wrapfunc(a, 'argmin', axis=axis, out=out)
  File "/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py", line 55, in _wrapfunc
    return _wrapit(obj, method, *args, **kwds)
  File "/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py", line 44, in _wrapit
    result = getattr(asarray(obj), method)(*args, **kwds)
ValueError: attempt to get argmin of an empty sequence

Steps to reproduce behavior

I downloaded the genome sequence of E. coli strain M505 from NCBI via the following accession number: GCF_013374235.2

I then ran integron finder with the --local-max and --func-annot options.

Relevant logs and/or screenshots

Screen Shot 2021-08-09 at 9 13 53 PM

Apologies if this isn't clear enough, I am relatively new to bioinformatics and wanted to try out integron_finder.

bneron commented 3 years ago

I fixed the problem, and push it on dev branch. I will soon create a new release with this fix. But meanwhile if you want to try it, you can install integron_finder directly from the repository.

to do that in a virtuallenv follow the procedure below

python3 -m venv if_venv
cd if_venv
source bin/activate
python -m pip install git+https://github.com/gem-pasteur/Integron_Finder.git@2c9ac8353388e2c6cca8bf56e5656026fd21696b

thank's to report us this problem,

bneron commented 3 years ago

I fixed the problem, and push it on dev branch. I will soon create a new release with this fix. But meanwhile if you want to try it, you can install integron_finder directly from the repository.

to do that in a virtuallenv follow the procedure below

python3 -m venv if_venv
cd if_venv
source bin/activate
python -m pip install git+https://github.com/gem-pasteur/Integron_Finder.git@2c9ac8353388e2c6cca8bf56e5656026fd21696b

thank's to report us this problem,

danyu-uofa commented 3 years ago

Thank you!

On Tue, Aug 17, 2021 at 3:29 AM Bertrand Néron @.***> wrote:

I fixed the problem, and push it on dev branch. I will soon create a new release with this fix. But meanwhile if you want to try it, you can install integron_finder directly from the repository.

to do that in a virtuallenv follow the procedure below

python3 -m venv if_venv cd if_venv source bin/activate python -m pip install @.***

thank's to report us this problem,

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gem-pasteur/Integron_Finder/issues/92#issuecomment-900141468, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ76FLABLMIK67RC6J7PHVDT5ITXRANCNFSM5B3IJODQ . 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&utm_campaign=notification-email .

susheelbhanu commented 6 months ago

Hi I'm running into the same issue with the latest version from conda:

Traceback (most recent call last):
  File "/hdd0/susbus/tools/conda_env/3cd81d02c5745c3080088a3e91542550_/bin/integron_finder", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/hdd0/susbus/tools/conda_env/3cd81d02c5745c3080088a3e91542550_/lib/python3.12/site-packages/integron_finder/scripts/finder.py", line 651, in main
    integron_res, summary = find_integron_in_one_replicon(replicon, config)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/hdd0/susbus/tools/conda_env/3cd81d02c5745c3080088a3e91542550_/lib/python3.12/site-packages/integron_finder/scripts/finder.py", line 357, in find_integron_in_one_replicon
    integrons = find_integron(replicon, protein_db, intI_file, phageI_file, config, attc_file=attC_default_file)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/hdd0/susbus/tools/conda_env/3cd81d02c5745c3080088a3e91542550_/lib/python3.12/site-packages/integron_finder/integron.py", line 187, in find_integron
    side = np.argmin(distances)
           ^^^^^^^^^^^^^^^^^^^^
  File "/hdd0/susbus/tools/conda_env/3cd81d02c5745c3080088a3e91542550_/lib/python3.12/site-packages/numpy/core/fromnumeric.py", line 1325, in argmin
    return _wrapfunc(a, 'argmin', axis=axis, out=out, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/hdd0/susbus/tools/conda_env/3cd81d02c5745c3080088a3e91542550_/lib/python3.12/site-packages/numpy/core/fromnumeric.py", line 59, in _wrapfunc
    return bound(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^
ValueError: attempt to get argmin of an empty sequence