Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
cb43a5b3
Commit
cb43a5b3
authored
Sep 28, 2023
by
Geoffrey Yu
Browse files
anchor selection funciton now returns a list of possible pred anchors
parent
f6cc4a16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
openfold/utils/loss.py
openfold/utils/loss.py
+11
-4
No files found.
openfold/utils/loss.py
View file @
cb43a5b3
...
...
@@ -1788,6 +1788,14 @@ def get_least_asym_entity_or_longest_length(batch,input_asym_id):
If there is a tie, e.g. AABB, first check which sequence is the longer/longest,
then choose one of the corresponding subunits as anchor
Args:
batch: in this funtion batch is the full ground truth features
input_asym_id: A list of aym_ids that are in the cropped input features
Return:
anchor_gt_asym_id: Tensor(int) selected ground truth asym_id
anchor_pred_asym_ids: list(Tensor(int)) a list of all possible pred anchor candidates
"""
entity_2_asym_list
=
AlphaFoldMultimerLoss
.
get_entity_2_asym_list
(
batch
)
unique_entity_ids
=
torch
.
unique
(
batch
[
"entity_id"
])
...
...
@@ -1816,10 +1824,9 @@ def get_least_asym_entity_or_longest_length(batch,input_asym_id):
assert
len
(
least_asym_entities
)
==
1
least_asym_entities
=
least_asym_entities
[
0
]
anchor_gt_asym_id
=
[
id
for
id
in
entity_2_asym_list
[
least_asym_entities
]
if
id
in
input_asym_id
]
best_pred_asym
=
anchor_gt_asym_id
[
0
]
anchor_gt_asym_id
=
anchor_gt_asym_id
[
0
]
return
anchor_gt_asym_id
,
best_pred_asym
anchor_gt_asym_id
=
random
.
choice
(
entity_2_asym_list
[
least_asym_entities
])
anchor_pred_asym_ids
=
[
id
for
id
in
entity_2_asym_list
[
least_asym_entities
]
if
id
in
input_asym_id
]
return
anchor_gt_asym_id
,
anchor_pred_asym_ids
def
greedy_align
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment