Use root-types to control input/output associations #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #29
When looking at GO-CAMs on NDEx, we noticed a lot of them had nodes (representing
Activity
instances) connected by both a direct regulation edge and a has input/output edge. See the linked issue for an example.While we found the issue while looking at a rendering of the CX2 representation of GO-CAMs, these changes actually address the issue in the
MinervaWrapper
class where we convert from Minerva's JSON format into thegocam-py
data model.The logic here is to make more use of the
root-types
field in the Minerva format. In particular, these changes reflect a bit of pathway widget logic by checking that the object of a has input/output relationship hasCHEBI:24431
(chemical entity) as a root type, but notCHEBI:33695
(information biomacromolecule) before adding aMoleculeAssociation
. This is supported by tracking all of an individual'sroot-types
(previously only one of them was tracked).With these changes in place, no additional changes to the CX2 conversion process were needed. Here's an example of what the rendered CX2 for the example in #29 looks like with these changes after doing the full Minerva ->
Model
-> CX2: