pyrosetta-12De Novo Protein Design with PyRosetta

Overview

import Bio.Data.IUPACData as IUPACData
import Bio.SeqUtils
import logging
logging.basicConfig(level=logging.INFO)
import os
import pyrosetta
import pyrosetta.distributed
import pyrosetta.distributed.viewer as viewer
import site
import sys

Initialize PyRosetta:

flags = """
-linmem_ig 10
-ignore_unrecognized_res 1
-mute core.select.residue_selector.SecondaryStructureSelector
-mute core.select.residue_selector.PrimarySequenceNeighborhoodSelector
-mute protocols.DsspMover
"""
pyrosetta.distributed.init(flags)

让我们设置PDB的从头螺旋的pose,以进行下游设计:5J0J

start_pose = pyrosetta.io.pose_from_file("inputs/5J0J.clean.pdb")
pose = start_pose.clone()

Design Strategy

最小化晶体结构坐标,然后将链“ A”转换为聚丙氨酸,然后执行one-side的蛋白质 - 蛋白质界面设计链,同时仅re-packing链B和C的同构体界面残基。因此,我们将同构二聚体设计到异聚合物中。此外,使用FastDesign Mover,防止骨架扭转最小化并最小化同构聚合物界面和所有链A的侧链。设计后,repack并最小化所有侧链。
在设计之前和之后,我们希望用打分函数relax蛋白质,packs 侧链,并最大程度地减少侧链自由度,同时优化真正的能量。如果要允许主链最小化(可以进行选择),我们将希望使用笛卡尔得分功能(在这种情况下为ref2015_cart.wts),自动设置cart_bonded 的得分权重为1,这有助于关闭主链中的链断裂。同样,还需要打开coortion_constraint scoreterm,以惩罚骨干坐标在最小化过程中与其初始坐标的偏差。在本教程中,我们证明了这个概念,但会防止骨干扭转最小化(但是,请随时打开骨干最小化!):

relax_scorefxn = pyrosetta.create_score_function("ref2015_cart.wts")
relax_scorefxn.set_weight(pyrosetta.rosetta.core.scoring.ScoreType.coordinate_constraint, 1.0)
print("The starting pose total_score is {}".format(relax_scorefxn(start_pose)))
The starting pose total_score is 23016.581015295596

对于设计,如果我们允许骨干最小化,我们将再次打开坐标contraint ScoreTerm,以惩罚在最小化过程中骨干坐标与初始坐标的偏差。此外,我们将使用“non-pairwise decomposable”评分体来指导packer的轨迹(即固定的骨干序列设计轨迹),以解决我们的假设的设计要求来解决生物学问题。

  1. aa_composition: This scoring term is intended for use during design, to penalize deviations from a desired residue type composition. Applies to any amino acid composition requirements specified by the user within a ResidueSelector. This scoreterm also applies to the AddHelixSequenceConstraints mover which sets up ideal sequence constraints for each helix in a pose or in a selection.(该评分术语旨在在设计过程中使用,以惩罚与所需氨基酸残基组合物种类的偏差。适用于用户在ResidueSelector中指定氨基酸的需求。该评分表也适用于AddHelixSequenceconconstraints Mover,他为pose或selection中的每个螺旋都设置了理想的序列约束。)
  2. voids_penalty:This scoring term is intended for use during design, to penalize buried voids or cavities and to guide the packer to design solutions in which all buried volume is filled with side-chains.(该评分术语旨在在设计期间使用,以惩罚埋藏的空隙或腔体,并指导packer设计解决方案,方案中所有埋藏的体积都充满了侧链。)
  3. aa_repeat: This wholebody scoring term is intended for use during design, to penalize long stretches in which the same residue type repeats over and over (e.g. poly-Q sequences).(该评分术语旨在在设计期间使用,惩罚相同的残留类型一遍又一遍地重复延伸)
  4. buried_unsatisfied_penalty:This scoring term is intended for use during design, to provide a penalty for buried hydrogen bond donors or acceptors that are unsatisfied.(该评分术语旨在在设计期间使用,以对埋藏的氢键donors 或不满意的受体的处罚)
  5. netcharge:This scoring term is intended for use during design, to penalize deviations from a desired net charge in a pose or in a selection.(该评分术语旨在在设计期间使用,以惩罚pose或selection中所需的净充电偏差)
  6. hbnet:This scoring term is intended for use during design, to provide a bonus for hydrogen bond network formation.(该评分术语旨在在设计过程中使用,以提供氢键网络形成的奖励。)
design_scorefxn = pyrosetta.create_score_function("ref2015_cart.wts")
design_scorefxn.set_weight(pyrosetta.rosetta.core.scoring.ScoreType.coordinate_constraint, 10.0)
design_scorefxn.set_weight(pyrosetta.rosetta.core.scoring.ScoreType.aa_composition, 1.0)
design_scorefxn.set_weight(pyrosetta.rosetta.core.scoring.ScoreType.voids_penalty, 0.25)
design_scorefxn.set_weight(pyrosetta.rosetta.core.scoring.ScoreType.aa_repeat, 1.0)
design_scorefxn.set_weight(pyrosetta.rosetta.core.scoring.ScoreType.buried_unsatisfied_penalty, 1.0)
design_scorefxn.set_weight(pyrosetta.rosetta.core.scoring.ScoreType.hbnet, 1.0)
design_scorefxn.set_weight(pyrosetta.rosetta.core.scoring.ScoreType.netcharge, 1.0)
print("The starting pose total_score is {}".format(design_scorefxn(start_pose)))
The starting pose total_score is 23016.58100542545

在design_scorefxn之前和之后使用relax_scorefxn。
在与晶体结构坐标的任何偏差之前,将坐标约束应用于所有骨架重原子

true_selector = pyrosetta.rosetta.core.select.residue_selector.TrueResidueSelector() # Select all residues

# Apply a virtual root onto the pose to prevent large lever-arm effects while minimizing with coordinate constraints
virtual_root = pyrosetta.rosetta.protocols.simple_moves.VirtualRootMover()
virtual_root.set_removable(True)
virtual_root.set_remove(False)
virtual_root.apply(pose)

