This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 656
/
symmetric_binding.py
64 lines (55 loc) · 2.12 KB
/
symmetric_binding.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from copy import deepcopy
from biotite.database.rcsb import fetch
from biotite.structure import AtomArray
from language import (
ConstantSequenceSegment,
FixedLengthSequenceSegment,
MaximizePLDDT,
MaximizePTM,
MaximizeSurfaceExposure,
MinimizeCRmsd,
MinimizeDRmsd,
MinimizeSurfaceHydrophobics,
ProgramNode,
SymmetryRing,
get_atomarray_in_residue_range,
pdb_file_to_atomarray,
sequence_from_atomarray,
)
def symmetric_binding_il10(num_binding_sites: int = 3) -> ProgramNode:
binding_site_atoms: AtomArray = pdb_file_to_atomarray(fetch("1y6k", format="pdb"))
binding_site_atoms = get_atomarray_in_residue_range(
binding_site_atoms, start=31, end=40
)
binding_site_sequence: str = sequence_from_atomarray(binding_site_atoms)
leader_amino_acid_sequence = FixedLengthSequenceSegment(45)
binding_site_sequence = ConstantSequenceSegment(binding_site_sequence)
follower_amino_acid_sequence = FixedLengthSequenceSegment(45)
def _binder_protomer_program() -> ProgramNode:
return ProgramNode(
children=[
ProgramNode(sequence_segment=leader_amino_acid_sequence),
ProgramNode(
sequence_segment=binding_site_sequence,
energy_function_terms=[
MaximizeSurfaceExposure(),
MinimizeCRmsd(template=binding_site_atoms),
MinimizeDRmsd(template=binding_site_atoms),
],
energy_function_weights=[1.0, 10.0, 10.0],
),
ProgramNode(sequence_segment=follower_amino_acid_sequence),
]
)
return ProgramNode(
energy_function_terms=[
MaximizePTM(),
MaximizePLDDT(),
SymmetryRing(),
MinimizeSurfaceHydrophobics(),
],
children=[_binder_protomer_program() for _ in range(num_binding_sites)],
)