medema-group / BiG-SCAPE

Similarity networks of biosynthetic gene clusters
GNU Affero General Public License v3.0
69 stars 26 forks source link

```NameError: name 'genbankDict' is not defined``` when the input gbk file is not detected with domain. #103

Closed neptuneyt closed 9 months ago

neptuneyt commented 10 months ago

Dear developer, I update bigscape to v1.1.7, I encountered an NameError: name 'genbankDict' is not defined when the input gbk file is not detected with domain. Even through I debug with genbankDict = {} at line 1294. The command and log as below. The issue was only occured with any of input gbk without detection of domain.

(bigscape1.1.7) [yut@node06 TestData]$ time bigscape.py  -i bigscape_input/ -o bigscape_result
... 
Starting with 20 files
 Files that had its sequence extracted: 0

Creating output directories
 SVG folder already exists
 Networks folder already exists

Trying threading on 128 cores

Predicting domains using hmmscan
 All fasta files had already been processed
 Finished generating domtable files.

Parsing hmmscan domtable files
 Warning! The following domtable files had not been processed: MAG_1908QYC2_metabat2_bin.49~QYC2.1908_Scaff0430441.region001
  No domains where found in MAG_1908QYC2_metabat2_bin.49~QYC2.1908_Scaff0430441.region001.domtable. Removing it from further analysis
Traceback (most recent call last):
  File "/datanode02/yut/Software/BiG-SCAPE-1.1.7/bigscape.py", line 3333, in <module>
    main()
  File "/datanode02/yut/Software/BiG-SCAPE-1.1.7/bigscape.py", line 2522, in main
    parseHmmScan(domtableFile, pfd_folder, pfs_folder, options.domain_overlap_cutoff)
  File "/datanode02/yut/Software/BiG-SCAPE-1.1.7/bigscape.py", line 1294, in parseHmmScan
    info = genbankDict.get(outputbase)
NameError: name 'genbankDict' is not defined

I am looking forward you reply.
adraismawur commented 10 months ago

Hello!

Thank you for your bug report. This is an issue with an update we pushed recently.

Please try version 1.1.5 while we try to resolve these issues.

github-actions[bot] commented 10 months ago

This issue has not seen activity for 14 days and has been marked as stale. Please comment with additional information if this issue is still relevant.

cfz1998 commented 10 months ago

Hello!

Thank you for your bug report. This is an issue with an update we pushed recently.

Please try version 1.1.5 while we try to resolve these issues.

Hi! @adraismawur. I got the same error. The version is BiG-SCAPE 1.1.5 (2022-11-14).

cfz1998 commented 10 months ago

Hi~ @adraismawur I just changed some lines in lines 1294-1299. Does this have other problems? image

Thank you for your reply!

lytze commented 9 months ago

I had the save problem with v1.1.7. I fixed this bug with adding

global genbankDict

before line 2290

    global bgc_info
    bgc_info = {}
    global genbankDict  ## add this line
    genbankDict = {}
adraismawur commented 9 months ago

For future users looking at this issue: see bottom of this post.

Hi~ @adraismawur I just changed some lines in lines 1294-1299. Does this have other problems? image

Thank you for your reply!

I am 90% sure that should be fine. If it works, it works ;)

I had the save problem with v1.1.7. I fixed this bug with adding

global genbankDict

before line 2290

    global bgc_info
    bgc_info = {}
    global genbankDict  ## add this line
    genbankDict = {}

Out of interest, are you running BiG-SCAPE as a python file using python bigscape.py or as a module using python -m bigscape or similar?

For future users looking at this issue:

We are working on version 2 of BiG-SCAPE which will be properly installable using Bioconda.

The issues with a Bioconda installation are that they are ran as modules, which does not play nice with the global variables that were used in 1.x. Thoroughly assessing and fixing the various globals that are present in 1.x is not something we want to do at this moment so we discourage installing BiG-SCAPE through Bioconda and running it as a module.

The package still exists on Bioconda because there is no way to remove package versions, unfortunately. Sorry for the inconvenience this causes and we hope to release version 2 soon.