EBISPOT / gwas-sumstats-tools

Apache License 2.0
7 stars 1 forks source link

bugfix: remove extra quote and use `get()` instead of `[]` in case config_dict is empty #39

Closed jaamarks closed 3 months ago

jaamarks commented 3 months ago

This PR fixes two issues we noticed when running poetry run pytest. Both issues were in gwas_sumstats_tools/format.py

  1. Remove extra quotation causing an error.
  2. Fix one arm of a conditional statement that would throw a KeyError when config_dict was empty. In particular, when you try to access a value in a Python dictionary using [<key>] and the key is missing, it will cause a KeyError. So we fix this by using the get(<key>) function instead.
jaamarks commented 3 months ago

Actually, even though pytest passes we are still getting an error when trying to run without a data_outfile specified.

gwas-ssf format gwas_results.tsv.gz --generate_config
image