# Construct the CoordinateConstraintGenerator
coord_constraint_gen = pyrosetta.rosetta.protocols.constraint_generator.CoordinateConstraintGenerator()
coord_constraint_gen.set_id("contrain_all_backbone_atoms!")
coord_constraint_gen.set_ambiguous_hnq(False)
coord_constraint_gen.set_bounded(False)
coord_constraint_gen.set_sidechain(False)
coord_constraint_gen.set_sd(1.0) # Sets a standard deviation of contrained atoms to (an arbitrary) 1.0 Angstroms RMSD. Set higher or lower for different results.
coord_constraint_gen.set_ca_only(False)
coord_constraint_gen.set_residue_selector(true_selector)

# Apply the CoordinateConstraintGenerator using the AddConstraints mover
add_constraints = pyrosetta.rosetta.protocols.constraint_generator.AddConstraints()
add_constraints.add_generator(coord_constraint_gen)
add_constraints.apply(pose)

在design之前,使用FastRelax和relax_scorefxn打分方法对pose进行能量最小化:

tf = pyrosetta.rosetta.core.pack.task.TaskFactory()
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.InitializeFromCommandline())
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.IncludeCurrent())
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.NoRepackDisulfides())
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.OperateOnResidueSubset(
    pyrosetta.rosetta.core.pack.task.operation.PreventRepackingRLT(), true_selector)) # Set to RestrictToRepackingRLT for slower/better results
mm = pyrosetta.rosetta.core.kinematics.MoveMap()
mm.set_bb(False) # Set to true if desired
mm.set_chi(True)
mm.set_jump(False)
fast_relax = pyrosetta.rosetta.protocols.relax.FastRelax(scorefxn_in=relax_scorefxn, standard_repeats=1) # 2-5 repeats suggested for real applications
fast_relax.cartesian(True)
fast_relax.set_task_factory(tf)
fast_relax.set_movemap(mm)
fast_relax.minimize_bond_angles(True)
fast_relax.minimize_bond_lengths(True)
fast_relax.min_type("lbfgs_armijo_nonmonotone")
fast_relax.ramp_down_constraints(False)

if not os.getenv("DEBUG"):
    %time fast_relax.apply(pose)

# Optionally, instead of running this you could reload the saved pose from a previously run trajectory:
#pose = pyrosetta.pose_from_file("minimized_start_pose.pdb")

查看能量最小化前后score的变化:

if not os.getenv("DEBUG"):
    initial_score_res = relax_scorefxn(start_pose)/start_pose.size()
    final_score_res = relax_scorefxn(pose)/pose.size()
    delta_total_score_res = final_score_res - initial_score_res
    print("{0} kcal/(mol*res) - {1} kcal/(mol*res) = {2} kcal/(mol*res)".format(final_score_res, initial_score_res, delta_total_score_res))
2.455328076903503 kcal/(mol*res) - 10.064671501407595 kcal/(mol*res) = -7.609343424504092 kcal/(mol*res)

得分差只有-7.609343424504092 kcal/(mol*res),所以其实晶体结构坐标并没有发生优化。
那么backbone Cα的RMSD改变了多少呢:

### BEGIN SOLUTION
pyrosetta.rosetta.core.scoring.CA_rmsd(start_pose, pose)
### END SOLUTION
0.0

为了下游的分析,我们将pose进行保存:

minimized_start_pose = pose.clone()
pyrosetta.dump_pdb(minimized_start_pose, "outputs/minimized_start_pose.pdb")

De Novo Protein Design

在设计链A之前,首先让链条成为多丙氨酸,以便我们可以将侧链重新设计到主链上:

# 在对pose进行操作之前,首先移除所有的限制
remove_constraints = pyrosetta.rosetta.protocols.constraint_generator.RemoveConstraints()
remove_constraints.add_generator(coord_constraint_gen)
remove_constraints.apply(pose)

获取链A并将其转换为多丙氨酸:

# Keep a contiguous region of a pose, delete the rest. Re-detect disulfides
keep_chA = pyrosetta.rosetta.protocols.grafting.simple_movers.KeepRegionMover(res_start=str(pose.chain_begin(1)), res_end=str(pose.chain_end(1)))
keep_chA.apply(pose)
polyA_chA = pyrosetta.rosetta.protocols.pose_creation.MakePolyXMover(aa="ALA", keep_pro=0, keep_gly=0, keep_disulfide_cys=0)
polyA_chA.apply(pose)

获得链B和C:

pose_chBC = minimized_start_pose.clone()
keep_chBC = pyrosetta.rosetta.protocols.grafting.simple_movers.KeepRegionMover(res_start=str(pose_chBC.chain_begin(2)), res_end=str(pose_chBC.chain_end(3)-1))
keep_chBC.apply(pose_chBC)

将链条B和C附加到链的聚丙氨酸版本上:

pyrosetta.rosetta.core.pose.append_pose_to_pose(pose1=pose, pose2=pose_chBC, new_chain=True)

pose现在包含两条链:

pose.num_chains()
2

建立三条链:

switch_chains = pyrosetta.rosetta.protocols.simple_moves.SwitchChainOrderMover()
switch_chains.chain_order("12")
switch_chains.apply(pose)

print(pose.pdb_info())
print("Now the number of chains = {}".format(pose.num_chains()))
PDB file name: 
 Pose Range  Chain    PDB Range  |   #Residues         #Atoms

0001 -- 0070    A 0001  -- 0070  |   0070 residues;    00703 atoms
0071 -- 0139    B 0071  -- 0139  |   0069 residues;    01187 atoms
0140 -- 0209    C 0140  -- 0209  |   0070 residues;    01212 atoms
                           TOTAL |   0209 residues;    03102 atoms

Now the number of chains = 3

重新对backbone进行坐标约束:

virtual_root.apply(pose)
add_constraints.apply(pose)

看看新的pose,即准备设计的链A:
针对我们的design,我们需要使用一些movers和design_scorefxn打分方法,当我们运行FastDesign Mover时将实现(一些下游的mover被叫做packer)。我们通常使用下面的氨基酸残基选择的mover:

chain_A = pyrosetta.rosetta.core.select.residue_selector.ChainSelector("A")
chain_BC = pyrosetta.rosetta.core.select.residue_selector.NotResidueSelector(chain_A)

应用AddCompositionConstraintMover Mover,该Mover使用AA_COMPOINTION SCORETERM。将以下mover应用于pose,施加了设计约束,即残基选择剂具有40%的脂肪族或芳香族残基(即Ala,Phe,Ile,Met,Met,Pro,Pro,Val,TRP或Tyr)和5%的亮氨酸。有关文档,请参阅: https://www.rosettacommons.org/docs/latest/rosetta_basics/scoring/AACompositionEnergy

