本文均在CentOS7(release 7.6.1810)版本下进行过的测试
更多内容可以关注 Rosetta中文社区/知乎-Rosetta研习社专栏
一、RosettaDock
RosettaDock的基本算法是随机平移和旋转刚性体,并一定采样步数后对侧链进行优化,最终采用MC方法评估是否接纳新的构象,以摸索复合物的能量面,找到最低能的模型。该方法多用于优化结构使用。Rosetta的全局对接效率不如传统的刚性对接软件(ZDOCK/PIPER等)
RosettaDock的三个阶段:
- Perturbation(全局对接时使用)
- LowresDocking
- HighresDocking(目前分为dock_mcmc/dock_min两种方法)
二、Docking相关的Mover和API
主要的PyRosetta API位于:
- pyrosetta.rosetta.protocols.rigid(主要)
- pyrosetta.rosetta.protocols.docking(主要)
- pyrosetta.rosetta.protocols.flexpep_docking
- pyrosetta.rosetta.protocols.ligand_docking
- pyrosetta.rosetta.protocols.surface_docking
- pyrosetta.rosetta.protocols.symmetric_docking
- pyrosetta.rosetta.core.import_pose.options.RNA_FragmentMonteCarloOptions.docking
- pyrosetta.rosetta.core.import_pose.options.RNA_DeNovoProtocolOptions.docking
- pyrosetta.rosetta.protocols.chemically_conjugated_docking
RosettaDock的代码构架
docking_class.png1 Global Perturbation & initial Perturbation
1.1 Docking Initial Perturbation
整合度更加高的PerturbationMover,主要作用为初始化对接,可以用于全局对接(启用randomize)、局部对接时的初始化操作。
from pyrosetta.rosetta.protocols.docking import *
dock_init = DockingInitialPerturbation(rb_jump: int, slide: bool)
dock_init.set_center(bool)
# 全局对接:
dock_init.set_randomize1(bool) # 是否将第一个partner1 随机化?
dock_init.set_randomize2(bool) # 是否将第二个partner2 随机化?
dock_init.set_spin(bool) # 是否将partner2围绕坐标系快速转动?
dock_init.set_use_ellipsoidal_randomization(bool) # 是否启用EllipsoidalRandomizationMover替代RigidBodyRandomizeMover?
# Perturbation参数设定
pert = pyrosetta.rosetta.utility.vector1_double()
pert.append(3)
pert.append(8)
dock_init.set_dock_pert(pert) # 默认3°,8A)。
dock_init.set_uniform_trans(uniform_trans: float) # 启用UniformSphereTransMover?根据给定的球半径,并随机地排布两个对接组分。
# tilt?
dock_init.set_tilt(tilt: pyrosetta.rosetta.utility.vector1_double)
dock_init.set_tilt1_center(tilt_center: unicode)
dock_init.set_tilt2_center(tilt_center: unicode)
#运行
dock_init.apply(pose)
dock_init.apply_body(pose: pyrosetta.rosetta.core.pose.Pose, jump_number: int)
以下部分为基础的刚性体Mover
1.2 RigidBodyTransMover
基础Mover
将Pose中链进行平移的Mover,基础Mover之一。
以两个复合物的中心,分离开来(不做旋转运动)。
- rb_jump_in : 设置jump点,foldtree下游的刚性体将会被进行选择和移动
- vary_stepsize: 是否可以变动的步长, False,否则不能设置step_size,True,将会自动选择合适的距离,每次具有变化
- step_size: 设置两个复合物拉开的距离(每次都固定)
from pyrosetta.rosetta.protocols.rigid import *
rb_trans = RigidBodyTransMover(pose_in: pyrosetta.rosetta.core.pose.Pose, rb_jump_in: int, vary_stepsize: False)
rb_trans.step_size(step_size_in: float)
rb_trans.apply(pose)
1.3 RigidBodySpinMover
基础Mover
将Pose中链进行旋转的Mover,基础Mover之一。
朝着随机的轴进行旋转。
from pyrosetta.rosetta.protocols.rigid import *
rb_spin = RigidBodySpinMover(rb_jump_in: int)
rb_spin.spin_axis(spin_axis_in: pyrosetta.rosetta.numeric.xyzVector_double_t) #可以设置旋转的轴。一般不设
rb_spin.spin_mag(spin_mag: float) # 旋转的角度大小
rb_spin.apply(pose)
1.4 RigidBodyPerturbMover
是一个整合的Mover, 根据设置运行RigidBodySpinMover和RigidBodyTransMover.
- Vector1([1,2,3]),设置运行哪些jump可以被移动。需要和foldtree中的patern对应。如有4条链的蛋白,此时存在3个jump, Vector就需要将他们都设置[1,2,3]。
- rb_jump_in: 进行选择的jump点。默认选1,否则不能正常移动。
- Partner: partner_upstream/partner_downstream 决定foldtree中哪个部分可以被平移、旋转。如: 'HL_AB'这个foldtree中,partner_upstream=HL,AB=partner_downstream。
from pyrosetta.rosetta.protocols.rigid import *
from pyrosetta.teaching import *
setup_foldtree(pose, "HL_AB", Vector1([1,2,3])) #
rb_perb = RigidBodyPerturbMover(rb_jump_in: int, rot_mag_in: float, trans_mag_in: float,Partner: pyrosetta.rosetta.protocols.rigid.Partner)
rb_perb.apply(pose)
1.5 RigidBodyRandomizeMover(重要)
基础Mover
随机将一个刚性体围绕另一个刚性体进行随机地初始化。用于全局对接时使用。用法与RigidBodyPerturbMover一致。
from pyrosetta.rosetta.protocols.rigid import *
from pyrosetta.teaching import *
setup_foldtree(pose, "HL_AB", Vector1([1,2,3])) #
rb_random = RigidBodyRandomizeMover(pose, rb_jump_in: int, Partner: pyrosetta.rosetta.protocols.rigid.Partner)
rb_random.apply(pose)
1.6. RigidBodyPerturbNoCenterMover
可定义多个jump点,进行旋转和平移。每次循环时,选择随机选择一个jump点进行干扰。
from pyrosetta.rosetta.protocols.rigid import *
rb_no_center = RigidBodyPerturbNoCenterMover()
rb_no_center.add_jump(1)
rb_no_center.add_jump(2)
rb_no_center.rot_magnitude(3.0)
rb_no_center.trans_magnitude(8.0)
1.7 EllipsoidalRandomizationMover
基础Mover
该Mover将对接的组分当做椭圆形,并且将另外一个对接组分随机地沿着外周进行对接。注意,对接的完成需要调用SlideIntoContact,不能单独使用!
from pyrosetta.rosetta.protocols.docking import *
Ellipsoida = EllipsoidalRandomizationMover(rb_jump: int, ellipsoid_is_first_partner: bool, autofoldtree: bool) # Sets pose fold tree based on -partners flag
Ellipsoida.set_partners(partner: unicode)
Ellipsoida.apply(pose)
1.8 DockingSlideIntoContact/FaDockingSlideIntoContact
基础Mover
将被初始随机移动后的构象,沿着Patner1的中心平移,直到两个蛋白发生相互作用时停止。(滑动至接触)
from rosetta.protocols.docking import *
slide = DockingSlideIntoContact(rb_jump: int) # for centroid
slide = FaDockingSlideIntoContact(rb_jump: int) # for full-atom
slide.apply(pose)
2 Prepack Stage
2.1 DockingPrepackProtocol
在Docking过程中,Rosetta只会对处于对接表面的氨基酸进行repack, 因此我们需要确定处于非结合面的氨基酸拥有较低的能量,否则将会对打分造成较大的影响。
计算步骤: 必要时增加repack的数量(1000), 此后所有的结构均可使用这个侧链状态作为出发点。
- 将复合物的组分分离至无接触状态;
- 侧链优化这个非结合态的结构;
- 将各组分恢复至初始位置和朝向。
pack_score = create_score_function('ref2015')
dock_score = create_score_function('ref2015','docking')
from pyrosetta.rosetta.protocols.docking import *
dock_prepack = DockingPrepackProtocol()
dock_prepack.set_dock_ppk(dock_ppk: bool)
dock_prepack.set_dock_ppk(True)
dock_prepack.score_and_output(filename: unicode, pose)
# setting
#dock_prepack.setup_defaults() !
moveable_jump = movable_jumps: pyrosetta.rosetta.utility.vector1_int()
moveable_jump.append(1)
dock_prepack.set_partners(partners: unicode('H_A'))
dock_prepack.set_movable_jumps(moveable_jump)
dock_prepack.set_rt_min(rt_min: bool) # Rotamer Trial with minimization(not currently implemented in docking),With the addition of unbound rotamers and minimization steps, the computational cost of RosettaDock generally increases by about 50% to 150%, 耗时大大增加,但是精度提升。
dock_prepack.set_sc_min(True) # Perform extra side chain minimization steps during packing steps(interface),仅仅是repack过程中做了能量最小化.
dock_prepack.set_scorefxn(dock_score)
dock_prepack.set_scorefxn_pack(pack_score)
#dock_prepack.set_task_factory(TaskFactory)
dock_prepack.apply(pose)
3 Lowres Docking Stage
3.1 DockingLowRes
低精度对接,使用简化侧链模型进行初步地对接。
from pyrosetta.rosetta.protocols.docking imports *
scorefxn_low = create_score_function("interchain_cen")
dock_lowres = DockingLowRes(scorefxn_low, rb_jump: int)
#dock_lowres.set_rb_trial(rb_trial_in: pyrosetta.rosetta.protocols.moves.TrialMover)
dock_lowres.set_inner_cycles(50)
dock_lowres.set_outer_cycles(10) # 共500步MC
dock_lowres.set_rot_magnitude(0.7)
dock_lowres.set_trans_magnitude(5)
# run
dock_lowres.apply(pose)
3.2 DockingLowResFilter
非单独使用,用于Low-res阶段的筛选:
- 检查对接组分之间是否存在相互接触
- 限制氨基酸冲突的量,保证组分间没有重合
- 检查限制条件是否满足。(只能从flag中读取?)
from pyrosetta.rosetta.protocols.docking imports *
lfilter = DockingLowResFilter()
lfilter.set_use_constraints(flag: bool, cutoff: float(1.0))
lfilter.apply(pose)
4 Highres Docking
4.1 DockingHighResLegacy(过时)
Mike:I would definitely recommend using the standard DockingHighRes mover for docking rather than the legacy version.
4.2 DockingHighRes
抽象的类,无法直接应用。但可以被其他的Protocl继承。
4.3 DockTaskFactory
用于在Docking侧链重排时的设置,可以设定各个组分如何进行Packing。
无需apply,自动被调用。在DockMCMProtocol运行期间,可以被命令行的'-norepack1 -norepack2'部分替代。
from pyrosetta.rosetta.protocols.docking improt *
dock_tf = DockTaskFactory()
dock_tf.set_norepack1(norepack1: bool) # 组分1不进行repack
dock_tf.set_norepack2(norepack2: bool) # 组分2不进行repack
dock_tf.set_prepack_only(prepack_only: bool) # 不允许设计
dock_tf.set_design_chains(design_chains: pyrosetta.rosetta.utility.vector1_char) # 设置哪些链可以被设计
dock_tf.add_additional_task_operaration(TaskOperation()) # 额外设置自定义的TaskOperation.
dock_tf.set_interface_definition_task_operation(interface_definition: protocols::simple_task_operations::InterfaceTaskOperation)
# 从cmd options中启动
dock_tf.register_options()
dock_tf.init_from_options()
4.4 DockMCMProtocol
会从DockingHighRes中继承方法。主要为设置内部和外部循环。
1 刚性体的随机移动符合Gaussian distribution,而并非是固定的值。
Magnitude: Gaussian distribution(0.1A)
Rot: Gaussian distribution(5.0°)
2 刚性体的能量最小化,为了节省CPU计算时间,如果刚性体的能量上升超过15,自动跳过能量最小化阶段,直接进行MC判断。
3 侧链优化(RotamerTrials & Metropolis criteria)每循环8步,就进行一次。
from pyrosetta.rosetta.protocols.docking import *
inti('-ex1 -ex2aro -use_input_sc -dock_mcm_trans_magnitude 0.5 -dock_mcm_rot_magnitude 10 -repack_period 8') # 此处可以设置转动的方向和角度大小,以及repack的周期,自动应用到了mcm中,因此不需要繁琐地调用DockMCMCycle.
pack_score = create_score_function('ref2015')
dock_score = create_score_function('ref2015','docking')
dock_mcm = DockMCMProtocol(rb_jump: int, dock_score, pack_score)
#dock_mcm = DockMCMProtocol(movable_jumps: pyrosetta.rosetta.utility.vector1_int, dock_score, pack_score)
dock_mcm.set_filter(filter: DockingHighResFilter)
dock_mcm.set_first_cycle(num: int) # 50
dock_mcm.set_second_cycle(num: int) # 10
dock_mcm.set_move_map(MoveMap()) # Min 也可以在DockMCMCycle中设置
dock_mcm.set_task_factory(TaskFactory)
dock_mcm.apply(pose)
4.5 DockMCMCycle
用于具体设置刚性体的移动、能量最小化参数以及侧链优化方法时有用,无需apply,在DockMCMProtocol运行期间,就会自动应用。
- 注意PyRosetta中无法设置repack的生效循环数;
- 也无法设定刚性体平移的幅度;
- 只要在设置
from pyrosetta.rosetta.protocols.docking import *
mcm_cycle = DockMCMCycle()
mcm_cycle.set_min_type(min_type: unicode) # 设置能量最小化
mcm_cycle.set_move_map(MoveMap()) # 能量最小化时,可以考虑骨架运动,从这里设置诱导契合效应(EnsembleDock)
mcm_cycle.set_rot_magnitude(value: float(5.0))
mcm_cycle.set_rtmin(bool) # 十分耗时。
mcm_cycle.set_scmin(bool) #
mcm_cycle.set_task_factory(TaskFactory())
4.6 DockMinMover
在hign-res Docking中不适用蒙特卡洛循环,而是使用单一个能量最小化后复合物结构作为输出。对应的选项为DockMCMCycle。
from pyrosetta.rosetta.protocols.docking import *
dock_min = DockMinMover()
pack_score = create_score_function('ref2015')
dock_score = create_score_function('ref2015','docking')
# Docking
dock_min.set_scorefxn(dock_score)
dock_min.set_movable_jumps(movable_jumps: pyrosetta.rosetta.utility.vector1_int)
dock_min.set_rt_min(rt_min: bool) # 十分耗时
dock_min.set_sc_min(sc_min: bool)
dock_min.set_partners(partners: unicode)
# Pack
dock_min.set_scorefxn_pack(pack_score)
dock_min.set_task_factory(TaskFactory)
dock_min.set_ignore_default_task()
dock_min.set_interface_definition_task_operation()
# Min
dock_min.set_default() # Sets up the default values for the obejct including the movemap and minimization type
dock_min.set_min_tolerance(min_tolerance: float)
dock_min.set_min_type(min_type: unicode)
# Run
dock_min.apply(pose)
4.6 InterfaceSidechainMinMover/SidechainMinMover
基础Mover: 定义interface的区间和能量最小化的方法;(High-res Docking repack阶段)
from pyrosetta.rosetta.protocols.docking import *
interface_min = InterfaceSidechainMinMover(rb_jump: int, scorefxn: pyrosetta.rosetta.core.scoring.ScoreFuncti
on, interface_dist: float)
interface_min.set_minmover(minmover: pyrosetta.rosetta.protocols.minimization_packing.MinMover)
interface_min.apply(pose)
4.8 DockingHighResFilter
非单独使用,在High-res docking阶段进行筛选:
- 检查总能量是否胜于cut-off
- 检查界面能量是否为负值
from pyrosetta.rosetta.protocols.docking import *
hfilter = DockingHighResFilter()
hfilter.set_score_cutoff(new_cutoff: float)
hfilter.set_score_margin(new_score_margin: float)
hfilter.set_scorefunction(ScoreFunction())
hfilter.apply(pose)
5 DockingEnsemble
实现流程:多构象对接仅在低精度实现,随后调用的是DockMCMProtocol。
ensemble_docking.png5.1 DockingEnsemble
非单独使用,用于设置Ensemble的基本信息使用(pdb构象路经、jump点、partner、打分函数等)。被DockingEnsemblePrepackProtocol、DockingLowResEnsemble调用。
from pyrosetta.rosetta.protocols.docking import *
ensemble_dock = DockingEnsemble(start_res: int, end_res: int, jump_id: int, ensemble_file_path: unicode, partner: unicode, scorefxn_low: pyrosetta.rosetta.core.scoring.ScoreFunction, scorefxn_high: pyrosetta.rosetta.core.scoring.ScoreFunction)
ensemble_dock.recover_and_pack_conformer_sidechains(Pose())
ensemble_dock.apply(pose)
5.2 DockingEnsemblePrepackProtocol
多构象的Prepack;
from pyrosetta.rosetta.protocols.docking import *
ensemble_prepack = DockingEnsemblePrepackProtocol()
ensemble_prepack.set_partners(partners: unicode)
jump = movable_jumps: pyrosetta.rosetta.utility.vector1_int()
jump.append(1)
ensemble_prepack.set_movable_jumps(jump)
ensemble_prepack.set_ensemble1(pyrosetta.rosetta.protocols.docking.DockingEnsemble)
ensemble_prepack.set_ensemble2(pyrosetta.rosetta.protocols.docking.DockingEnsemble)
ensemble_prepack.set_rt_min(rt_min: bool) # Rotamer Trial with minimization(not currently implemented in docking),With the addition of unbound rotamers and minimization steps, the computational cost of RosettaDock generally increases by about 50% to 150%, 耗时大大增加,但是精度提升。
ensemble_prepack.set_sc_min(True) # Perform extra side chain minimization steps during packing steps(interface),仅仅是repack过程中做了能量最小化.
ensemble_prepack.set_scorefxn(dock_score)
ensemble_prepack.set_scorefxn_pack(pack_score)
#ensemble_prepack.set_task_factory(TaskFactory)
ensemble_prepack.apply(pose)
5.3 DockingLowResEnsemble
低精度多构象对接;
from pyrosetta.rosetta.protocols.docking import *
scorefxn_low = create_score_function("interchain_cen")
jump = movable_jumps: pyrosetta.rosetta.utility.vector1_int()
jump.append(1)
ensemble_lowres = DockingLowResEnsemble(scorefxn_low, jump)
ensemble_lowre.set_ensemble1(pyrosetta.rosetta.protocols.docking.DockingEnsemble)
ensemble_lowre.set_ensemble2(pyrosetta.rosetta.protocols.docking.DockingEnsemble)
#ensemble_lowre.set_rb_trial(rb_trial_in: pyrosetta.rosetta.protocols.moves.TrialMover)
ensemble_lowre.set_inner_cycles(50)
ensemble_lowre.set_outer_cycles(10)
ensemble_lowre.set_rot_magnitude(0.7)
ensemble_lowre.set_trans_magnitude(5)
# run
ensemble_lowre.apply(pose)
5.4 ConformerSwitchMover
基础Mover
该Mover在Rosetta ensemble对接过程中负责交换构象副本,并根据打分结果从选取最佳的构象,从而达到构象选择的效果。
from pyrosetta.rosetta.protocols.docking import *
switch_conformer = ConformerSwitchMover(random_conformer: bool)
switch_conformer.set_specific_conformer(conformer_num_in: int)
switch_conformer.set_temperature(temp_in: float)
switch_conformer.apply(pose)
6. DockingProtocol
整合的方法;设置基本覆盖Perturbation、LowresDock、HighresDock。略
7 Docking API相关的函数:
大多是一些计算RMSD、相互作用界面能量、和foldtree设置相关的函数;
docking相关函数.png
网友评论