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

File "ncm.py", line 1453, in <module> File "ncm.py", line 222, in createDataSetFromDir ZeroDivisionError: float division by zero #51

Open
kbarrr opened this issue Mar 10, 2024 · 6 comments

Comments

@kbarrr
Copy link

kbarrr commented Mar 10, 2024

code: python ncm.py -B -f -l M1M2.txt -O M1M2_results -N outputfile_prefix -bed SNP_GRCh38_hg38_wChr.bed

WARNNING : NCM_HOME is not defined yet. Therefore, program will try to search ncm.conf file from the current directory
1.6
/home/seisbio/mambaforge/envs/ngscheckmate-env/bin/samtools mpileup -uf GCA_000001405.29_GRCh38.p14_genomic.fna -l SNP_GRCh38_hg38_wChr.bed M1_dedup_filtrado_sorted.bam | /home/seisbio/mambaforge/envs/ngscheckmate-env/bin/bcftools call -c > M1M2_results/M1_dedup_filtrado_sorted.vcf
[mpileup] 1 samples in 1 input files
Note: none of --samples-file, --ploidy or --ploidy-file given, assuming all sites are diploid
Set max per-file depth to 8000
/home/seisbio/mambaforge/envs/ngscheckmate-env/bin/samtools mpileup -uf GCA_000001405.29_GRCh38.p14_genomic.fna -l SNP_GRCh38_hg38_wChr.bed M2_dedup_filtrado_sorted.bam | /home/seisbio/mambaforge/envs/ngscheckmate-env/bin/bcftools call -c > M1M2_results/M2_dedup_filtrado_sorted.vcf
[mpileup] 1 samples in 1 input files
Note: none of --samples-file, --ploidy or --ploidy-file given, assuming all sites are diploid
Set max per-file depth to 8000
Generate Data Set from M1M2_results
using this bed file : SNP_GRCh38_hg38_wChr.bed
Traceback (most recent call last):
File "ncm.py", line 1453, in
createDataSetFromDir(base_dir,bedFile)
File "ncm.py", line 222, in createDataSetFromDir
real_depth[file] = depth[file] / float(real_count[file])
ZeroDivisionError: float division by zero

someone can help?

@SooLee
Copy link
Member

SooLee commented Mar 11, 2024 via email

@kbarrr
Copy link
Author

kbarrr commented Apr 1, 2024

Hello. No, the bam file is not empty. However i tried with fastq files and worked perfectly!!!

@shashwatsahay
Copy link

Same error here!!!!

Any solutions will be deeply appreciated

first time around it ran without hiccups though

@SooLee
Copy link
Member

SooLee commented Apr 18, 2024 via email

@shashwatsahay
Copy link

nope that wasn't the case interestingly if i just re-ran it it worked fine which confuses me even further

@ls233
Copy link

ls233 commented Aug 8, 2024

dear author, thanks for sharing this useful utility.

I noticed that for some shallow BAM files, your utility generate the following error:

NGSCheckMate/ncm.py", line 220, in createDataSetFromDir
real_depth[file] = depth[file] / float(real_count[file])
ZeroDivisionError: float division by zero

Would it be possible to validate the BAM file in the preflight so that your utility can be integrated into larger pipelines without risking to fail the larger run?

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

4 participants