Skip to content

Commit

Permalink
adding data of curation for HPOA
Browse files Browse the repository at this point in the history
  • Loading branch information
pnrobinson committed Apr 13, 2024
1 parent cbd340a commit 6947e7d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pyphetools/creation/case_template_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ def _process_header(self, header_1:List, header_2:List, hpo_cr:HpoConceptRecogn
h2 = header_2[i]
if isinstance(h1, float) or len(h1) == 0:
raise ValueError(f"Error: Empty column header at column {i}")

if h1 == "HPO":
in_hpo_range = True
index_to_decoder_d[i] = NullEncoder()
Expand Down Expand Up @@ -403,7 +402,7 @@ def _parse_individual(self, row:pd.Series):
vitStat = None
if "deceased" in data_items:
decsd = data_items.get("deceased")
if encounter_age.is_valid():
if decsd == "yes" and encounter_age.is_valid():
timeelem = encounter_age.to_ga4gh_time_element()
vitStat = VitalStatus(status=VitalStatus.Status.DECEASED, time_of_death=timeelem)
else:
Expand Down Expand Up @@ -512,7 +511,7 @@ def output_individuals_as_phenopackets(self, individual_list:List[Individual], o
else:
pmid = pmid.replace(" ", "").replace(":", "_")
fname = pmid + "_" + individual.id
fname = re.sub('[^A-Za-z0-9_-]', '', fname) # remove any illegal characters from filename
fname = re.sub('[^A-Za-z0-9\_\-]', '', fname) # remove any illegal characters from filename
fname = fname.replace(" ", "_") + ".json"
outpth = os.path.join(outdir, fname)
with open(outpth, "wt") as fh:
Expand Down

0 comments on commit 6947e7d

Please sign in to comment.