Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
add license data to log
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Dec 13, 2023
1 parent 3c04445 commit 980940f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pgscatalog_utils/scorefile/scoringfileheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 980940f

Please sign in to comment.