qiyunlab / HGTector

HGTector2: Genome-wide prediction of horizontal gene transfer based on distribution of sequence homology patterns.
BSD 3-Clause "New" or "Revised" License
116 stars 34 forks source link

Fails at diamond blast, type error: expected string #127

Open kaw97 opened 1 year ago

kaw97 commented 1 year ago

I'm trying to run HGTector for the first time, and encountering problems at the diamond blast step. I'd very much appreciate any troubleshooting help you can give.

I have successfully set up my databases, but when I run hgtector search, I get the following error:

Traceback (most recent call last): File "/home/kyle/miniconda3/envs/hgtector/bin/hgtector", line 96, in <module> main() File "/home/kyle/miniconda3/envs/hgtector/bin/hgtector", line 35, in main module(args) File "/home/kyle/miniconda3/envs/hgtector/lib/python3.11/site-packages/hgtector/search.py", line 171, in __call__ res = self.search_wf( ^^^^^^^^^^^^^^^ File "/home/kyle/miniconda3/envs/hgtector/lib/python3.11/site-packages/hgtector/search.py", line 686, in search_wf res = self.diamond_search(seqs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/kyle/miniconda3/envs/hgtector/lib/python3.11/site-packages/hgtector/search.py", line 1530, in diamond_search ec, out = run_command(' '.join(cmd), merge=False) ^^^^^^^^^^^^^ TypeError: sequence item 5: expected str instance, NoneType found

it appears to be happening when it starts the first blast search. This is the last output from my run: GCA_002878455.fa: 5677 proteins. GCA_001758765.fa: 5426 proteins. Done. Read 26 1098 proteins from 47 samples. Dropping sequences shorter than 30 aa... done. Initiating custom taxonomy database... done. Batch homology search of GCA_000013625.fa started at 2023-09-15 17:28:44.124043. Number of queries: 3838.

Thanks a ton! Kyle Wolf

kaw97 commented 1 year ago

The output/error files:

hgtector.515643.out.txt hgtector.515643.err.txt

qiyunzhu commented 12 months ago

Hello @kaw97 Kyle, thank you for using our program. I checked the code and located a plausible cause. However, I cannot reproduce it. Can you please let me know the specific hgtector search command you used? I suspect that there were custom parameters which were incorrectly casted into None by the program.

kaw97 commented 12 months ago

Hello @kaw97 Kyle, thank you for using our program. I checked the code and located a plausible cause. However, I cannot reproduce it. Can you please let me know the specific hgtector search command you used? I suspect that there were custom parameters which were incorrectly casted into None by the program.

Certainly! Thanks a bunch. I am running it with:

hgtector search -i /media/bigdrive1/kyle/janthino/input_genomes2/test_download/janthino_genomes/annotated_analysis/faa/ -o search -m diamond -p 16

qiyunzhu commented 12 months ago

@kaw97 Thanks! This is the default command, and I don't know where could a None pop up. Just in case, did you edit the configuration file to remove some default values? To further debug, you can open the file:

/home/kyle/miniconda3/envs/hgtector/lib/python3.11/site-packages/hgtector/search.py

Find this line

        ec, out = run_command(' '.join(cmd), merge=False)

Insert a new line before it. The content is:

        print(cmd)

Then run the program as you did. Before the same error happens, the program will print out the command. Let me see it so that I can check which parameter was incorretly assigned as None. Thanks!