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

Remove information_content values from node_bindings in NodeNorm output #244

Open
gaurav opened this issue Dec 29, 2023 · 0 comments
Open

Comments

@gaurav
Copy link
Contributor

gaurav commented Dec 29, 2023

While PR #231 fixed #229, it also introduced an odd change in NodeNorm's behavior: while we were previously not including any attributes in the resulting node_bindings, the fixed code now includes information content as well as potentially other attributes in the results node bindings. Here is some example output from babel-validation:

"node_bindings": {
  "n0": [
      {
        "id": "PUBCHEM.COMPOUND:130881",
        "attributes": [
          {
            "attribute_type_id": "biolink:has_numeric_value",
            "value": 100.0,
            "value_type_id": "EDAM:data_0006",
            "original_attribute_name": "information_content"
          }
        ]
      }
    ],
    "n1": [
      {
        "id": "MONDO:0001134",
        "attributes": [
          {
            "attribute_type_id": "biolink:has_numeric_value",
            "value": 83.0,
            "value_type_id": "EDAM:data_0006",
            "original_attribute_name": "information_content"
          }
        ]
      }
  ]
}

@uhbrar has requested that attributes passed in should be kept in results.[].node_bindings but new attributes should not be added. Note that IC values are also included in theknowledge_graph -- those should continue to be included. The relevant code is linked below:

# get the information content value
ic_attrib = await get_info_content_attribute(app, merged_binding['id'])
# did we get a good attribute dict
if ic_attrib:
if 'attributes' in merged_binding and merged_binding['attributes'] is not None:
merged_binding['attributes'].append(ic_attrib)
else:
merged_binding['attributes'] = [ic_attrib]
node_binding_information = [
"atts" if k == 'attributes'
else (k, tuple(v)) if isinstance(v, list)
else (k, v)
for k, v in merged_binding.items()
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant