medema-group / bigslice

A highly scalable, user-interactive tool for the large scale analysis of Biosynthetic Gene Clusters data
GNU Affero General Public License v3.0
75 stars 39 forks source link

“sqlite3.OperationalError: unable to open database file” error when using "--export-tsv" #81

Open BioGavin opened 6 months ago

BioGavin commented 6 months ago

I download bigslice-2.0.0 and run it using example input folder. I got an error running the following command:

bigslice -i input_folder_template/ --export-tsv tsv bigslice_out

The error message is as follows:

...
pid 3876757 的新亲和力列表:0
pid 3876520 的当前亲和力列表:0-71
pid 3876520 的新亲和力列表:0-71
Exporting BGC metadata table... tsv/bgc_metadata.tsv
Traceback (most recent call last):
  File "/home/gavin/miniconda3/envs/bigslice/bin/bigslice", line 1950, in <module>
    return_code = main()
  File "/home/gavin/miniconda3/envs/bigslice/bin/bigslice", line 1072, in main
    return export_tsv_to_folder(output_folder, args.export_tsv)
  File "/home/gavin/miniconda3/envs/bigslice/lib/python3.8/site-packages/bigslice/modules/output/csv/__init__.py", line 130, in export_tsv_to_folder
    export_bgc_metadata(result_folder, path_tsv, sep="\t")
  File "/home/gavin/miniconda3/envs/bigslice/lib/python3.8/site-packages/bigslice/modules/output/csv/__init__.py", line 8, in export_bgc_metadata
    with sqlite3.connect(path.join(result_folder, "result/data.db")) as con:
sqlite3.OperationalError: unable to open database file

The error message indicated that the database file could not be opened, and I found that this database file referred to ${output_folder_path}/result/data.db. But the ${output_folder_path}/result directory is not generated.

BioGavin commented 6 months ago

When I run the basic command bigslice -i input_folder_template/ out, it works well. So I think it's the export-tsv step that is wrong in the program logic. Hopefully it will be resolved soon.

Maiya19724 commented 1 month ago

–export-tsv Export existing pre-calculated output data into TSVs (specify the target folder path).

The –export-tsv requires a folder containing Bigslice’s pre-calculated output data to be used. You may need the following command: bigslice /path/to/pre-calculated/output/ –export-tsv <folder_path>. After you complete a Bigslice computation,

ps: you may also need to modify the code based with this PR #85, which has not yet been reviewed and merged. Good Luck