From dd2b36c5a3427c58df0cee332bd4661a3ceb0b4d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 9 Apr 2025 17:02:57 -0500 Subject: Convert PubMed_ID value from file to int --- scripts/phenotypes_bulk_edit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/phenotypes_bulk_edit.py b/scripts/phenotypes_bulk_edit.py index 395b1bb..07104a5 100644 --- a/scripts/phenotypes_bulk_edit.py +++ b/scripts/phenotypes_bulk_edit.py @@ -168,7 +168,7 @@ def __fetch_new_pubmed_ids__(pubmed_ids): return tuple() logger.info("Fetching publications data for the following PubMed IDs: %s", - ", ".join(pubmed_ids)) + ", ".join((str(pid) for pid in pubmed_ids))) # Should we, perhaps, pass this in from a config variable? uri = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi" @@ -343,6 +343,9 @@ def read_file(filepath: Path) -> Iterator[str]: _pheno, _xref = _dict.pop("UniqueIdentifier").split("::") _dict["phenotype_id"] = int(_pheno.split(":")[1]) _dict["xref_id"] = int(_xref.split(":")[1]) + if _dict["PubMed_ID"] is not None: + _dict["PubMed_ID"] = int(_dict["PubMed_ID"]) + yield _dict count = count + 1 -- cgit v1.2.3