forked from facebookresearch/esm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixed_backbone.py
39 lines (31 loc) · 1.1 KB
/
fixed_backbone.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
# 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 (
FixedLengthSequenceSegment,
MaximizePLDDT,
MaximizePTM,
MinimizeCRmsd,
MinimizeDRmsd,
MinimizeSurfaceHydrophobics,
ProgramNode,
pdb_file_to_atomarray,
sequence_from_atomarray,
)
def fixed_backbone_6mrs() -> ProgramNode:
template_atoms: AtomArray = pdb_file_to_atomarray(fetch("6mrs", format="pdb"))
sequence_length = len(sequence_from_atomarray(template_atoms))
sequence = FixedLengthSequenceSegment(sequence_length)
return ProgramNode(
sequence_segment=sequence,
energy_function_terms=[
MaximizePTM(),
MaximizePLDDT(),
MinimizeSurfaceHydrophobics(),
MinimizeCRmsd(template=template_atoms, backbone_only=True),
MinimizeDRmsd(template=template_atoms, backbone_only=True),
],
)