gjeunen / reference_database_creator

creating reference databases for amplicon sequencing
MIT License
28 stars 8 forks source link

db_download error #42

Closed fang9319 closed 1 month ago

fang9319 commented 1 year ago

System: MacOS Ventura, Python version:3.9.1 crabs:0.1.4

Code: crabs db_download --source ncbi --database nucleotide --query '12S[All Fields] AND ("1"[SLEN] : "50000"[SLEN])' --species zhuangjiang_fish.csv --output zhujiang_fish_ncbi.fasta --keep_original yes --email myemail --batchsize 500000

error report: Traceback (most recent call last): File "/Users/liuzifang/reference_database_creator/crabs", line 1428, in main() File "/Users/liuzifang/reference_database_creator/crabs", line 1425, in main args.func(args) File "/Users/liuzifang/reference_database_creator/crabs", line 80, in db_download speciesTempFileList = wget_ncbi_species(QUERY, DATABASE, EMAIL, BATCHSIZE, OUTPUT, speciesName) File "/Users/liuzifang/reference_database_creator/function/module_db_download.py", line 111, in wget_ncbi_species print(f'downloading {seqcount} sequences from NCBI using the searchterm: {speciesSearchTerm}') UnboundLocalError: local variable 'seqcount' referenced before assignment

I changed the script in module_db_download.py by adding seqcount=0 at line 102, also tried seqcount='', and both worked. When I used the newest version of Crabs on an Ubuntu desktop, I didn't encounter the same error. So I guess it's possibly just happened in the older version of crabs, but I just think it could be helpful for people who encounter similar problems using the old versions.

fang9319 commented 1 year ago

Hi Fabio,

It happened to me after I updated the crabs to v0.1.8 too. Try add seqcount=0 at line 102, it will fix the problem roughly.

Best regards, Zifang

On Sat, 25 Nov 2023 at 00:29, FabioGAmaral @.***> wrote:

It's happening the same to me, crabs version: 0.1.8

— Reply to this email directly, view it on GitHub https://github.com/gjeunen/reference_database_creator/issues/42#issuecomment-1825885932, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMK5ZD6OWMBA2BJYWE4GPKDYGDDNPAVCNFSM6AAAAAA66EB7NKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRVHA4DKOJTGI . You are receiving this because you authored the thread.Message ID: @.***>

saraswaminathan commented 1 month ago

I'm getting this same error but unsure how to fix when using Docker bc unsure how to edit the module_db_download.py script

gjeunen commented 1 month ago

Hello @saraswaminathan,

Thank you for your message.

We're introducing a new version of CRABS tomorrow, which represents a full overhaul of the code, with added functionality, increased speed, improved file and error handling, enhanced flexibility, and simplified installation through fewer dependencies. This version will first be available by cloning the GitHub repository, with the other installation options following shortly after. The new version should also fix the error you are currently encountering.

Best wishes, Gert-Jan

gjeunen commented 1 month ago

Hello @saraswaminathan,

The new CRABS version (v 1.0.0) is now available and can be downloaded by cloning the GitHub repository. We hope to update the conda package and Docker container shortly. This new version should fix the issue, but please reopen this thread if the issue persists.

Best wishes, Gert-Jan