add_composition_constraint = pyrosetta.rosetta.protocols.aa_composition.AddCompositionConstraintMover()
##官网里面有例子
add_composition_constraint.create_constraint_from_file_contents("""
PENALTY_DEFINITION
OR_PROPERTIES AROMATIC ALIPHATIC
NOT_TYPE LEU
FRACT_DELTA_START -0.05
FRACT_DELTA_END 0.05
PENALTIES 1 0 1 # The above two lines mean that if we're 5% below or 5% above the desired content, we get a 1-point penalty.
FRACTION 0.4 # Forty percent aromatic or aliphatic, but not leucine
BEFORE_FUNCTION CONSTANT
AFTER_FUNCTION CONSTANT
END_PENALTY_DEFINITION

PENALTY_DEFINITION
TYPE LEU
DELTA_START -1
DELTA_END 1
PENALTIES 1 0 1
FRACTION 0.05 # Five percent leucine
BEFORE_FUNCTION CONSTANT
AFTER_FUNCTION CONSTANT
END_PENALTY_DEFINITION
""")
add_composition_constraint.add_residue_selector(chain_A)
add_composition_constraint.apply(pose)

应用AddHelixSequenceconconstraints Mover,该动议使用aa_composition SCORETERM。默认情况下,此mover将pose中每个alpha螺旋中的可设计残基增加了五种类型的序列约束。这些行为中的任何一个都可以通过调用高级选项来禁用或修改,但是在大多数情况下不需要设置高级选项。五种类型的序列约束是:

  • 强序列约束要求每个α螺旋的前(N端)三个残基中至少有两个带负电的残基。
  • 强序列约束要求每个α螺旋的最后(C端)三个残基中至少有两个带正电的残基。
  • 一种弱但强倾斜的序列约束,在每个螺旋中惩罚螺旋不喜欢的残基类型(默认情况下,Asn、Asp、Ser、Gly、Thr和Val)。(有时可以容忍一个这样的残基,但在这一类别中有一个以上的残基的惩罚会随着不喜欢螺旋的残基数量的增加而增加。)
  • 一个弱的序列约束使螺旋具有10%的丙氨酸。因为这个约束很弱,所以可以容忍偏离这个值,但这应该可以防止丙氨酸残基过多。
  • 弱序列约束使螺旋具有至少25%的疏水含量。这种约束也很弱,因此在一定程度上可以容忍疏水性稍低的螺旋。注意,丙氨酸在Rosetta中不被认为是“疏水性的”。
    有关文档,请参阅: https://www.rosettacommons.org/docs/latest/rosetta_basics/scoring/AACompositionEnergy

注意:aa_repeat记分项是开箱即用的,不需要应用于pose,它只需要在packer使用的记分函数中具有>0的权重即可。它对每段重复氨基酸施加惩罚,惩罚值非线性地取决于重复段的长度。默认情况下,1-或2-残基拉伸不产生惩罚,3-残基拉伸产生+1的惩罚,4-残基拉伸引起+10的惩罚,5-残基拉伸或更长时间产生+100的惩罚。因为这个术语是基于序列的,所以它实际上只对设计有用——也就是说,它将对固定序列pose施加相同的惩罚,而不管其构象如何。这也意味着该术语没有构象衍生物:最小化器完全忽略了它。该术语不可成对分解,但已使封隔器兼容,因此可以指导packer运行期间的序列组合。有关文档,请参阅:https://www.rosettacommons.org/docs/latest/rosetta_basics/scoring/Repeat-stretch-energy

类似地,voids_penalty记分项不需要应用于pose,它只需要在打包器使用的记分函数中具有>0的权重。有关文档,请参阅:https://www.rosettacommons.org/docs/latest/rosetta_basics/scoring/VoidsPenaltyEnergy

类似地,buried_unsatisfied_penalty记分项不需要应用于pose,它只需要在打包器使用的记分函数中具有>0的权重。有关文档,请参阅:https://www.rosettacommons.org/docs/latest/rosetta_basics/scoring/BuriedUnsatPenalty

类似地,hbnet记分项不需要应用于pose,它只需要在packer使用的记分函数中具有>0的权重(理想情况下在1.0到10.0之间)。有关文档,请参阅:https://www.rosettacommons.org/docs/latest/rosetta_basics/scoring/HBNetEnergy

应用AddNetChargeConstraintMover mover,该移动器利用网络费用记分项。在这种情况下,我们要求链A中的净电荷必须正好为0.

add_net_charge_constraint = pyrosetta.rosetta.protocols.aa_composition.AddNetChargeConstraintMover()
add_net_charge_constraint.create_constraint_from_file_contents("""
DESIRED_CHARGE 0 #Desired net charge is zero.
PENALTIES_CHARGE_RANGE -1 1 #Penalties are listed in the observed net charge range of -1 to +1.
PENALTIES 1 0 1 #The penalties are 1 for an observed charge of -1, 0 for an observed charge of 0, and 1 for an observed charge of +1.
BEFORE_FUNCTION QUADRATIC #Ramp quadratically for observed net charges of -2 or less.
AFTER_FUNCTION QUADRATIC #Ramp quadratically for observed net charges of +2 or greater.
""")
add_net_charge_constraint.add_residue_selector(chain_A)
add_net_charge_constraint.apply(pose)

指定一个自定义relaxscript,该脚本优化ramp_repack_min权重,以防止设计过多的丙氨酸(在Pre-RosettaCON 2018上演示):
指定要应用于链A的TaskOperations。在这种情况下,让我们使用XmlObjects类使用最新的LayerDesign实现(注意:这仍在积极开发中)。

