Skip to content

Commit

Permalink
Use PatientNode for patients
Browse files Browse the repository at this point in the history
  • Loading branch information
Habush committed Nov 27, 2020
1 parent be7458c commit 1229a55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions atomwrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ class ChebiOntology(CNode):
class NcbiTaxonomy(CNode):
atom_type = 'NcbiTaxonomyNode'

class CPatientNode(CNode):
atom_type = 'PatientNode'

class Entrez(CNode):
atom_type = 'EntrezNode'

Expand Down
2 changes: 1 addition & 1 deletion cancer/patient_gene_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def import_gene_expr(patient_df, overexpr_fp, underexpr_fp):
mean_dict[str(col)] = df[col].median()

for i in range(df.shape[0]):
patient = CConceptNode(str(int(df.iloc[i]["patient_ID"])))
patient = CPatientNode(str(int(df.iloc[i]["patient_ID"])))
for k in mean_dict:
create_member_ln(k, overexpr_fp)
create_member_ln(k, underexpr_fp)
Expand Down
3 changes: 1 addition & 2 deletions cancer/patient_outcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def create_treatment_ln(patient, treatment, value, drugs_df, fp):
"""
if not pd.isna(value) and value != 0:
if treatment == "surgery_type":
eval_ln = CEvaluationLink(CPredicateNode("surgery"), CListLink(patient, CConceptNode(treatment)), stv=CStv(1.0, 1.0))
surgery_type_ln = CEvaluationLink(CPredicateNode("surgery_type"), CListLink(patient, CConceptNode(value)), stv=CStv(1.0, 1.0))
fp.write(surgery_type_ln.recursive_print() + "\n")
else:
Expand Down Expand Up @@ -103,7 +102,7 @@ def import_info(df, drugs_df, fp):
treatment_cols.append('surgery_type')

for i in range(df.shape[0]):
patient = CConceptNode(str(df.iloc[i]["patient_ID"]))
patient = CPatientNode(str(df.iloc[i]["patient_ID"]))
for marker in bool_vals:
create_state_ln(patient, marker, df.iloc[i][marker], fp)

Expand Down

0 comments on commit 1229a55

Please sign in to comment.