-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
Hi,Developer!
How to understand the function reconstruct_multi_models() and what it does to the model.
Best,
Jamie
Note:
amis.py
def reconstruct_multi_models(
wt_seq,
model_names=[
'esm1b',
'esm1v1',
'esm1v2',
'esm1v3',
'esm1v4',
'esm1v5',
],
alpha=None,
return_names=False,
):
mutations_models, mutations_model_names = {}, {}
for model_name in model_names:
model = get_model_name(model_name)
if alpha is None:
wt_new = reconstruct(
wt_seq, model, decode_kwargs={ 'exclude': 'unnatural' }
)
mutations_model = diff(wt_seq, wt_new)
else:
mutations_model = soft_reconstruct(
wt_seq, model, alpha=alpha,
)
for mutation in mutations_model:
if mutation not in mutations_models:
mutations_models[mutation] = 0
mutations_model_names[mutation] = []
mutations_models[mutation] += 1
mutations_model_names[mutation].append(model.name_)
del model
if return_names:
return mutations_models, mutations_model_names
return mutations_models
Metadata
Metadata
Assignees
Labels
No labels