layer_design_task = pyrosetta.rosetta.protocols.rosetta_scripts.XmlObjects.create_from_string("""
<RESIDUE_SELECTORS>
  <Layer name="surface" select_core="false" select_boundary="false" select_surface="true" use_sidechain_neighbors="true"/>
  <Layer name="boundary" select_core="false" select_boundary="true" select_surface="false" use_sidechain_neighbors="true"/>
  <Layer name="core" select_core="true" select_boundary="false" select_surface="false" use_sidechain_neighbors="true"/>
  <SecondaryStructure name="sheet" overlap="0" minH="3" minE="2" include_terminal_loops="false" use_dssp="true" ss="E"/>
  <SecondaryStructure name="entire_loop" overlap="0" minH="3" minE="2" include_terminal_loops="true" use_dssp="true" ss="L"/>
  <SecondaryStructure name="entire_helix" overlap="0" minH="3" minE="2" include_terminal_loops="false" use_dssp="true" ss="H"/>
  <And name="helix_cap" selectors="entire_loop">
   <PrimarySequenceNeighborhood lower="1" upper="0" selector="entire_helix"/>
  </And>
  <And name="helix_start" selectors="entire_helix">
    <PrimarySequenceNeighborhood lower="0" upper="1" selector="helix_cap"/>
  </And>
  <And name="helix" selectors="entire_helix">
    <Not selector="helix_start"/>
  </And>
  <And name="loop" selectors="entire_loop">
    <Not selector="helix_cap"/>
  </And>
</RESIDUE_SELECTORS>
<TASKOPERATIONS>
  <DesignRestrictions name="layer_design">
    <Action selector_logic="surface AND helix_start" aas="EHKPQR"/>
    <Action selector_logic="surface AND helix" aas="EHKQR"/>
    <Action selector_logic="surface AND sheet" aas="DEHKNQRST"/>
    <Action selector_logic="surface AND loop" aas="DEGHKNPQRST"/>
    <Action selector_logic="boundary AND helix_start" aas="ADEIKLMNPQRSTVWY"/>
    <Action selector_logic="boundary AND helix" aas="ADEIKLMNQRSTVWY"/>
    <Action selector_logic="boundary AND sheet" aas="DEFIKLNQRSTVWY"/>
    <Action selector_logic="boundary AND loop" aas="ADEFGIKLMNPQRSTVWY"/>
    <Action selector_logic="core AND helix_start" aas="AFILMPVWY"/>
    <Action selector_logic="core AND helix" aas="AFILMVWY"/>
    <Action selector_logic="core AND sheet" aas="FILVWY"/>
    <Action selector_logic="core AND loop" aas="AFGILMPVWY"/>
    <Action selector_logic="helix_cap" aas="DNST"/>
  </DesignRestrictions>
</TASKOPERATIONS>
""").get_task_operation("layer_design")

此外,还为链B和C以及链B和C的其余部分内的异三聚体界面准备一个ResidueSelector。我们将使用RestrictAbsentCanonicalAASRLT、RestrictToRepackingRLT和PreventRepacking RLT TaskOperations.

interface = pyrosetta.rosetta.core.select.residue_selector.InterGroupInterfaceByVectorSelector()
interface.group1_selector(chain_A)
interface.group2_selector(chain_BC)
chain_BC_interface = pyrosetta.rosetta.core.select.residue_selector.AndResidueSelector(interface, chain_BC) #链B和C的interface
not_chain_BC_interface = pyrosetta.rosetta.core.select.residue_selector.NotResidueSelector(chain_BC_interface) # 除了链B和C的interface,包括链A
chain_BC_not_interface = pyrosetta.rosetta.core.select.residue_selector.AndResidueSelector(not_chain_BC_interface, chain_BC)# 除了链B和C的interface,不包括链A

为了最小化,我们还需要以下ResidueSelector:

chain_A_and_BC_interface = pyrosetta.rosetta.core.select.residue_selector.OrResidueSelector(chain_A, chain_BC_interface)

确保每个ResidueSelector根据需要选择区域(在以下情况下,ResidueSSelector界面显示为):


interface

创建要与FastRelax mover一起使用的TaskFactory(我们使用这个而不是FastDesign mover,因为构造函数允许我们设置一个relax脚本):

tf.clear()
tf = pyrosetta.rosetta.core.pack.task.TaskFactory()

tf.push_back(pyrosetta.rosetta.core.pack.task.operation.InitializeFromCommandline())
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.IncludeCurrent())
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.NoRepackDisulfides())

# Prevent repacking on chain_BC_not_interface
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.OperateOnResidueSubset(
    pyrosetta.rosetta.core.pack.task.operation.PreventRepackingRLT(), chain_BC_not_interface))

# Repack only on chain_BC_interface
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.OperateOnResidueSubset(
    pyrosetta.rosetta.core.pack.task.operation.RestrictToRepackingRLT(), chain_BC_interface))

# Enable design on chain_A
aa_to_design = pyrosetta.rosetta.core.pack.task.operation.RestrictAbsentCanonicalAASRLT()
aa_to_design.aas_to_keep("ACDEFGHIKLMNPQRSTVWY")
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.OperateOnResidueSubset(
    aa_to_design, chain_A))

# Apply layer design
tf.push_back(layer_design_task)

# Convert the task factory into a PackerTask
packer_task = tf.create_task_and_apply_taskoperations(pose)
# View the PackerTask
print(packer_task)
#Packer_Task

Threads to request: ALL AVAILABLE

