Skip to content

float division by zero error #41

@Saannah

Description

@Saannah

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions