-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add support for Negative BEL #408
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #408 +/- ##
==========================================
+ Coverage 86.48% 86.54% +0.06%
==========================================
Files 147 147
Lines 7116 7120 +4
Branches 949 952 +3
==========================================
+ Hits 6154 6162 +8
+ Misses 749 745 -4
Partials 213 213 Continue to review full report at Codecov.
|
Cool! |
#: The key for negative edges | ||
NEGATIVE = 'negative' | ||
#: The tag for negative edges | ||
NEGATIVE_TAG = '~' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the pandas reference haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In python the ~
is always the unary negation operator, not just in pandas :)
@@ -250,6 +250,10 @@ def get_cache_connection() -> str: | |||
|
|||
#: The key for an internal edge data dictionary for the relation string | |||
RELATION = 'relation' | |||
#: The key for negative edges | |||
NEGATIVE = 'negative' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont like negative a lot but to be honest I cant think of something beetter
This PR adds support for specifying "negative knowledge" in BEL.
BEL Update
This means you can now write BEL statements reflecting things that have been found to not be true, such as
We found that Protein X does not activate Protein Y
. This would translate toAll you have to do is add the
~
before the relationship and it knows what to do. It's also allowed that no space is provided depending on style preference.Not sure how I feel about how this looks with the short forms
PyBEL Data Model Update
This change is backwards compatible, but now you can check with a given
EdgeData
if there is anegative
flag.Reasoning
The existence of a positive polar statement should imply the negative antipolar statement. For example,
increases
implies~decreases
,positiveCorrelation
implies~negativeCorrelation
Note for causal relations that
causesNoChange
is equivalent to~regulates
increases
~decreases
decreases
~increases
causesNoChange
~regulates
,~decreases
,~increases
~regulates
causesNoChange
,~decreases
,~increases
~decreases ^ ~increases
~regulates
regulates ^ ~decreases
~increases
regulates ^ ~increases
~decreases
Note for correlative relations that
noCorrelation
is equivalent to~correlation
positiveCorrelation
~negativeCorrelation
negativeCorrelation
~positiveCorrelation
noCorrelation
~correlation
,~positiveCorrelation
,~negativeCorrelation
~correlation
noCorrelation
,~positiveCorrelation
,~negativeCorrelation
~positiveCorrelation ^ ~negativeCorrelation
~correlation
correlation ^ ~positiveCorrelation
negativeCorrelation
correlation ^ ~negativeCorrelation
positiveCorrelation
TODO
~