resid   pack?   design? allowed_aas
1   TRUE    TRUE    ASP:NtermProteinFull,ASN:NtermProteinFull,SER:NtermProteinFull,THR:NtermProteinFull
2   TRUE    TRUE    GLU,HIS,HIS_D,LYS,PRO,GLN,ARG
3   TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
4   TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
5   TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
6   TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
7   TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
8   TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
9   TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
10  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
11  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
12  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
13  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
14  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
15  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
16  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
17  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
18  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
19  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
20  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
21  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
22  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
23  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
24  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
25  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
26  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
27  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
28  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
29  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
30  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
31  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
32  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
33  TRUE    TRUE    ASP,GLU,GLY,HIS,HIS_D,LYS,ASN,PRO,GLN,ARG,SER,THR
34  TRUE    TRUE    ASP,GLU,GLY,HIS,HIS_D,LYS,ASN,PRO,GLN,ARG,SER,THR
35  TRUE    TRUE    ASP,GLU,GLY,HIS,HIS_D,LYS,ASN,PRO,GLN,ARG,SER,THR
36  TRUE    TRUE    ASP,GLU,GLY,HIS,HIS_D,LYS,ASN,PRO,GLN,ARG,SER,THR
37  TRUE    TRUE    ASP,GLU,GLY,HIS,HIS_D,LYS,ASN,PRO,GLN,ARG,SER,THR
38  TRUE    TRUE    ASP,GLU,GLY,HIS,HIS_D,LYS,ASN,PRO,GLN,ARG,SER,THR
39  TRUE    TRUE    ASP,ASN,SER,THR
40  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,PRO,GLN,ARG,SER,THR,VAL,TRP,TYR
41  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
42  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
43  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
44  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
45  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
46  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
47  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
48  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
49  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
50  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
51  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
52  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
53  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
54  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
55  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
56  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
57  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
58  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
59  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
60  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
61  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
62  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
63  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
64  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
65  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
66  TRUE    TRUE    ALA,PHE,ILE,LEU,MET,VAL,TRP,TYR
67  TRUE    TRUE    GLU,HIS,HIS_D,LYS,GLN,ARG
68  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
69  TRUE    TRUE    ALA,ASP,GLU,ILE,LYS,LEU,MET,ASN,GLN,ARG,SER,THR,VAL,TRP,TYR
70  TRUE    TRUE    ALA:CtermProteinFull,ASP:CtermProteinFull,GLU:CtermProteinFull,PHE:CtermProteinFull,GLY:CtermProteinFull,ILE:CtermProteinFull,LYS:CtermProteinFull,LEU:CtermProteinFull,MET:CtermProteinFull,ASN:CtermProteinFull,PRO:CtermProteinFull,GLN:CtermProteinFull,ARG:CtermProteinFull,SER:CtermProteinFull,THR:CtermProteinFull,VAL:CtermProteinFull,TRP:CtermProteinFull,TYR:CtermProteinFull
71  FALSE   FALSE   
72  FALSE   FALSE   
73  FALSE   FALSE   
74  FALSE   FALSE   
75  FALSE   FALSE   
76  FALSE   FALSE   
77  TRUE    FALSE   LEU
78  FALSE   FALSE   
79  FALSE   FALSE   
80  TRUE    FALSE   LEU
81  FALSE   FALSE   
82  FALSE   FALSE   
83  FALSE   FALSE   
84  TRUE    FALSE   LEU
85  FALSE   FALSE   
86  FALSE   FALSE   
87  TRUE    FALSE   LEU
88  TRUE    FALSE   ARG
89  FALSE   FALSE   
90  FALSE   FALSE   
91  TRUE    FALSE   LEU
92  FALSE   FALSE   
93  FALSE   FALSE   
94  TRUE    FALSE   LEU
95  TRUE    FALSE   LYS
96  FALSE   FALSE   
97  FALSE   FALSE   
98  TRUE    FALSE   LEU
99  FALSE   FALSE   
100 FALSE   FALSE   
101 TRUE    FALSE   LEU
102 TRUE    FALSE   GLU
103 FALSE   FALSE   
104 FALSE   FALSE   
105 TRUE    FALSE   PRO
106 FALSE   FALSE   
107 FALSE   FALSE   
108 FALSE   FALSE   
109 FALSE   FALSE   
110 TRUE    FALSE   ILE
111 FALSE   FALSE   
112 FALSE   FALSE   
113 TRUE    FALSE   VAL
114 FALSE   FALSE   
115 FALSE   FALSE   
116 FALSE   FALSE   
117 TRUE    FALSE   ILE
118 FALSE   FALSE   
119 FALSE   FALSE   
120 TRUE    FALSE   ALA
121 FALSE   FALSE   
122 FALSE   FALSE   
123 TRUE    FALSE   ALA
124 TRUE    FALSE   SER
125 FALSE   FALSE   
126 FALSE   FALSE   
127 FALSE   FALSE   
128 FALSE   FALSE   
129 FALSE   FALSE   
130 FALSE   FALSE   
131 TRUE    FALSE   SER
132 FALSE   FALSE   
133 FALSE   FALSE   
134 FALSE   FALSE   
135 FALSE   FALSE   
136 FALSE   FALSE   
137 TRUE    FALSE   ALA
138 TRUE    FALSE   LEU
139 FALSE   FALSE   
140 FALSE   FALSE   
141 FALSE   FALSE   
142 FALSE   FALSE   
143 FALSE   FALSE   
144 FALSE   FALSE   
145 FALSE   FALSE   
146 FALSE   FALSE   
147 FALSE   FALSE   
148 FALSE   FALSE   
149 FALSE   FALSE   
150 FALSE   FALSE   
151 FALSE   FALSE   
152 FALSE   FALSE   
153 FALSE   FALSE   
154 FALSE   FALSE   
155 FALSE   FALSE   
156 FALSE   FALSE   
157 FALSE   FALSE   
158 FALSE   FALSE   
159 FALSE   FALSE   
160 FALSE   FALSE   
161 FALSE   FALSE   
162 FALSE   FALSE   
163 FALSE   FALSE   
164 FALSE   FALSE   
165 FALSE   FALSE   
166 FALSE   FALSE   
167 FALSE   FALSE   
168 FALSE   FALSE   
169 FALSE   FALSE   
170 FALSE   FALSE   
171 FALSE   FALSE   
172 FALSE   FALSE   
173 FALSE   FALSE   
174 FALSE   FALSE   
175 FALSE   FALSE   
176 FALSE   FALSE   
177 FALSE   FALSE   
178 FALSE   FALSE   
179 FALSE   FALSE   
180 FALSE   FALSE   
181 TRUE    FALSE   ILE
182 TRUE    FALSE   VAL
183 FALSE   FALSE   
184 FALSE   FALSE   
185 TRUE    FALSE   LEU
186 TRUE    FALSE   LYS
187 FALSE   FALSE   
188 TRUE    FALSE   ILE
189 TRUE    FALSE   VAL
190 FALSE   FALSE   
191 FALSE   FALSE   
192 TRUE    FALSE   ILE
193 TRUE    FALSE   GLU
194 FALSE   FALSE   
195 TRUE    FALSE   SER
196 TRUE    FALSE   VAL
197 FALSE   FALSE   
198 FALSE   FALSE   
199 FALSE   FALSE   
200 TRUE    FALSE   ARG
201 FALSE   FALSE   
202 TRUE    FALSE   SER
203 TRUE    FALSE   ALA
204 FALSE   FALSE   
205 FALSE   FALSE   
206 FALSE   FALSE   
207 TRUE    FALSE   LYS
208 FALSE   FALSE   
209 TRUE    FALSE   LEU

注意看上面的氨基酸残基哪些用来design哪些用来pack。

PackerTask任务看起来像预期的那样。现在设置MoveMapFactory:

# Set up a MoveMapFactory
mmf = pyrosetta.rosetta.core.select.movemap.MoveMapFactory()
mmf.all_bb(setting=False)  # Set to true if needed
mmf.all_bondangles(setting=False)
mmf.all_bondlengths(setting=False)
mmf.all_chi(setting=True)
mmf.all_jumps(setting=False)
mmf.set_cartesian(setting=False)

