Skip to content

Commit

Permalink
add prefixes to reactome properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesamcl committed Jun 11, 2024
1 parent b99f77e commit 40bfeb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions 01_ingest/grebi_ingest_reactome/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ fn main() {
let labels = obj.get("labels").unwrap().as_array().unwrap();
let id = "reactome_".to_owned() + neo_id;

let mut out_props = properties.clone();
let mut out_props = serde_json::Map::new();
for (k, v) in properties {
out_props.insert("reactome:".to_owned() + k, v.clone());
}
out_props.insert("grebi:type".to_string(), Value::Array(labels.iter().map(|v| Value::String("reactome:".to_owned() + v.as_str().unwrap())).collect::<Vec<Value>>()));

let mut equivalences:Vec<Value> = Vec::new();
Expand Down Expand Up @@ -118,9 +121,14 @@ fn main() {
let mut out_props = serde_json::Map::new();
out_props.insert("id".to_string(), Value::String("reactome_".to_owned() + start_id));

let new_props = serde_json::Map::new();
for (k, v) in obj.get("properties").unwrap().as_object().unwrap() {
out_props.insert("reactome:".to_owned() + k, v.clone());
}

out_props.insert("reactome:".to_owned() + label, json!([{
"grebi:value": Value::String("reactome_".to_owned() + end_id),
"grebi:properties": arrayify( obj.get("properties").unwrap().clone() )
"grebi:properties": arrayify( Value::Object( new_props ) )
}]));

output_nodes.write_all(serde_json::to_string(&out_props).unwrap().as_bytes()).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion configs/pipeline_configs/ebi_full_monarch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"monarch:iri"
],
"additional_equivalence_groups": [
["grebi:name", "ols:label", "rdfs:label", "monarch:name", "impc:name"],
["grebi:name", "ols:label", "rdfs:label", "monarch:name", "impc:name", "reactome:displayName"],
["grebi:description", "iao:definition", "monarch:description", "ols:definition"],
["grebi:synonym", "monarch:synonym", "iao:alternative_label", "ols:synonym"],
["mondo:0000001", "ogms:0000031"]
Expand Down

0 comments on commit 40bfeb8

Please sign in to comment.