liaoherui / StrainScan

High-resolution strain-level microbiome composition analysis tool based on reference genomes and k-mers
https://microbiomejournal.biomedcentral.com/articles/10.1186/s40168-023-01615-w
MIT License
32 stars 4 forks source link

ZeroDivisionError: division by zero #15

Closed rafalkolenda closed 8 months ago

rafalkolenda commented 8 months ago

Hi, I was running your software and got the following error. I am using the newest version of strainscan that I cloned from github 3 days ago. Traceback (most recent call last): File "StrainScan/StrainScan.py", line 275, in sys.exit(main()) File "StrainScan/StrainScan.py", line 194, in main cls_dict = identify_low_mem.identify_cluster(in_fq, db_dir + '/Tree_database', [0.1, 0.4, 1]) File "/home/ubuntu/Pig_microbiome/Culturomics/mesophilic_growth/strainscan/StrainScan/library/identify_low_mem.py", line 408, in identify_cluster search(pending, match_results, db_dir, valid_kmers, length, cov, abundance, cov_cutoff, ab_cutoff, results, leaves, res_temp, tree, overlapping_info) File "/home/ubuntu/Pig_microbiome/Culturomics/mesophilic_growth/strainscan/StrainScan/library/identify_low_mem.py", line 225, in search cov[node] = len(k_profile)/length[node] ZeroDivisionError: division by zero

Best wishes Rafał

liaoherui commented 8 months ago

Hi, thanks for using StrainScan!

Firstly, it seems you build the database under memory-efficient mode. Could you try to build the database under regular mode? If there are still errors, please let me know. In addition, we may need your constructed database and input data to debug the program. We'll appreciate that if you can provide those materials to us. Thanks!

rafalkolenda commented 8 months ago

Hi, I had to re-install the strainscan to get access to more RAM to build my database and now I get this error: 2023-10-23 10:57:15,338 - Constructing matrix with dashing (jaccard index) Traceback (most recent call last): File "StrainScan/StrainScan_build.py", line 162, in main() File "StrainScan/StrainScan_build.py", line 103, in main matrix = Cluster.construct_matrix(args.input_fa) File "/qib/research-projects/Pig_microbiome/Culturomics/mesophilic_growth/strainscan/StrainScan/library/Cluster.py", line 26, in construct_matrix run_job(cmd) File "/qib/research-projects/Pig_microbiome/Culturomics/mesophilic_growth/strainscan/StrainScan/library/Cluster.py", line 11, in run_job raise ValueError(f'Error running {cmd}: {err.decode()}') ValueError: Error running /qib/research-projects/Pig_microbiome/Culturomics/mesophilic_growth/strainscan/StrainScan/library/dashing_s128 dist -p10 -k31 -O distance_matrix.txt -o size_estimates.txt -Q genome_path_tem.txt -F genome_path_tem.txt:

liaoherui commented 8 months ago

Hi,

The reported error is not normal. Firstly, can you try to check the permission of your dashing? (You can use chmod 755 library/dashing_s128 to improve the permission of the tool)

We would appreciate that if you can provide the genomes you input to StrainScan, which caused the error here. Then we will debug and find the reason/solution asap!

rafalkolenda commented 8 months ago

Thanks for your help. the last issue was caused by some nodes on HPC.