# Set movemap actions to turn on or off certain torsions, overriding the above defaults
enable = pyrosetta.rosetta.core.select.movemap.move_map_action.mm_enable
disable = pyrosetta.rosetta.core.select.movemap.move_map_action.mm_disable

# Set custom minimizable torsions
mmf.add_bondangles_action(action=enable, selector=chain_A_and_BC_interface)
mmf.add_bondlengths_action(action=enable, selector=chain_A_and_BC_interface)
mmf.add_chi_action(action=enable, selector=chain_A_and_BC_interface)

mmf.add_bondangles_action(action=disable, selector=chain_BC_not_interface)
mmf.add_bondlengths_action(action=disable, selector=chain_BC_not_interface)
mmf.add_chi_action(action=disable, selector=chain_BC_not_interface)

现在,让我们再次检查更多pose信息,以验证我们是否已准备好FastDesign:

display_pose = pyrosetta.rosetta.protocols.fold_from_loops.movers.DisplayPoseLabelsMover()
display_pose.tasks(tf)
display_pose.movemap_factory(mmf)
display_pose.apply(pose)

我们准备好使用FastRelax mover:

#fast_design = pyrosetta.rosetta.protocols.denovo_design.movers.FastDesign(scorefxn_in=design_scorefxn, standard_repeats=1) # 2-5 repeats suggested for real applications
fast_design = pyrosetta.rosetta.protocols.relax.FastRelax(scorefxn_in=design_scorefxn, standard_repeats=1, script_file="KillA2019")
fast_design.cartesian(False)
fast_design.set_task_factory(tf)
fast_design.set_movemap_factory(mmf)
fast_design.min_type("lbfgs_armijo_nonmonotone")
fast_design.ramp_down_constraints(False)
if not os.getenv("DEBUG"):
    %time fast_design.apply(pose)
    # Optionally, instead of running this you could reload the saved pose from a previously run trajectory:
    pose = pyrosetta.pose_from_file("expected_outputs/designed_pose.pdb")

保存此pose以供下游参考:

if not os.getenv("DEBUG"):
    designed_pose = pose.clone()
    #pyrosetta.dump_pdb(designed_pose, "outputs/designed_pose.pdb")

现在我们已经重新设计了链A,强烈建议使用FastRelax和Cartesian记分函数repack并使用现实的记分函数最小化。

tf.clear()
tf = pyrosetta.rosetta.core.pack.task.TaskFactory()
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.InitializeFromCommandline())
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.IncludeCurrent())
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.NoRepackDisulfides())
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.OperateOnResidueSubset(
    pyrosetta.rosetta.core.pack.task.operation.RestrictToRepackingRLT(), true_selector))
mm = pyrosetta.rosetta.core.kinematics.MoveMap()
mm.set_bb(False) # Set to true if desired
mm.set_chi(True)
mm.set_jump(False)
fast_relax = pyrosetta.rosetta.protocols.relax.FastRelax(scorefxn_in=relax_scorefxn, standard_repeats=1) # 2-5 repeats suggested for real applications
fast_relax.cartesian(True)
fast_relax.set_task_factory(tf)
fast_relax.set_movemap(mm)
fast_relax.minimize_bond_angles(True)
fast_relax.minimize_bond_lengths(True)
fast_relax.min_type("lbfgs_armijo_nonmonotone") # Cartisian scorefunction
fast_relax.ramp_down_constraints(False)

# To run the FastRelax trajectory.
if not os.getenv("DEBUG"):
    %time fast_relax.apply(pose)

#Or for speed, we will load the pose from a previous trajectory.
pose = pyrosetta.pose_from_file("expected_outputs/designed_relaxed_pose.pdb")

保存pose以进行下游分析:

designed_relaxed_pose = pose.clone()
pyrosetta.dump_pdb(designed_relaxed_pose, "expected_outputs/designed_relaxed_pose.pdb")

让我们比较一下序列,看看发生了什么:

print(minimized_start_pose.chain_sequence(1))
print(designed_relaxed_pose.chain_sequence(1))
KYKIKETLKRLEDSLRELRRILEELKEMLERLEKNPDKDVIVEVLKVIVKAIEASVENQRISAENQKALA
DEHERRIMEERHRMEEKFHHEMERMHRKKHQRHQTTSKSEYEHMFETIMRMMEWFERSFERMQEMYRQRT

查看设计结果!

chA = pyrosetta.rosetta.core.select.residue_selector.ChainSelector("A")
chB = pyrosetta.rosetta.core.select.residue_selector.ChainSelector("B")
chC = pyrosetta.rosetta.core.select.residue_selector.ChainSelector("C")
view = sum(
    [
        viewer.init(designed_relaxed_pose),
        viewer.setStyle(cartoon_color="lightgrey", radius=0.25),
        viewer.setSurface(residue_selector=chA, colorscheme="orangeCarbon", opacity=0.5, surface_type="VDW"),
        viewer.setSurface(residue_selector=chB, color="greenCarbon", opacity=0.5, surface_type="VDW"),
        viewer.setSurface(residue_selector=chB, color="violetCarbon", opacity=0.5, surface_type="VDW"),
        viewer.setDisulfides(radius=0.25),
        viewer.setZoom(factor=1.5)
    ]
)
view()
design_result

Analysis

骨架Cα原子移动了多少埃RMSD?

pyrosetta.rosetta.core.scoring.CA_rmsd(minimized_start_pose, designed_relaxed_pose)
0.7333711981773376

从minimized_start_pose到designed_response的delta total_score是多少?

scorefxn = pyrosetta.create_score_function("ref2015_cart.wts")

delta_total_score = scorefxn(minimized_start_pose) - scorefxn(designed_relaxed_pose)
print(delta_total_score)
527.8827261766755

minimized_start_pose和designed_response之间每个突变位置的每个残基能量差是多少?

change_res = []
for i, aa in enumerate(minimized_start_pose.sequence()[:-1]):
    if aa != designed_relaxed_pose.sequence()[i]:
        change_res.append(i+1)
for i in change_res:
    pose_total_score = pyrosetta.rosetta.protocols.relax.get_per_residue_scores(minimized_start_pose, pyrosetta.rosetta.core.scoring.ScoreType.total_score)[i]
    start_pose_total_score = pyrosetta.rosetta.protocols.relax.get_per_residue_scores(designed_relaxed_pose, pyrosetta.rosetta.core.scoring.ScoreType.total_score)[i]
    print("The delta total_score for residue {} between minimized_start_pose and designed_relaxed_pose is {}".format(i, pose_total_score - start_pose_total_score))
