Closed prmunn closed 6 months ago
It seems you have no paired reads on a particular contig (scaffold) which is causing the error. I have made a fix that you can try out and see if it helps with your issue. Please test it out by installing the updated branch, e.g. running the command below:
pip install git+https://github.com/pontushojer/NAIBR.git@fix-12
This appears to have worked - I was able to finish without getting an error. Thanks!
It would be ideal if you could create a new release from this so I can incorporate a non-git-dev version into my workflow
@pontushojer this is great, thanks! When you have the time, may you push this into a release so it's available via conda?
Great to hear that this worked! I have made a new minor release that should be added to bioconda shortly https://github.com/pontushojer/NAIBR/releases/tag/v0.5.3
ZeroDivisionError when running NAIBR on the alignments made for one sample using BWA, with the following config file: bam_file=Variants/naibr/phasedbam/15-fly-GIH24008-15-10473766-22KG2CLT3-L5_trimmed.bam prefix=15-fly-GIH24008-15-10473766-22KG2CLT3-L5_trimmed outdir=Variants/naibr/15-fly-GIH24008-15-10473766-22KG2CLT3-L5_trimmed threads=20 min_mapq=30 d=100000 min_sv=1000 k=3
Processing 2Cen_mapped_Scaffold_43_D1668: DONE! 23 pairs (total time = 0.000 s)! 2024-04-26 16:40:25,177 - INFO: Done reading chromosome 2Cen_mapped_Scaffold_43_D1668: coverage = 0.225X 2024-04-26 16:40:25,177 - INFO: 2Cen_mapped_Scaffold_43_D1668: total pairs: 23, discordant: 0 (0.00%), concordant: 23 (100.00%) 2024-04-26 16:40:25,177 - INFO: For chromsome 2Cen_mapped_Scaffold_43_D1668 - found 0 positions with discordant reads. 2024-04-26 16:40:25,177 - WARNING: Too few linked reads to estimate distributions 2024-04-26 16:40:25,177 - INFO: Got candidate noval adjacencies from data: 0.0002 s 2024-04-26 16:40:25,177 - INFO: No candidates from 2Cen_mapped_Scaffold_43_D1668 2024-04-26 16:40:25,177 - INFO: Getting candidates for chromosome Y_mapped_Scaffold_53_D1765 Processing Y_mapped_Scaffold_53_D1765: DONE! 1 pairs (total time = 0.000 s)! 2024-04-26 16:40:25,181 - INFO: Done reading chromosome Y_mapped_Scaffold_53_D1765: coverage = 0.669X 2024-04-26 16:40:25,182 - INFO: Y_mapped_Scaffold_53_D1765: total pairs: 1, discordant: 0 (0.00%), concordant: 1 (100.00%) 2024-04-26 16:40:25,182 - INFO: No candidates from Y_mapped_Scaffold_53_D1765 multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, *kwds)) File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar return list(map(args)) File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/site-packages/naibr/main.py", line 228, in run_naibr_on_chromosome ) = parse_chromosome(chrom, configs) File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/site-packages/naibr/get_reads.py", line 158, in parse_chromosome f"{chrom}: total pairs: {n_total:,}, discordant: {n_disc:,} ({n_disc/n_total:.2%}), " ZeroDivisionError: division by zero """
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/bin/naibr", line 10, in
sys.exit(main())
File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/site-packages/naibr/main.py", line 399, in main
return run(file_configs)
File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/site-packages/naibr/main.py", line 358, in run
novel_adjacencies = run_naibr_on_chromosomes(chromosomes, configs)
File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/site-packages/naibr/main.py", line 158, in run_naibr_on_chromosomes
chroms_data = parallel_execute(run_with_configs, chromosomes, threads=configs.NUM_THREADS)
File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/site-packages/naibr/utils.py", line 555, in parallel_execute
data = pool.map(function, input_list)
File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/multiprocessing/pool.py", line 367, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/local/workdir/prm88/GenomicsInnovation/haplotagging/GI24008_Bronwynfly/.snakemake/conda/f1fd700952a0559ded17282312097fad/lib/python3.10/multiprocessing/pool.py", line 774, in get
raise self._value
ZeroDivisionError: division by zero