Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float division by zero error #41

Open
Saannah opened this issue Apr 19, 2023 · 0 comments
Open

float division by zero error #41

Saannah opened this issue Apr 19, 2023 · 0 comments

Comments

@Saannah
Copy link

Saannah commented Apr 19, 2023

Hi! I am hoping to use Gretel to retrieve haplotypes from a set of BAM files. When I run Gretel, though, I get the following error:

[None]
[NOTE] Loaded 0 breadcrumbs from 0 bread slices.
Traceback (most recent call last):
  File "/home/sanna/gretel_Env/bin/gretel", line 8, in <module>
    sys.exit(main())
  File "/home/sanna/gretel_Env/lib/python3.8/site-packages/gretel/cmd.py", line 78, in main
    hansel = util.load_from_bam(ARGS.bam, ARGS.contig, ARGS.start, ARGS.end, VCF_h, n_threads=ARGS.threads, debug_reads=debug_reads, debug_pos=debug_pos, stepper="all" if ARGS.pepper else "samtools")
  File "/home/sanna/gretel_Env/lib/python3.8/site-packages/gretel/util.py", line 333, in load_from_bam
    hansel.L = int(ceil(float(total_covered_snps.value)/n_reads.value))
ZeroDivisionError: float division by zero

The command I am running is:
gretel set_1_ivartrim_sorted.bam output.vcf.gz "ENA|MN908947|MN908947.3" -s 80 -e 100 --pepper

I tried running it with, and without --pepper, and the same error occurs. I also checked using samtools whether the region I am asking for (80-100) has any coverage at all, and it does.

I was wondering if you could please help me with this? I have uploaded the files I used to run the command in a google drive linked here (BAM file + its index, VCF file + its index):
https://drive.google.com/drive/folders/1elkSfPFIaYOUGeotFB8bY_VwXFjoShAC?usp=share_link

I would appreciate your help!

Cheers,
Sana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant