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
51f3325f
Commit
51f3325f
authored
Sep 26, 2023
by
Geoffrey Yu
Browse files
update anchor selection function logic
parent
986d1f67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
openfold/utils/loss.py
openfold/utils/loss.py
+7
-12
No files found.
openfold/utils/loss.py
View file @
51f3325f
...
@@ -1789,6 +1789,7 @@ def get_least_asym_entity_or_longest_length(batch,input_asym_id):
...
@@ -1789,6 +1789,7 @@ 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,
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
then choose one of the corresponding subunits as anchor
"""
"""
entity_2_asym_list
=
AlphaFoldMultimerLoss
.
get_entity_2_asym_list
(
batch
)
unique_entity_ids
=
torch
.
unique
(
batch
[
"entity_id"
])
unique_entity_ids
=
torch
.
unique
(
batch
[
"entity_id"
])
entity_asym_count
=
{}
entity_asym_count
=
{}
entity_length
=
{}
entity_length
=
{}
...
@@ -1813,18 +1814,12 @@ def get_least_asym_entity_or_longest_length(batch,input_asym_id):
...
@@ -1813,18 +1814,12 @@ def get_least_asym_entity_or_longest_length(batch,input_asym_id):
if
len
(
least_asym_entities
)
>
1
:
if
len
(
least_asym_entities
)
>
1
:
least_asym_entities
=
random
.
choice
(
least_asym_entities
)
least_asym_entities
=
random
.
choice
(
least_asym_entities
)
assert
len
(
least_asym_entities
)
==
1
assert
len
(
least_asym_entities
)
==
1
# best_pred_asym = torch.unique(batch["asym_id"][batch["entity_id"] == least_asym_entities[0]])
least_asym_entities
=
least_asym_entities
[
0
]
# # # If there is more than one chain in the predicted output that has the same sequence
anchor_gt_asym_id
=
[
id
for
id
in
entity_2_asym_list
[
least_asym_entities
]
if
id
in
input_asym_id
]
# # # as the chosen ground truth anchor, then randomly picke one
best_pred_asym
=
anchor_gt_asym_id
[
0
]
# if len(best_pred_asym) > 1:
anchor_gt_asym_id
=
anchor_gt_asym_id
[
0
]
# selected_best_pred_asym = random.choice(best_pred_asym)
return
anchor_gt_asym_id
,
best_pred_asym
# while selected_best_pred_asym not in input_asym_id:
# selected_best_pred_asym = random.choice(best_pred_asym)
# else:
# selected_best_pred_asym = best_pred_asym
best_pred_asym
=
least_asym_entities
[
0
]
return
least_asym_entities
[
0
],
best_pred_asym
def
greedy_align
(
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