From e1481d0181b902e62c81a20d9298ebdaba5cbc33 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Wed, 2 Nov 2016 12:05:46 -0700 Subject: [PATCH] Addresses #177 --- mark2cure/common/formatter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mark2cure/common/formatter.py b/mark2cure/common/formatter.py index d5230263..db0a5edc 100644 --- a/mark2cure/common/formatter.py +++ b/mark2cure/common/formatter.py @@ -115,9 +115,14 @@ def clean_df(df, overlap_protection=False, allow_duplicates=True): # df = df[df['ann_type'].isin(['Chemical', 'Gene', 'Disease'])] df = df[df['ann_type'].isin(ann_types_arr)] df['ann_type_id'] = 0 + df.ix[df['ann_type'] == 'disease', 'ann_type_id'] = 0 + df.ix[df['ann_type'] == 'gene', 'ann_type_id'] = 1 + df.ix[df['ann_type'] == 'gene_protein', 'ann_type_id'] = 1 # M2C Enum Syntax + df.ix[df['ann_type'] == 'chemical', 'ann_type_id'] = 2 + df.ix[df['ann_type'] == 'drug', 'ann_type_id'] = 2 # M2C Enum Syntax # We're previously DB Primary Keys df.reset_index(inplace=True)