Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes issue number EBISPOT#46 by not attempting to set inferred values dependent on GWAS Catalog ID if not available.
  • Loading branch information
teaguesterling authored Nov 6, 2024
1 parent 0cde0fb commit b13916d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gwas_sumstats_tools/interfaces/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,15 @@ def get_file_metadata(in_file: Path, out_file: str, meta_dict: dict = {}) -> dic
Metadata dict
"""
inferred_meta_dict = {}
inferred_meta_dict['gwas_id'] = parse_accession_id(filename=in_file)
inferred_meta_dict['data_file_name'] = Path(out_file).name
inferred_meta_dict['file_type'] = 'GWAS-SSF v1.0'
inferred_meta_dict['genome_assembly'] = GENOME_ASSEMBLY_MAPPINGS.get(parse_genome_assembly(filename=in_file), 'unknown')
inferred_meta_dict['data_file_md5sum'] = get_md5sum(out_file) if Path(out_file).exists() else None
inferred_meta_dict['date_metadata_last_modified'] = date.today()
inferred_meta_dict['gwas_catalog_api'] = GWAS_CAT_API_STUDIES_URL + parse_accession_id(filename=in_file)
gwas_id = parse_accession_id(filename=in_file)
if gwas_id is not None:
inferred_meta_dict['gwas_id'] = gwas_id
inferred_meta_dict['gwas_catalog_api'] = GWAS_CAT_API_STUDIES_URL + gwas_id
for field, value in inferred_meta_dict.items():
update_dict_if_not_set(meta_dict, field, value)
return meta_dict
Expand Down

0 comments on commit b13916d

Please sign in to comment.