-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
colocalization: add method to classify binding order
- Loading branch information
1 parent
94b5132
commit e1637c9
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
def classify_track(red, blue, timing_window=6): | ||
"""This function classifies the tracks into groups based on the order in which | ||
the proteins bind""" | ||
|
||
# 3 blue_start < red_start blue_end < red_end | ||
# 4 blue_start < red_start blue_end = red_end | ||
# 5 blue_start < red_start blue_end > red_end | ||
|
||
# 6 blue_start = red_start blue_end < red_end | ||
# 7 blue_start = red_start blue_end = red_end | ||
# 8 blue_start = red_start blue_end > red_end | ||
|
||
# 9 red_start < blue_start blue_end < red_end | ||
# 10 red_start < blue_start blue_end = red_end | ||
# 11 red_start < blue_start blue_end > red_end | ||
|
||
def classify(time, ref_time): | ||
if ref_time - time > timing_window: | ||
return 0 | ||
elif time - ref_time > timing_window: | ||
return 2 | ||
else: | ||
return 1 | ||
|
||
return ( | ||
3 | ||
+ 3 * classify(blue.time_idx[0], red.time_idx[0]) | ||
+ classify(blue.time_idx[-1], red.time_idx[-1]) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters