From 980940f83366fed49e26f944d39a941b7872b36d Mon Sep 17 00:00:00 2001 From: Benjamin Wingfield Date: Wed, 13 Dec 2023 11:23:10 +0000 Subject: [PATCH] add license data to log --- pgscatalog_utils/scorefile/scoringfileheader.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pgscatalog_utils/scorefile/scoringfileheader.py b/pgscatalog_utils/scorefile/scoringfileheader.py index a06622a..06d7f10 100644 --- a/pgscatalog_utils/scorefile/scoringfileheader.py +++ b/pgscatalog_utils/scorefile/scoringfileheader.py @@ -21,6 +21,11 @@ class ScoringFileHeader: HmPOS_build: GenomeBuild HmPOS_date: str format_version: str + license: str = ( + "PGS obtained from the Catalog should be cited appropriately, and " + "used in accordance with any licensing restrictions set by the authors. See EBI " + "Terms of Use (https://www.ebi.ac.uk/about/terms-of-use/) for additional details." + ) def __post_init__(self): if self.variants_number: @@ -38,6 +43,11 @@ def from_path(cls, path: pathlib.Path): header_dict = {k: raw_header.get(k) for k in keep_keys} # ... so we can unpack the dict into a dataclass + if header_dict.get("license") is None: + # missing license data in header means default license + # (this may change in the future) + header_dict["license"] = cls.license + if "HmPOS_build" not in header_dict: # working with pgs catalog formatted header but unharmonised data header_dict["HmPOS_build"] = None