opain / GenoPred

Genotype-based Prediction (GenoPred)
https://opain.github.io/GenoPred/
GNU General Public License v3.0
68 stars 23 forks source link

Error: no such table: Variant #122

Closed poppyzenzi closed 2 months ago

poppyzenzi commented 2 months ago

Hi Oliver,

I have GenoPred set up and running on the test data. I am trying to test on chr22 for my own input and am getting the following error below. It seems the .bgen file isn't being read correctly? I have used these files with multiple programmes before and haven't had issues. To note I made the corresponding .bgi files with bgenix from the command line. Thanks for any help!

Error from log file:

Error: no such table: Variant
Execution halted

Command:

snakemake -j1 --configfile=aoDEP_ALSPAC_input/config.yaml --use-conda -p output_all

Output error:

Error in rule format_target_i:
    jobid: 6
    input: aoDEP_data/target/alspac_imputed_bgen/data.chr22.bgen, resources/data/ref/ref.pop.txt, resources/software/install_genoutils.done, resources/last_version.txt
    output: aoDEP_data/output/run1/alspac_bgen/geno/alspac_bgen.ref.chr22.pgen
    log: aoDEP_data/output/run1/reference/logs/format_target_i-alspac_bgen-22.log (check log file(s) for error details)
    conda-env: /gpfs/igmmfs01/eddie/GenScotDepression/users/poppy/GenoPred/pipeline/.snakemake/conda/060155e7ca6005953d71297d34801ddc_
    shell:
        Rscript ../Scripts/format_target/format_target.R         --target aoDEP_data/target/alspac_imputed_bgen/data.chr22         --format bgen         --ref resources/data/ref/ref.chr22         --output aoDEP_data/output/run1/alspac_bgen/geno/alspac_bgen.ref.chr22 > aoDEP_data/output/run1/reference/logs/format_target_i-alspac_bgen-22.log 2>&1
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2024-10-01T150321.019028.snakemake.log
opain commented 2 months ago

Hello,

Thank you for the clear report of the issue.

Please could you check the tables in one of the .bgi files. You can do this in R using this code:

library(RSQLite)
connection = dbConnect(RSQLite::SQLite(), 'aoDEP_data/target/alspac_imputed_bgen/data.chr22.bgen.bgi')
tables <- dbListTables(connection)
print(tables)

There should be one called 'Variant'. If there isn't you may need to recreate the index files. Or maybe it is called something else that GenoPred does not currently allow for. Lets see. This is the code I have used in the past to create .bgi files in case useful:

bgenix -index -g example.chr22.bgen
poppyzenzi commented 2 months ago

Ah thank you so much! The command I used to make the .bgi files must have been incorrect. I have recreated using the above command and the pipeline is running now.