Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robokop v5.0 #92

Merged
merged 6 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dags/dug_helpers/dug_utils.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this looks fine, but I'm going to have to bring this over into the DugPipeline class at some point. What does the addition of line 391 do here? I just want to make sure I'm clear.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

total_items is one of the keys that is returned in the response. it looks something like

{ "total_items": 100 
  "dbgap" : {"elements" : [...]}
  "cde" : {"elements" : [...]}
  }

When doing the reduce on line 393 this causes problems since we are trying to gather element IDs and the total items key is an outlier

Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ def _search_elements(self, curie, search_term):
raise Exception(f"Validation error - Did not find {curie} for"
f"Search term: {search_term}")
else:
del response['total_items']
for element_type in response:
all_elements_ids = [e['id'] for e in
reduce(lambda x, y: x + y['elements'], response[element_type], [])]
Expand Down Expand Up @@ -434,12 +435,15 @@ def crawl_concepts(self, concepts, data_set_name):
casting_config = query['casting_config']
tranql_source = query['tranql_source']
dug_element_type = query['output_dug_type']
extracted_dug_elements += crawler.expand_to_dug_element(
new_elements = crawler.expand_to_dug_element(
concept=concept,
casting_config=casting_config,
dug_element_type=dug_element_type,
tranql_source=tranql_source
)
log.debug("extracted:")
log.debug(str(list([el.get_searchable_dict() for el in new_elements])))
extracted_dug_elements += new_elements
concept.clean()
percent_complete = int((counter / total) * 100)
if percent_complete % 10 == 0:
Expand Down
12 changes: 12 additions & 0 deletions dags/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ kgx:
files:
- cde/annotated_edges_v4.0.jsonl
- cde/annotated_nodes_v4.0.jsonl
- version: v5.0
name: baseline-graph
format: jsonl
files:
- baseline-5.0/edges_v5.0.jsonl
- baseline-5.0/nodes_v5.0.jsonl
- version: v5.0
name: cde-graph
format: jsonl
files:
- cde/annotated_edges_v5.0.jsonl
- cde/annotated_nodes_v5.0.jsonl
dug_inputs:
versions:
- name: bdc
Expand Down
4 changes: 2 additions & 2 deletions dags/roger/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ annotation_base_data_uri: https://stars.renci.org/var/dug/

kgx:
biolink_model_version: v3.1.2
dataset_version: v4.0
dataset_version: v5.0
merge_db_id: 1
merge_db_temp_dir: workspace
data_sets:
Expand Down Expand Up @@ -85,7 +85,7 @@ indexing:
desc: "summary"
collection_name: "cde_category"
collection_id: "cde_category"
collection_action: "files"
action: "files"

elasticsearch:
host: elasticsearch
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ flatten-dict
redisgraph-bulk-loader==0.12.3
pytest
PyYAML
git+https://github.com/helxplatform/dug@2.12.0
git+https://github.com/helxplatform/dug@cde-links-2
orjson
kg-utils==0.0.6
bmt==1.1.0
linkml-runtime==1.6.0