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

Empty bgen file might cause division by zero. #36

Open
horta opened this issue Oct 12, 2020 · 0 comments
Open

Empty bgen file might cause division by zero. #36

horta opened this issue Oct 12, 2020 · 0 comments

Comments

@horta
Copy link
Collaborator

horta commented Oct 12, 2020

Empty bgen file being one with no genotype but with samples. Marc found the following exception with such a file:

Traceback (most recent call last):
  File "/hps/nobackup/stegle/users/galvari/src/hipsci_pipeline/limix_QTL_pipeline/run_QTL_analysis.py", line 813, in <module>
    randomeff_filename=randeff_file, sample_mapping_filename=samplemap_file, extended_anno_filename=extended_anno_file, regressCovariatesUpfront = regressBefore, debugger= debugger)
  File "/hps/nobackup/stegle/users/galvari/src/hipsci_pipeline/limix_QTL_pipeline/run_QTL_analysis.py", line 64, in run_QTL_analysis
    extended_anno_filename=extended_anno_filename, feature_variant_covariate_filename=feature_variant_covariate_filename)
  File "/hps/nobackup/stegle/users/galvari/src/hipsci_pipeline/limix_QTL_pipeline/qtl_utilities.py", line 90, in run_QTL_analysis_load_intersect_phenotype_covariates_kinship_sample_mapping
    bgen = read_bgen(geno_prefix+'.bgen', verbose=False)
  File "/opt/conda/lib/python3.7/site-packages/bgen_reader/_reader.py", line 81, in read_bgen
    create_metafile(filepath, metafile_filepath, verbose)
  File "/opt/conda/lib/python3.7/site-packages/bgen_reader/_metadata.py", line 57, in create_metafile
    nparts = _estimate_best_npartitions(lib.bgen_nvariants(bgen))
  File "/opt/conda/lib/python3.7/site-packages/bgen_reader/_metadata.py", line 69, in _estimate_best_npartitions
    return nvariants // m
ZeroDivisionError: integer division or modulo by zero
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