The delta total_score for residue 1 between minimized_start_pose and designed_relaxed_pose is 10.888964226044545
The delta total_score for residue 2 between minimized_start_pose and designed_relaxed_pose is 6.699423766029731
The delta total_score for residue 3 between minimized_start_pose and designed_relaxed_pose is 4.755243309354682
The delta total_score for residue 4 between minimized_start_pose and designed_relaxed_pose is 2.175751189239205
The delta total_score for residue 5 between minimized_start_pose and designed_relaxed_pose is 5.423864530393123
The delta total_score for residue 6 between minimized_start_pose and designed_relaxed_pose is 4.290040549191381
The delta total_score for residue 7 between minimized_start_pose and designed_relaxed_pose is 7.712203985875208
The delta total_score for residue 8 between minimized_start_pose and designed_relaxed_pose is 3.403290076142472
The delta total_score for residue 9 between minimized_start_pose and designed_relaxed_pose is 6.7543371245403305
The delta total_score for residue 10 between minimized_start_pose and designed_relaxed_pose is 5.112603704343988
The delta total_score for residue 11 between minimized_start_pose and designed_relaxed_pose is 1.6800676249203392
The delta total_score for residue 12 between minimized_start_pose and designed_relaxed_pose is 0.9776342598129955
The delta total_score for residue 13 between minimized_start_pose and designed_relaxed_pose is 1.9109948953378078
The delta total_score for residue 14 between minimized_start_pose and designed_relaxed_pose is 3.6837572830645757
The delta total_score for residue 15 between minimized_start_pose and designed_relaxed_pose is 5.294550118372035
The delta total_score for residue 16 between minimized_start_pose and designed_relaxed_pose is 5.93136885219662
The delta total_score for residue 17 between minimized_start_pose and designed_relaxed_pose is 3.3936280045179377
The delta total_score for residue 18 between minimized_start_pose and designed_relaxed_pose is 7.64286327594
The delta total_score for residue 19 between minimized_start_pose and designed_relaxed_pose is 3.7884218185789127
The delta total_score for residue 20 between minimized_start_pose and designed_relaxed_pose is 1.5850925443868047
The delta total_score for residue 21 between minimized_start_pose and designed_relaxed_pose is 4.180910860153034
The delta total_score for residue 22 between minimized_start_pose and designed_relaxed_pose is 3.410644665622277
The delta total_score for residue 24 between minimized_start_pose and designed_relaxed_pose is 1.6867062350503936
The delta total_score for residue 25 between minimized_start_pose and designed_relaxed_pose is 0.9539841163822109
The delta total_score for residue 26 between minimized_start_pose and designed_relaxed_pose is 2.3850849157667247
The delta total_score for residue 27 between minimized_start_pose and designed_relaxed_pose is 3.540476519382279
The delta total_score for residue 28 between minimized_start_pose and designed_relaxed_pose is 7.4260417491025486
The delta total_score for residue 29 between minimized_start_pose and designed_relaxed_pose is 2.599858709843688
The delta total_score for residue 30 between minimized_start_pose and designed_relaxed_pose is 7.167895521575813
The delta total_score for residue 31 between minimized_start_pose and designed_relaxed_pose is 1.816476135005069
The delta total_score for residue 32 between minimized_start_pose and designed_relaxed_pose is 5.009912814153474
The delta total_score for residue 33 between minimized_start_pose and designed_relaxed_pose is 4.847689612009137
The delta total_score for residue 34 between minimized_start_pose and designed_relaxed_pose is 7.567203291961828
The delta total_score for residue 35 between minimized_start_pose and designed_relaxed_pose is 2.4268289837221215
The delta total_score for residue 36 between minimized_start_pose and designed_relaxed_pose is -0.9715559892044543
The delta total_score for residue 37 between minimized_start_pose and designed_relaxed_pose is 4.628773322416956
The delta total_score for residue 39 between minimized_start_pose and designed_relaxed_pose is 5.445612479184746
The delta total_score for residue 40 between minimized_start_pose and designed_relaxed_pose is 4.2930367059489
The delta total_score for residue 41 between minimized_start_pose and designed_relaxed_pose is 0.39258196341680573
The delta total_score for residue 42 between minimized_start_pose and designed_relaxed_pose is 2.472192074684419
The delta total_score for residue 43 between minimized_start_pose and designed_relaxed_pose is 0.16980016222997474
The delta total_score for residue 44 between minimized_start_pose and designed_relaxed_pose is -0.4821529199946799
The delta total_score for residue 45 between minimized_start_pose and designed_relaxed_pose is -0.1400815360994172
The delta total_score for residue 46 between minimized_start_pose and designed_relaxed_pose is 0.6749053259138416
The delta total_score for residue 47 between minimized_start_pose and designed_relaxed_pose is 3.5102815794734776
The delta total_score for residue 49 between minimized_start_pose and designed_relaxed_pose is 1.0437060445873996
The delta total_score for residue 50 between minimized_start_pose and designed_relaxed_pose is 2.8639021147423778
The delta total_score for residue 51 between minimized_start_pose and designed_relaxed_pose is 3.1565161441323264
The delta total_score for residue 52 between minimized_start_pose and designed_relaxed_pose is 2.037154247253109
The delta total_score for residue 54 between minimized_start_pose and designed_relaxed_pose is 3.054769562683341
The delta total_score for residue 55 between minimized_start_pose and designed_relaxed_pose is 0.5598865364821717
The delta total_score for residue 56 between minimized_start_pose and designed_relaxed_pose is 0.5245184955911881
The delta total_score for residue 57 between minimized_start_pose and designed_relaxed_pose is 2.9276262031861484
The delta total_score for residue 58 between minimized_start_pose and designed_relaxed_pose is 3.807571805650257
The delta total_score for residue 59 between minimized_start_pose and designed_relaxed_pose is 1.2146311661888083
The delta total_score for residue 60 between minimized_start_pose and designed_relaxed_pose is 1.4992137488426511
The delta total_score for residue 61 between minimized_start_pose and designed_relaxed_pose is 1.263725189626067
The delta total_score for residue 62 between minimized_start_pose and designed_relaxed_pose is 3.411189867703812
The delta total_score for residue 63 between minimized_start_pose and designed_relaxed_pose is 2.8421066033798734
The delta total_score for residue 65 between minimized_start_pose and designed_relaxed_pose is 2.120950253066053
The delta total_score for residue 66 between minimized_start_pose and designed_relaxed_pose is 0.3985598063101161
The delta total_score for residue 67 between minimized_start_pose and designed_relaxed_pose is 2.0609086271457273
The delta total_score for residue 68 between minimized_start_pose and designed_relaxed_pose is 3.136815933476673
The delta total_score for residue 69 between minimized_start_pose and designed_relaxed_pose is -3.296753807751073
The delta total_score for residue 70 between minimized_start_pose and designed_relaxed_pose is 3.9139136088450472

