Skip to content

Commit

Permalink
Properly filter
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Nov 17, 2022
1 parent eb8f3a1 commit b11630a
Show file tree
Hide file tree
Showing 2 changed files with 672 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/import_drugcentral_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ def main():
)
df["type"] = "manually_reviewed"

drugcentral_drugbank_mappings = pyobo.get_filtered_xrefs("drugcentral", "drugbank")

mappings = df.iterrows()
mappings = [
row
for _, row in tqdm(
mappings, unit="mapping", unit_scale=True, total=len(df.index), desc="Pre-Filtering"
)
if row["subject_id"].startswith("DRUGBANK:") and row["object_id"].startswith("DrugCentral")
if (
row["subject_id"].startswith("DRUGBANK:")
and row["object_id"].startswith("DrugCentral:")
and row["object_id"].removeprefix("DrugCentral:") not in drugcentral_drugbank_mappings
)
]
mappings = (
_prepare_mapping(row)
Expand Down
Loading

0 comments on commit b11630a

Please sign in to comment.