Skip to content

Commit

Permalink
add a filtered list for useless drugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chunyuma committed Jul 10, 2023
1 parent 7e06641 commit 065565a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/ARAX/ARAXQuery/ARAX_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ def __drug_treatment_graph_expansion(self, describe=False):
# with open(os.path.sep.join([*pathlist[:(RTXindex + 1)], 'code', 'ARAX', 'ARAXQuery', 'Infer', 'data',"result_from_self_predict_top_M_paths.pkl"]),"rb") as fid:
# top_paths = pickle.load(fid)

## Filter useless nodes
filtered_list = ['UMLS:C1611640']
top_drugs = top_drugs.loc[~top_drugs['drug_id'].isin(filtered_list),:].reset_index(drop=True)

## Limit the number of drugs and paths to the top n
top_drugs = top_drugs.iloc[:self.parameters['n_drugs'],:].reset_index(drop=True)
top_paths = {(row[0], row[2]):top_paths[(row[0], row[2])][:self.parameters['n_paths']] for row in top_drugs.to_numpy() if (row[0], row[2]) in top_paths}
Expand Down

0 comments on commit 065565a

Please sign in to comment.