aa_repeat记分项施加的顺序约束是否满足?重新编写以下python代码,计算链A中的残基类型的数量,以检查链A中一级氨基酸序列中每个残基类型最长的长度:

for aa in IUPACData.protein_letters:
    aa_selector = pyrosetta.rosetta.core.select.residue_selector.ResidueNameSelector(str.upper(Bio.SeqUtils.seq3(aa)))
    aa_and_chain_A = pyrosetta.rosetta.core.select.residue_selector.AndResidueSelector(chain_A, aa_selector)
    sel_res_count_metric = pyrosetta.rosetta.core.simple_metrics.metrics.SelectedResidueCountMetric()
    sel_res_count_metric.set_residue_selector(aa_and_chain_A)
    print(aa, int(sel_res_count_metric.calculate(designed_relaxed_pose)))
A 0
C 0
D 0
E 15
F 4
G 0
H 4
I 2
K 4
L 0
M 10
N 0
P 0
Q 4
R 12
S 3
T 3
V 0
W 1
Y 2

链A是否含有40%的芳香族或脂肪族(但不含亮氨酸)和5%的亮氨酸,满足aa_composition评分项?对于其他实践,请使用PyRosetta ResidueSelectors和SimpleMetrics重新编写以下python实现:

The % aromatic residues in chain A is 27.142857142857142%
The % leucine in chain A is 0.0%

AddHelixSequenceConstraints mover使用aa_composition记分项施加的序列约束是否满足?
用sasa(溶剂可接触表面积)评估与最小化的designed_relaxed_pose ,minimized_start_pose中是否存在更多或更少的空隙,满足voids_penalty.

tf.clear()
tf = pyrosetta.rosetta.core.pack.task.TaskFactory()
tf.push_back(pyrosetta.rosetta.core.pack.task.operation.OperateOnResidueSubset(
    pyrosetta.rosetta.core.pack.task.operation.RestrictToRepackingRLT(), true_selector))
sasa = pyrosetta.rosetta.protocols.simple_filters.TaskAwareSASAFilter()
sasa.task_factory(tf)
print("The sasa of minimized_start_pose is {}".format(sasa.score(minimized_start_pose)))
print("The sasa of designed_relaxed_pose is {}".format(sasa.score(designed_relaxed_pose)))
The sasa of minimized_start_pose is 10618.90172662857
The sasa of designed_relaxed_pose is 11114.383085079851

链A的净费用是否正好等于零,满足netcharge 计分项?

# One method to calculate net charge of chain A
num_negative = 0
num_positive = 0
for aa in pose.chain_sequence(1):
    if aa in "DE":
        num_negative += 1
    if aa in "KR":
        num_positive += 1
print("The net charge of chain A = {0}".format(num_positive - num_negative))

# Another method to calculate net charge of chain A
test_pose = pose.clone()
keep_chA = pyrosetta.rosetta.protocols.grafting.simple_movers.KeepRegionMover(res_start=str(test_pose.chain_begin(1)), res_end=str(test_pose.chain_end(1)))
keep_chA.apply(test_pose)
net_charge = pyrosetta.rosetta.protocols.simple_filters.NetChargeFilter()
print("The net charge of chain A = {0}".format(net_charge.score(test_pose)))
The net charge of chain A = 0
The net charge of chain A = 0.0

是否有任何掩埋的不满意的极性原子,满足掩埋的不令人满意的惩罚分数条件?

uhb = pyrosetta.rosetta.protocols.rosetta_scripts.XmlObjects.create_from_string("""
<SCOREFXNS>
  <ScoreFunction name="fa_default" weights="ref2015"/>
</SCOREFXNS>
<FILTERS>
  <BuriedUnsatHbonds name="uhb_sc" use_reporter_behavior="true" use_hbnet_behavior="false" scorefxn="fa_default" report_bb_heavy_atom_unsats="false" report_sc_heavy_atom_unsats="true" cutoff="99999" print_out_info_to_pdb="false" ignore_surface_res="true" residue_surface_cutoff="20.0" ignore_bb_heavy_unsats="false" confidence="0"/>
  <BuriedUnsatHbonds name="uhb_bb" use_reporter_behavior="true" use_hbnet_behavior="false" scorefxn="fa_default" report_bb_heavy_atom_unsats="true" report_sc_heavy_atom_unsats="false" cutoff="99999" print_out_info_to_pdb="false" ignore_surface_res="true" residue_surface_cutoff="20.0" ignore_bb_heavy_unsats="false" confidence="0"/>
</FILTERS>
""")
print("The number of unsatisfied side-chain heavy atoms in minimized_start_pose is {}".format(uhb.get_filter("uhb_sc").score(minimized_start_pose)))
print("The number of unsatisfied backbone heavy atoms in minimized_start_pose is {}".format(uhb.get_filter("uhb_bb").score(minimized_start_pose)))

print("The number of unsatisfied side-chain heavy atoms in designed_relaxed_pose is {}".format(uhb.get_filter("uhb_sc").score(designed_relaxed_pose)))
print("The number of unsatisfied backbone heavy atoms in designed_relaxed_pose is {}".format(uhb.get_filter("uhb_bb").score(designed_relaxed_pose)))
The number of unsatisfied side-chain heavy atoms in minimized_start_pose is 3.0
The number of unsatisfied backbone heavy atoms in minimized_start_pose is 12.0
The number of unsatisfied side-chain heavy atoms in designed_relaxed_pose is 7.0
The number of unsatisfied backbone heavy atoms in designed_relaxed_pose is 9.0

参考

Jupyter Notebook Viewer (nbviewer.org)

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,457评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,837评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,696评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,183评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,057评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,105评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,520评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,211评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,482评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,574评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,353评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,213评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,576评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,897评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,174评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,489评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,683评论 2 335

推荐阅读更多精彩内容