ncsa / NEAT

NEAT (NExt-generation Analysis Toolkit) simulates next-gen sequencing reads and can learn simulation parameters from real data.
Other
47 stars 14 forks source link

Division by zero / cant disable target regions with discard #102

Closed DrinnanSante closed 5 months ago

DrinnanSante commented 5 months ago

running basic read-simulate, config file matches example but with different reference, bolded what I think are the important lines, if I am doing something wrong please let me know!

2024-04-16 21:33:27,144:INFO:neat.read_simulator.runner:Beginning simulation. 2024-04-16 21:33:27,181:INFO:neat.read_simulator.runner:Generating variants for 7e24d142adc2427d_1 2024-04-16 21:33:29,652:INFO:neat.read_simulator.utils.generate_variants:Finished generating random mutations in 0.04 minutes 2024-04-16 21:33:29,652:INFO:neat.read_simulator.utils.generate_variants:Added 2899 mutations to 7e24d142adc2427d_1 2024-04-16 21:33:29,652:INFO:neat.read_simulator.runner:Outputting temp vcf for 7e24d142adc2427d1 for later use 2024-04-16 21:33:29,659:INFO:neat.read_simulator.utils.local_file_writer:2899 variants excluded because of target regions with discard off-target enabled_ 2024-04-16 21:33:29,659:INFO:neat.read_simulator.utils.local_file_writer:Finished outputting temp vcf/fasta 2024-04-16 21:33:29,659:INFO:neat.read_simulator.utils.generate_reads:Sampling reads... 2024-04-16 21:33:31,649:ERROR:neat:read-simulator failed, see the traceback below Traceback (most recent call last): File "/home/drinnan/miniconda3/envs/neat/lib/python3.10/site-packages/neat/cli/cli.py", line 133, in main cmd(args) File "/home/drinnan/miniconda3/envs/neat/lib/python3.10/site-packages/neat/cli/commands/read_simulator.py", line 47, in execute read_simulator_runner(arguments.config, arguments.output) File "/home/drinnan/miniconda3/envs/neat/lib/python3.10/site-packages/neat/read_simulator/runner.py", line 333, in read_simulator_runner generate_reads(local_reference, File "/home/drinnan/miniconda3/envs/neat/lib/python3.10/site-packages/neat/read_simulator/utils/generate_reads.py", line 441, in generate_reads __LOG.debug(f"Paired percentage = {len(paired_reads)/len(sam_readorder)}") ZeroDivisionError: division by zero ERROR: read-simulator failed, showing the last error Traceback (most recent call last): File "/home/drinnan/miniconda3/envs/neat/lib/python3.10/site-packages/neat/cli/cli.py", line 133, in main cmd(args) File "/home/drinnan/miniconda3/envs/neat/lib/python3.10/site-packages/neat/cli/commands/read_simulator.py", line 47, in execute read_simulator_runner(arguments.config, arguments.output) File "/home/drinnan/miniconda3/envs/neat/lib/python3.10/site-packages/neat/read_simulator/runner.py", line 333, in read_simulator_runner generate_reads(local_reference, File "/home/drinnan/miniconda3/envs/neat/lib/python3.10/site-packages/neat/read_simulator/utils/generate_reads.py", line 441, in generate_reads _LOG.debug(f"Paired percentage = {len(paired_reads)/len(sam_read_order)}") ZeroDivisionError: division by zero

joshfactorial commented 5 months ago

the disable target regions thing I have not seen, but we have a fix for that divide by zero error in version 4.1.1. I would try that or the latest on main and see if that clears this up.

joshfactorial commented 5 months ago

Will be working on this as soon as time allows.

MTDouglas commented 4 months ago

I am having a very similar issue with the following

[neat_config.yml]: reference: references/nCoV-2019.reference.fasta read_len: 126 ploidy: 1 produce_bam: True produce_vcf: True paired_ended: True fragment_mean: 300 fragment_st_dev: 30 rng_seed: 12345

Running this command neat --no-log read-simulator -c neat_config.yml -o simulation/

And am getting the following error: `2024-05-08 12:41:08,572:INFO:neat.read_simulator.runner:Using configuration file neat_config.yml 2024-05-08 12:41:08,573:INFO:neat.read_simulator.runner:Saving output files to . 2024-05-08 12:41:08,573:INFO:neat.read_simulator.utils.options:Run Configuration... 2024-05-08 12:41:08,573:INFO:neat.read_simulator.utils.options:Input fasta:/references/nCoV-2019.reference.fasta 2024-05-08 12:41:08,573:INFO:neat.read_simulator.utils.options:Producing the following files:

2024-05-08 12:41:08,573:INFO:neat.read_simulator.utils.options:Single threading - 1 thread. 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Running in paired-ended mode. 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Generating fragment model based on mean=300.0, st dev=30.0 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Using a read length of 126 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Average coverage: 10 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Using default error model. 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Ploidy value: 1 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:RNG seed value for run: 12345 2024-05-08 12:41:08,574:INFO:neat.read_simulator.runner:Reading Models... 2024-05-08 12:41:08,574:INFO:neat.read_simulator.runner:Reading references/nCoV-2019.reference.fasta. 2024-05-08 12:41:08,577:INFO:neat.read_simulator.runner:Beginning simulation. 2024-05-08 12:41:08,578:INFO:neat.read_simulator.runner:Generating variants for MN908947.3 2024-05-08 12:41:08,596:INFO:neat.read_simulator.utils.generate_variants:Finished generating random mutations in 0.00 minutes 2024-05-08 12:41:08,597:INFO:neat.read_simulator.utils.generate_variants:Added 25 mutations to MN908947.3 2024-05-08 12:41:08,597:INFO:neat.read_simulator.runner:Outputting temp vcf for MN908947.3 for later use 2024-05-08 12:41:08,597:INFO:neat.read_simulator.utils.local_file_writer:Finished outputting temp vcf/fasta 2024-05-08 12:41:08,597:INFO:neat.read_simulator.utils.generate_reads:Sampling reads... 2024-05-08 12:41:08,615:ERROR:neat:read-simulator failed, see the traceback below Traceback (most recent call last): File /.local/lib/python3.10/site-packages/neat/cli/cli.py", line 133, in main cmd(args) File /.local/lib/python3.10/site-packages/neat/cli/commands/read_simulator.py", line 47, in execute read_simulator_runner(arguments.config, arguments.output) File "/.local/lib/python3.10/site-packages/neat/read_simulator/runner.py", line 333, in read_simulator_runner generate_reads(local_reference, File "/.local/lib/python3.10/site-packages/neat/read_simulator/utils/generate_reads.py", line 441, in generate_reads _LOG.debug(f"Paired percentage = {len(paired_reads)/len(sam_read_order)}") ZeroDivisionError: division by zero ERROR: read-simulator failed, showing the last error Traceback (most recent call last): File "/.local/lib/python3.10/site-packages/neat/cli/cli.py", line 133, in main cmd(args) File "/.local/lib/python3.10/site-packages/neat/cli/commands/read_simulator.py", line 47, in execute read_simulator_runner(arguments.config, arguments.output) File "/.local/lib/python3.10/site-packages/neat/read_simulator/runner.py", line 333, in read_simulator_runner generate_reads(local_reference, File "/.local/lib/python3.10/site-packages/neat/read_simulator/utils/generate_reads.py", line 441, in generate_reads _LOG.debug(f"Paired percentage = {len(paired_reads)/len(sam_read_order)}") ZeroDivisionError: division by zero`

joshfactorial commented 4 months ago

Okay, we are working on this now!


From: MTDouglas @.> Sent: Wednesday, May 8, 2024 11:44 AM To: ncsa/NEAT @.> Cc: Allen, Josh @.>; Assign @.> Subject: Re: [ncsa/NEAT] Division by zero / cant disable target regions with discard (Issue #102)

I am having a very similar issue with the following

[neat_config.yml]: reference: references/nCoV-2019.reference.fasta read_len: 126 ploidy: 1 produce_bam: True produce_vcf: True paired_ended: True fragment_mean: 300 fragment_st_dev: 30 rng_seed: 12345

Running this command neat --no-log read-simulator -c neat_config.yml -o simulation/

And am getting the following error: `2024-05-08 12:41:08,572:INFO:neat.read_simulator.runner:Using configuration file neat_config.yml 2024-05-08 12:41:08,573:INFO:neat.read_simulator.runner:Saving output files to . 2024-05-08 12:41:08,573:INFO:neat.read_simulator.utils.options:Run Configuration... 2024-05-08 12:41:08,573:INFO:neat.read_simulator.utils.options:Input fasta:/references/nCoV-2019.reference.fasta 2024-05-08 12:41:08,573:INFO:neat.read_simulator.utils.options:Producing the following files:

2024-05-08 12:41:08,573:INFO:neat.read_simulator.utils.options:Single threading - 1 thread. 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Running in paired-ended mode. 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Generating fragment model based on mean=300.0, st dev=30.0 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Using a read length of 126 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Average coverage: 10 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Using default error model. 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:Ploidy value: 1 2024-05-08 12:41:08,574:INFO:neat.read_simulator.utils.options:RNG seed value for run: 12345 2024-05-08 12:41:08,574:INFO:neat.read_simulator.runner:Reading Models... 2024-05-08 12:41:08,574:INFO:neat.read_simulator.runner:Reading references/nCoV-2019.reference.fasta. 2024-05-08 12:41:08,577:INFO:neat.read_simulator.runner:Beginning simulation. 2024-05-08 12:41:08,578:INFO:neat.read_simulator.runner:Generating variants for MN908947.3 2024-05-08 12:41:08,596:INFO:neat.read_simulator.utils.generate_variants:Finished generating random mutations in 0.00 minutes 2024-05-08 12:41:08,597:INFO:neat.read_simulator.utils.generate_variants:Added 25 mutations to MN908947.3 2024-05-08 12:41:08,597:INFO:neat.read_simulator.runner:Outputting temp vcf for MN908947.3 for later use 2024-05-08 12:41:08,597:INFO:neat.read_simulator.utils.local_file_writer:Finished outputting temp vcf/fasta 2024-05-08 12:41:08,597:INFO:neat.read_simulator.utils.generate_reads:Sampling reads... 2024-05-08 12:41:08,615:ERROR:neat:read-simulator failed, see the traceback below Traceback (most recent call last): File /.local/lib/python3.10/site-packages/neat/cli/cli.py", line 133, in main cmd(args) File /.local/lib/python3.10/site-packages/neat/cli/commands/read_simulator.py", line 47, in execute read_simulator_runner(arguments.config, arguments.output) File "/.local/lib/python3.10/site-packages/neat/read_simulator/runner.py", line 333, in read_simulator_runner generate_reads(local_reference, File "/.local/lib/python3.10/site-packages/neat/read_simulator/utils/generate_reads.py", line 441, in generate_reads _LOG.debug(f"Paired percentage = {len(paired_reads)/len(sam_read_order)}") ZeroDivisionError: division by zero ERROR: read-simulator failed, showing the last error Traceback (most recent call last): File "/.local/lib/python3.10/site-packages/neat/cli/cli.py", line 133, in main cmd(args) File "/.local/lib/python3.10/site-packages/neat/cli/commands/read_simulator.py", line 47, in execute read_simulator_runner(arguments.config, arguments.output) File "/.local/lib/python3.10/site-packages/neat/read_simulator/runner.py", line 333, in read_simulator_runner generate_reads(local_reference, File "/.local/lib/python3.10/site-packages/neat/read_simulator/utils/generate_reads.py", line 441, in generate_reads _LOG.debug(f"Paired percentage = {len(paired_reads)/len(sam_read_order)}") ZeroDivisionError: division by zero`

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/ncsa/NEAT/issues/102*issuecomment-2100991594__;Iw!!DZ3fjg!-KxS4J8cw8yYlQoJfsGn5DkUA_7-hBoUCP81rLIc98Cve1PB7ewQoYSEJ3h72PviZA9ka7fLuvGc4yTuZzZFYidb352Lmw$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AGMI725RPM23YDJ4XEYLJWLZBJJARAVCNFSM6AAAAABGKN5GQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBQHE4TCNJZGQ__;!!DZ3fjg!-KxS4J8cw8yYlQoJfsGn5DkUA_7-hBoUCP81rLIc98Cve1PB7ewQoYSEJ3h72PviZA9ka7fLuvGc4yTuZzZFYidjsAzY8Q$. You are receiving this because you were assigned.Message ID: @.***>