pyrosetta7-Packing and Relax

Side Chain Conformations and Dunbrack Energies

Recommended Resources

  1. Rotamer Library Homepage: http://dunbrack.fccc.edu/bbdep2010/
  2. Rotamer Library Interactive Overview: http://dunbrack.fccc.edu/bbdep2010/ImagesMovies.php
from pyrosetta import *
from pyrosetta.teaching import *
init()

pose = pose_from_pdb("inputs/1YY8.clean.pdb")
start_pose = Pose()
start_pose.assign(pose)

49号氨基酸残基的φ, ψ, 和 χ angles:

print(pose.residue(49).name())
print("Phi: %.5f\nPsi: %.5f\n" %(pose.phi(49), pose.psi(49)))
print("Chi 1: %.5f\nChi 2: %.5f\nChi 3: %.5f\nChi 4: %.5f" %(pose.chi(1, 49), pose.chi(2, 49), pose.chi(3, 49), pose.chi(4, 49)))
LYS
Phi: -122.41752
Psi: 153.08267

Chi 1: 68.12458
Chi 2: -169.18576
Chi 3: -175.37028
Chi 4: -169.58806

使用标准的全原子打分函数对我们的pose进行打分,并查看第49号氨基酸的能量值。查看侧链的打分标准Dunbrack energy(fa_dun),他表示在给定主链二面角的phi/psi时,侧链的构象概率。
所有的能量值都可以被转换成概率。使用energy (E) 计算侧链的近似概率:p=e^(-E)

scorefxn = get_fa_scorefxn()
scorefxn(pose)
energies = pose.energies()
print(energies.residue_total_energies(49))
print(energies.residue_total_energies(49)[pyrosetta.rosetta.core.scoring.fa_dun])
core.scoring.ScoreFunctionFactory: SCOREFUNCTION: ref2015
( fa_atr; -8.83354) ( fa_rep; 2.78019) ( fa_sol; 5.92847) ( fa_intra_atr; -1.68168) ( fa_intra_rep; 2.47533) ( fa_intra_sol; 1.20218) ( fa_intra_atr_xover4; -0.52776) ( fa_intra_rep_xover4; 0.191981) ( fa_intra_sol_xover4; 0.292855) ( fa_intra_atr_nonprotein; 0) ( fa_intra_rep_nonprotein; 0) ( fa_intra_sol_nonprotein; 0) ( fa_intra_RNA_base_phos_atr; 0) ( fa_intra_RNA_base_phos_rep; 0) ( fa_intra_RNA_base_phos_sol; 0) ( fa_atr_dummy; 0) ( fa_rep_dummy; 0) ( fa_sol_dummy; 0) ( fa_vdw_tinker; 0) ( lk_hack; 0) ( lk_ball; 0) ( lk_ball_wtd; 0.321463) ( lk_ball_iso; 0) ( lk_ball_bridge; 0) ( lk_ball_bridge_uncpl; 0) ( coarse_fa_atr; 0) ( coarse_fa_rep; 0) ( coarse_fa_sol; 0) ( coarse_beadlj; 0) ( mm_lj_intra_rep; 0) ( mm_lj_intra_atr; 0) ( mm_lj_inter_rep; 0) ( mm_lj_inter_atr; 0) ( mm_twist; 0) ( mm_bend; 0) ( mm_stretch; 0) ( lk_costheta; 0) ( lk_polar; 0) ( lk_nonpolar; 0) ( lk_polar_intra_RNA; 0) ( lk_nonpolar_intra_RNA; 0) ( fa_elec; -2.75782) ( fa_elec_bb_bb; 0) ( fa_elec_bb_sc; 0) ( fa_elec_sc_sc; 0) ( fa_intra_elec; 0) ( h2o_hbond; 0) ( dna_dr; 0) ( dna_bp; 0) ( dna_bs; 0) ( dna_ref; 0) ( peptide_bond; 0) ( pcs; 0) ( pcsTs1; 0) ( pcsTs2; 0) ( pcsTs3; 0) ( pcsTs4; 0) ( pcs2; 0) ( fastsaxs; 0) ( saxs_score; 0) ( saxs_cen_score; 0) ( saxs_fa_score; 0) ( pddf_score; 0) ( fiberdiffraction; 0) ( fiberdiffractiondens; 0) ( epr_deer_score; 0) ( fa_mbenv; 0) ( fa_mbsolv; 0) ( fa_elec_rna_phos_phos; 0) ( fa_elec_rna_phos_sugr; 0) ( fa_elec_rna_phos_base; 0) ( fa_elec_rna_sugr_sugr; 0) ( fa_elec_rna_sugr_base; 0) ( fa_elec_rna_base_base; 0) ( fa_elec_rna_phos_phos_fast; 0) ( fa_elec_rna_phos_sugr_fast; 0) ( fa_elec_rna_phos_base_fast; 0) ( fa_elec_rna_sugr_sugr_fast; 0) ( fa_elec_rna_sugr_base_fast; 0) ( fa_elec_rna_base_base_fast; 0) ( fa_elec_aro_aro; 0) ( fa_elec_aro_all; 0) ( hack_aro; 0) ( rna_fa_atr_base; 0) ( rna_fa_rep_base; 0) ( rna_data_backbone; 0) ( ch_bond; 0) ( ch_bond_bb_bb; 0) ( ch_bond_sc_sc; 0) ( ch_bond_bb_sc; 0) ( pro_close; 0) ( rama2b; 0) ( vdw; 0) ( cenpack; 0) ( cenpack_smooth; 0) ( cen_hb; 0) ( hybrid_vdw; 0) ( gauss; 0) ( rna_vdw; 0) ( rnp_vdw; 0) ( rna_base_backbone; 0) ( rna_backbone_backbone; 0) ( rna_repulsive; 0) ( rna_base_pair_pairwise; 0) ( rna_base_axis_pairwise; 0) ( rna_base_stagger_pairwise; 0) ( rna_base_stack_pairwise; 0) ( rna_base_stack_axis_pairwise; 0) ( rna_data_base; 0) ( rna_base_pair; 0) ( rna_base_axis; 0) ( rna_base_stagger; 0) ( rna_base_stack; 0) ( rna_base_stack_axis; 0) ( rnp_base_pair; 0) ( rnp_stack; 0) ( rnp_stack_xy; 0) ( rnp_pair; 0) ( rnp_pair_dist; 0) ( rnp_aa_to_rna_backbone; 0) ( rna_mg_point; 0) ( rna_mg_point_indirect; 0) ( mg; 0) ( mg_lig; 0) ( mg_sol; 0) ( mg_ref; 0) ( hoh_ref; 0) ( rna_torsion; 0) ( rna_torsion_sc; 0) ( rna_suite; 0) ( rna_jr_suite; 0) ( suiteness_bonus; 0) ( tna_suite; 0) ( rna_sugar_close; 0) ( fa_stack; 0) ( fa_stack_lower; 0) ( fa_stack_upper; 0) ( fa_stack_aro; 0) ( fa_stack_ext; 0) ( fa_stack_sol; 0) ( fa_stack_lr; 0) ( fa_stack_rna_protein; 0) ( fa_stack_rna_protein_aro; 0) ( ss_contact_worst; 0) ( stack_elec; 0) ( stack_elec_base_base; 0) ( stack_elec_base_bb; 0) ( alignment; 0) ( dna_bb_torsion; 0) ( dna_sugar_close; 0) ( dna_base_distance; 0) ( geom_sol_fast; 0) ( geom_sol_fast_intra_RNA; 0) ( fa_cust_pair_dist; 0) ( custom_atom_pair; 0) ( orbitals_hpol_bb; 0) ( pci_cation_pi; 0) ( pci_pi_pi; 0) ( pci_salt_bridge; 0) ( pci_hbond; 0) ( arg_cation_pi; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_first; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_163; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_164; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_165; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_166; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_167; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_168; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_169; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_170; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_171; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_last; 0) ( python; 0) ( fa_pair; 0) ( fa_pair_aro_aro; 0) ( fa_pair_aro_pol; 0) ( fa_pair_pol_pol; 0) ( hbond_sr_bb; 0) ( hbond_lr_bb; 0) ( hbond_bb_sc; 0) ( hbond_sr_bb_sc; 0) ( hbond_lr_bb_sc; 0) ( hbond_sc; 0) ( hbond_intra; 0) ( hbond_wat; 0) ( wat_entropy; 0) ( hbond; 0) ( npd_hbond_sr_bb; 0) ( npd_hbond_lr_bb; 0) ( npd_hbond_bb_sc; 0) ( npd_hbond_sr_bb_sc; 0) ( npd_hbond_lr_bb_sc; 0) ( npd_hbond_sc; 0) ( npd_hbond_intra; 0) ( npd_hbond; 0) ( fa_grpelec; 0) ( PyRosettaTwoBodyContextDependentEnergy_first; 0) ( PyRosettaTwoBodyContextDependentEnergy_198; 0) ( PyRosettaTwoBodyContextDependentEnergy_199; 0) ( PyRosettaTwoBodyContextDependentEnergy_200; 0) ( PyRosettaTwoBodyContextDependentEnergy_201; 0) ( PyRosettaTwoBodyContextDependentEnergy_202; 0) ( PyRosettaTwoBodyContextDependentEnergy_203; 0) ( PyRosettaTwoBodyContextDependentEnergy_204; 0) ( PyRosettaTwoBodyContextDependentEnergy_205; 0) ( PyRosettaTwoBodyContextDependentEnergy_206; 0) ( PyRosettaTwoBodyContextDependentEnergy_last; 0) ( interface_dd_pair; 0) ( geom_sol; 0) ( geom_sol_intra_RNA; 0) ( occ_sol_fitted; 0) ( occ_sol_fitted_onebody; 0) ( occ_sol_exact; 0) ( cen_rot_pair; 0) ( cen_rot_pair_ang; 0) ( cen_rot_pair_dih; 0) ( pair; 0) ( cen_pair_smooth; 0) ( Mpair; 0) ( mp_pair; 0) ( fa_mpsolv; 0) ( suck; 0) ( rna_rg; 0) ( rna_motif; 0) ( facts_elec; 0) ( facts_solv; 0) ( facts_sasa; 0) ( motif_dock; 0) ( pointwater; 0) ( goap; 0) ( goap_dist; 0) ( goap_angle; 0) ( approximate_buried_unsat_penalty; 0) ( interchain_pair; 0) ( interchain_vdw; 0) ( gb_elec; 0) ( multipole_elec; 0) ( fa_sasa; 0) ( dslf_ss_dst; 0) ( dslf_cs_ang; 0) ( dslf_ss_dih; 0) ( dslf_ca_dih; 0) ( dslf_cbs_ds; 0) ( dslf_fa13; 0) ( dslfc_cen_dst; 0) ( dslfc_cb_dst; 0) ( dslfc_ang; 0) ( dslfc_cb_dih; 0) ( dslfc_bb_dih; 0) ( dslfc_rot; 0) ( dslfc_trans; 0) ( dslfc_RT; 0) ( atom_pair_constraint; 0) ( base_pair_constraint; 0) ( coarse_chainbreak_constraint; 0) ( constant_constraint; 0) ( coordinate_constraint; 0) ( angle_constraint; 0) ( dihedral_constraint; 0) ( big_bin_constraint; 0) ( dunbrack_constraint; 0) ( site_constraint; 0) ( metalhash_constraint; 0) ( metalbinding_constraint; 0) ( rna_stub_coord_hack; 0) ( bond_geometry; 0) ( rna_bond_geometry; 0) ( Hpol_bond_geometry; 0) ( rama; 0) ( omega; 0.011685) ( fa_dun; 3.97212) ( fa_dun_dev; 1.07017) ( fa_dun_rot; 2.90195) ( fa_dun_semi; 0) ( cen_rot_dun; 0) ( dna_chi; 0) ( p_aa_pp; 0.0112208) ( p_aa_ss; 0) ( yhh_planarity; 0) ( hxl_tors; 0) ( h2o_intra; 0) ( ref; -0.71458) ( ref_nc; 0) ( seqdep_ref; 0) ( nmer_ref; 0) ( nmer_pssm; 0) ( nmer_svm; 0) ( envsmooth; 0) ( e_pH; 0) ( rna_bulge; 0) ( dna_dihedral_bb; 0) ( dna_dihedral_chi; 0) ( dna_dihedral_sugar; 0) ( sugar_bb; 0) ( free_suite; 0) ( free_2HOprime; 0) ( free_side_chain; 0) ( free_base; 0) ( free_res; 0) ( free_dof; 0) ( intermol; 0) ( other_pose; 0) ( special_rot; 0) ( PB_elec; 0) ( cen_env_smooth; 0) ( cbeta_smooth; 0) ( cen_rot_env; 0) ( cen_rot_cbeta; 0) ( env; 0) ( cbeta; 0) ( DFIRE; 0) ( Menv; 0) ( Mcbeta; 0) ( Menv_non_helix; 0) ( Menv_termini; 0) ( Menv_tm_proj; 0) ( Mlipo; 0) ( rg; 0) ( rg_local; 0) ( co; 0) ( hs_pair; 0) ( ss_pair; 0) ( rsigma; 0) ( sheet; 0) ( burial_v2; 0) ( burial; 0) ( abego; 0) ( covalent_labeling; 0) ( covalent_labeling_fa; 0) ( hrf_ms_labeling; 0) ( hrf_dynamics; 0) ( depc_ms; 0) ( rnp_env; 0) ( loop_close; 0) ( missing_res; 0) ( mp_env; 0) ( mp_cbeta; 0) ( mp_lipo; 0) ( mp_termini; 0) ( mp_nonhelix; 0) ( mp_tmproj; 0) ( fa_mpenv; 0) ( fa_mpenv_smooth; 0) ( fa_water_to_bilayer; 0) ( mp_res_lipo; 0) ( span_ins; 0) ( mp_span_ang; 0) ( mp_helicality; 0) ( natbias_ss; 0) ( natbias_hs; 0) ( natbias_hh; 0) ( natbias_stwist; 0) ( aa_cmp; 0) ( dock_ens_conf; 0) ( csa; 0) ( dc; 0) ( rdc; 0) ( rdc_segments; 0) ( rdc_rohl; 0) ( nmr_pcs; 0) ( nmr_rdc; 0) ( nmr_pre; 0) ( cen_pair_motifs; 0) ( cen_pair_motif_degree; 0) ( holes; 0) ( holes_decoy; 0) ( holes_resl; 0) ( holes_min; 0) ( holes_min_mean; 0) ( rna_chem_shift; 0) ( rna_chem_map; 0) ( rna_chem_map_lores; 0) ( rna_partition; 0) ( dab_sasa; 0) ( dab_sev; 0) ( sa; 0) ( d2h_sa; 0) ( ProQM; 0) ( ProQ; 0) ( interchain_env; 0) ( interchain_contact; 0) ( chainbreak; 0) ( linear_chainbreak; 0) ( overlap_chainbreak; 0) ( distance_chainbreak; 0) ( dof_constraint; 0) ( branch_conn; 0) ( linear_branch_conn; 0) ( rama_prepro; -0.0498918) ( paa_abego3; 0) ( cart_bonded; 0) ( cart_bonded_angle; 0) ( cart_bonded_length; 0) ( cart_bonded_ring; 0) ( cart_bonded_torsion; 0) ( cart_bonded_proper; 0) ( cart_bonded_improper; 0) ( gen_bonded; 0) ( gen_bonded_bond; 0) ( gen_bonded_angle; 0) ( gen_bonded_torsion; 0) ( gen_bonded_improper; 0) ( neigh_vect; 0) ( neigh_count; 0) ( neigh_vect_raw; 0) ( symE_bonus; 0) ( sym_lig; 0) ( mhc_epitope; 0) ( pack_stat; 0) ( rms_energy; 0) ( res_type_constraint; 0) ( res_type_linking_constraint; 0) ( pocket_constraint; 0) ( backbone_stub_constraint; 0) ( backbone_stub_linear_constraint; 0) ( surface; 0) ( p_aa; 0) ( unfolded; 0) ( split_unfolded_two_body; 0) ( fa_atr_ref; 0) ( fa_rep_ref; 0) ( fa_sol_ref; 0) ( fa_elec_ref; 0) ( hbond_ref; 0) ( dslf_fa13_ref; 0) ( fa_intra_atr_ref; 0) ( fa_intra_rep_ref; 0) ( fa_intra_sol_ref; 0) ( pro_close_ref; 0) ( fa_dun_ref; 0) ( fa_dun_dev_ref; 0) ( fa_dun_rot_ref; 0) ( fa_dun_semi_ref; 0) ( rama_ref; 0) ( p_aa_pp_ref; 0) ( omega_ref; 0) ( mm_lj_intra_rep_ref; 0) ( mm_lj_intra_atr_ref; 0) ( mm_twist_ref; 0) ( elec_dens_fast; 0) ( elec_dens_window; 0) ( elec_dens_whole_structure_ca; 0) ( elec_dens_whole_structure_allatom; 0) ( elec_dens_atomwise; 0) ( grid_vdw; 0) ( xtal_ml; 0) ( xtal_rwork; 0) ( xtal_rfree; 0) ( hpatch; 0) ( Menv_smooth; 0) ( wat_desolv; 0) ( ring_close; 0) ( aa_repeat; 0) ( aa_composition; 0) ( aspartimide_penalty; 0) ( hbnet; 0) ( buried_unsatisfied_penalty; 0) ( netcharge; 0) ( voids_penalty; 0) ( sap_constraint; 0) ( dna_env; 0) ( dna_pair; 0) ( dump_trajectory; 0) ( PyRosettaEnergy_first; 0) ( PyRosettaEnergy_465; 0) ( PyRosettaEnergy_466; 0) ( PyRosettaEnergy_467; 0) ( PyRosettaEnergy_468; 0) ( PyRosettaEnergy_469; 0) ( PyRosettaEnergy_470; 0) ( PyRosettaEnergy_471; 0) ( PyRosettaEnergy_472; 0) ( PyRosettaEnergy_473; 0) ( PyRosettaEnergy_last; 0) ( sidechain_neighbors; 0) ( target_clash; 0) ( membrane_span_constraint; 0) ( membrane_span_term_z_constraint; 0) ( aromatic_restraint; 0) ( rna_coarse_dist; 0) ( total_score; -1.45222) ( dummy_score_type; 0) 
3.972124341964819

使用*pose.set_chi(<i>, <res_num>, <chi>) *将49号氨基酸的侧链设置为全抗构象,这里的i为χ的索引,chi为新的角。对pose重新打分并查看Dunbrack energy.。

for i in range(1, 5):
    pose.set_chi(i, 49, 180)
scorefxn(pose)
print(energies.residue_total_energies(49))
print(energies.residue_total_energies(49)[pyrosetta.rosetta.core.scoring.fa_dun])
( fa_atr; -11.6375) ( fa_rep; 789.493) ( fa_sol; 11.6773) ( fa_intra_atr; -1.44441) ( fa_intra_rep; 1.80557) ( fa_intra_sol; 0.785201) ( fa_intra_atr_xover4; -0.343391) ( fa_intra_rep_xover4; 0.112709) ( fa_intra_sol_xover4; 0.105435) ( fa_intra_atr_nonprotein; 0) ( fa_intra_rep_nonprotein; 0) ( fa_intra_sol_nonprotein; 0) ( fa_intra_RNA_base_phos_atr; 0) ( fa_intra_RNA_base_phos_rep; 0) ( fa_intra_RNA_base_phos_sol; 0) ( fa_atr_dummy; 0) ( fa_rep_dummy; 0) ( fa_sol_dummy; 0) ( fa_vdw_tinker; 0) ( lk_hack; 0) ( lk_ball; 0) ( lk_ball_wtd; 0.302965) ( lk_ball_iso; 0) ( lk_ball_bridge; 0) ( lk_ball_bridge_uncpl; 0) ( coarse_fa_atr; 0) ( coarse_fa_rep; 0) ( coarse_fa_sol; 0) ( coarse_beadlj; 0) ( mm_lj_intra_rep; 0) ( mm_lj_intra_atr; 0) ( mm_lj_inter_rep; 0) ( mm_lj_inter_atr; 0) ( mm_twist; 0) ( mm_bend; 0) ( mm_stretch; 0) ( lk_costheta; 0) ( lk_polar; 0) ( lk_nonpolar; 0) ( lk_polar_intra_RNA; 0) ( lk_nonpolar_intra_RNA; 0) ( fa_elec; -9.02391) ( fa_elec_bb_bb; 0) ( fa_elec_bb_sc; 0) ( fa_elec_sc_sc; 0) ( fa_intra_elec; 0) ( h2o_hbond; 0) ( dna_dr; 0) ( dna_bp; 0) ( dna_bs; 0) ( dna_ref; 0) ( peptide_bond; 0) ( pcs; 0) ( pcsTs1; 0) ( pcsTs2; 0) ( pcsTs3; 0) ( pcsTs4; 0) ( pcs2; 0) ( fastsaxs; 0) ( saxs_score; 0) ( saxs_cen_score; 0) ( saxs_fa_score; 0) ( pddf_score; 0) ( fiberdiffraction; 0) ( fiberdiffractiondens; 0) ( epr_deer_score; 0) ( fa_mbenv; 0) ( fa_mbsolv; 0) ( fa_elec_rna_phos_phos; 0) ( fa_elec_rna_phos_sugr; 0) ( fa_elec_rna_phos_base; 0) ( fa_elec_rna_sugr_sugr; 0) ( fa_elec_rna_sugr_base; 0) ( fa_elec_rna_base_base; 0) ( fa_elec_rna_phos_phos_fast; 0) ( fa_elec_rna_phos_sugr_fast; 0) ( fa_elec_rna_phos_base_fast; 0) ( fa_elec_rna_sugr_sugr_fast; 0) ( fa_elec_rna_sugr_base_fast; 0) ( fa_elec_rna_base_base_fast; 0) ( fa_elec_aro_aro; 0) ( fa_elec_aro_all; 0) ( hack_aro; 0) ( rna_fa_atr_base; 0) ( rna_fa_rep_base; 0) ( rna_data_backbone; 0) ( ch_bond; 0) ( ch_bond_bb_bb; 0) ( ch_bond_sc_sc; 0) ( ch_bond_bb_sc; 0) ( pro_close; 0) ( rama2b; 0) ( vdw; 0) ( cenpack; 0) ( cenpack_smooth; 0) ( cen_hb; 0) ( hybrid_vdw; 0) ( gauss; 0) ( rna_vdw; 0) ( rnp_vdw; 0) ( rna_base_backbone; 0) ( rna_backbone_backbone; 0) ( rna_repulsive; 0) ( rna_base_pair_pairwise; 0) ( rna_base_axis_pairwise; 0) ( rna_base_stagger_pairwise; 0) ( rna_base_stack_pairwise; 0) ( rna_base_stack_axis_pairwise; 0) ( rna_data_base; 0) ( rna_base_pair; 0) ( rna_base_axis; 0) ( rna_base_stagger; 0) ( rna_base_stack; 0) ( rna_base_stack_axis; 0) ( rnp_base_pair; 0) ( rnp_stack; 0) ( rnp_stack_xy; 0) ( rnp_pair; 0) ( rnp_pair_dist; 0) ( rnp_aa_to_rna_backbone; 0) ( rna_mg_point; 0) ( rna_mg_point_indirect; 0) ( mg; 0) ( mg_lig; 0) ( mg_sol; 0) ( mg_ref; 0) ( hoh_ref; 0) ( rna_torsion; 0) ( rna_torsion_sc; 0) ( rna_suite; 0) ( rna_jr_suite; 0) ( suiteness_bonus; 0) ( tna_suite; 0) ( rna_sugar_close; 0) ( fa_stack; 0) ( fa_stack_lower; 0) ( fa_stack_upper; 0) ( fa_stack_aro; 0) ( fa_stack_ext; 0) ( fa_stack_sol; 0) ( fa_stack_lr; 0) ( fa_stack_rna_protein; 0) ( fa_stack_rna_protein_aro; 0) ( ss_contact_worst; 0) ( stack_elec; 0) ( stack_elec_base_base; 0) ( stack_elec_base_bb; 0) ( alignment; 0) ( dna_bb_torsion; 0) ( dna_sugar_close; 0) ( dna_base_distance; 0) ( geom_sol_fast; 0) ( geom_sol_fast_intra_RNA; 0) ( fa_cust_pair_dist; 0) ( custom_atom_pair; 0) ( orbitals_hpol_bb; 0) ( pci_cation_pi; 0) ( pci_pi_pi; 0) ( pci_salt_bridge; 0) ( pci_hbond; 0) ( arg_cation_pi; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_first; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_163; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_164; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_165; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_166; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_167; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_168; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_169; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_170; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_171; 0) ( PyRosettaTwoBodyContextIndepenedentEnergy_last; 0) ( python; 0) ( fa_pair; 0) ( fa_pair_aro_aro; 0) ( fa_pair_aro_pol; 0) ( fa_pair_pol_pol; 0) ( hbond_sr_bb; 0) ( hbond_lr_bb; 0) ( hbond_bb_sc; 0) ( hbond_sr_bb_sc; 0) ( hbond_lr_bb_sc; 0) ( hbond_sc; -0.274355) ( hbond_intra; 0) ( hbond_wat; 0) ( wat_entropy; 0) ( hbond; 0) ( npd_hbond_sr_bb; 0) ( npd_hbond_lr_bb; 0) ( npd_hbond_bb_sc; 0) ( npd_hbond_sr_bb_sc; 0) ( npd_hbond_lr_bb_sc; 0) ( npd_hbond_sc; 0) ( npd_hbond_intra; 0) ( npd_hbond; 0) ( fa_grpelec; 0) ( PyRosettaTwoBodyContextDependentEnergy_first; 0) ( PyRosettaTwoBodyContextDependentEnergy_198; 0) ( PyRosettaTwoBodyContextDependentEnergy_199; 0) ( PyRosettaTwoBodyContextDependentEnergy_200; 0) ( PyRosettaTwoBodyContextDependentEnergy_201; 0) ( PyRosettaTwoBodyContextDependentEnergy_202; 0) ( PyRosettaTwoBodyContextDependentEnergy_203; 0) ( PyRosettaTwoBodyContextDependentEnergy_204; 0) ( PyRosettaTwoBodyContextDependentEnergy_205; 0) ( PyRosettaTwoBodyContextDependentEnergy_206; 0) ( PyRosettaTwoBodyContextDependentEnergy_last; 0) ( interface_dd_pair; 0) ( geom_sol; 0) ( geom_sol_intra_RNA; 0) ( occ_sol_fitted; 0) ( occ_sol_fitted_onebody; 0) ( occ_sol_exact; 0) ( cen_rot_pair; 0) ( cen_rot_pair_ang; 0) ( cen_rot_pair_dih; 0) ( pair; 0) ( cen_pair_smooth; 0) ( Mpair; 0) ( mp_pair; 0) ( fa_mpsolv; 0) ( suck; 0) ( rna_rg; 0) ( rna_motif; 0) ( facts_elec; 0) ( facts_solv; 0) ( facts_sasa; 0) ( motif_dock; 0) ( pointwater; 0) ( goap; 0) ( goap_dist; 0) ( goap_angle; 0) ( approximate_buried_unsat_penalty; 0) ( interchain_pair; 0) ( interchain_vdw; 0) ( gb_elec; 0) ( multipole_elec; 0) ( fa_sasa; 0) ( dslf_ss_dst; 0) ( dslf_cs_ang; 0) ( dslf_ss_dih; 0) ( dslf_ca_dih; 0) ( dslf_cbs_ds; 0) ( dslf_fa13; 0) ( dslfc_cen_dst; 0) ( dslfc_cb_dst; 0) ( dslfc_ang; 0) ( dslfc_cb_dih; 0) ( dslfc_bb_dih; 0) ( dslfc_rot; 0) ( dslfc_trans; 0) ( dslfc_RT; 0) ( atom_pair_constraint; 0) ( base_pair_constraint; 0) ( coarse_chainbreak_constraint; 0) ( constant_constraint; 0) ( coordinate_constraint; 0) ( angle_constraint; 0) ( dihedral_constraint; 0) ( big_bin_constraint; 0) ( dunbrack_constraint; 0) ( site_constraint; 0) ( metalhash_constraint; 0) ( metalbinding_constraint; 0) ( rna_stub_coord_hack; 0) ( bond_geometry; 0) ( rna_bond_geometry; 0) ( Hpol_bond_geometry; 0) ( rama; 0) ( omega; 0.011685) ( fa_dun; 3.79108) ( fa_dun_dev; 0.030004) ( fa_dun_rot; 3.76108) ( fa_dun_semi; 0) ( cen_rot_dun; 0) ( dna_chi; 0) ( p_aa_pp; 0.0112208) ( p_aa_ss; 0) ( yhh_planarity; 0) ( hxl_tors; 0) ( h2o_intra; 0) ( ref; -0.71458) ( ref_nc; 0) ( seqdep_ref; 0) ( nmer_ref; 0) ( nmer_pssm; 0) ( nmer_svm; 0) ( envsmooth; 0) ( e_pH; 0) ( rna_bulge; 0) ( dna_dihedral_bb; 0) ( dna_dihedral_chi; 0) ( dna_dihedral_sugar; 0) ( sugar_bb; 0) ( free_suite; 0) ( free_2HOprime; 0) ( free_side_chain; 0) ( free_base; 0) ( free_res; 0) ( free_dof; 0) ( intermol; 0) ( other_pose; 0) ( special_rot; 0) ( PB_elec; 0) ( cen_env_smooth; 0) ( cbeta_smooth; 0) ( cen_rot_env; 0) ( cen_rot_cbeta; 0) ( env; 0) ( cbeta; 0) ( DFIRE; 0) ( Menv; 0) ( Mcbeta; 0) ( Menv_non_helix; 0) ( Menv_termini; 0) ( Menv_tm_proj; 0) ( Mlipo; 0) ( rg; 0) ( rg_local; 0) ( co; 0) ( hs_pair; 0) ( ss_pair; 0) ( rsigma; 0) ( sheet; 0) ( burial_v2; 0) ( burial; 0) ( abego; 0) ( covalent_labeling; 0) ( covalent_labeling_fa; 0) ( hrf_ms_labeling; 0) ( hrf_dynamics; 0) ( depc_ms; 0) ( rnp_env; 0) ( loop_close; 0) ( missing_res; 0) ( mp_env; 0) ( mp_cbeta; 0) ( mp_lipo; 0) ( mp_termini; 0) ( mp_nonhelix; 0) ( mp_tmproj; 0) ( fa_mpenv; 0) ( fa_mpenv_smooth; 0) ( fa_water_to_bilayer; 0) ( mp_res_lipo; 0) ( span_ins; 0) ( mp_span_ang; 0) ( mp_helicality; 0) ( natbias_ss; 0) ( natbias_hs; 0) ( natbias_hh; 0) ( natbias_stwist; 0) ( aa_cmp; 0) ( dock_ens_conf; 0) ( csa; 0) ( dc; 0) ( rdc; 0) ( rdc_segments; 0) ( rdc_rohl; 0) ( nmr_pcs; 0) ( nmr_rdc; 0) ( nmr_pre; 0) ( cen_pair_motifs; 0) ( cen_pair_motif_degree; 0) ( holes; 0) ( holes_decoy; 0) ( holes_resl; 0) ( holes_min; 0) ( holes_min_mean; 0) ( rna_chem_shift; 0) ( rna_chem_map; 0) ( rna_chem_map_lores; 0) ( rna_partition; 0) ( dab_sasa; 0) ( dab_sev; 0) ( sa; 0) ( d2h_sa; 0) ( ProQM; 0) ( ProQ; 0) ( interchain_env; 0) ( interchain_contact; 0) ( chainbreak; 0) ( linear_chainbreak; 0) ( overlap_chainbreak; 0) ( distance_chainbreak; 0) ( dof_constraint; 0) ( branch_conn; 0) ( linear_branch_conn; 0) ( rama_prepro; -0.0498918) ( paa_abego3; 0) ( cart_bonded; 0) ( cart_bonded_angle; 0) ( cart_bonded_length; 0) ( cart_bonded_ring; 0) ( cart_bonded_torsion; 0) ( cart_bonded_proper; 0) ( cart_bonded_improper; 0) ( gen_bonded; 0) ( gen_bonded_bond; 0) ( gen_bonded_angle; 0) ( gen_bonded_torsion; 0) ( gen_bonded_improper; 0) ( neigh_vect; 0) ( neigh_count; 0) ( neigh_vect_raw; 0) ( symE_bonus; 0) ( sym_lig; 0) ( mhc_epitope; 0) ( pack_stat; 0) ( rms_energy; 0) ( res_type_constraint; 0) ( res_type_linking_constraint; 0) ( pocket_constraint; 0) ( backbone_stub_constraint; 0) ( backbone_stub_linear_constraint; 0) ( surface; 0) ( p_aa; 0) ( unfolded; 0) ( split_unfolded_two_body; 0) ( fa_atr_ref; 0) ( fa_rep_ref; 0) ( fa_sol_ref; 0) ( fa_elec_ref; 0) ( hbond_ref; 0) ( dslf_fa13_ref; 0) ( fa_intra_atr_ref; 0) ( fa_intra_rep_ref; 0) ( fa_intra_sol_ref; 0) ( pro_close_ref; 0) ( fa_dun_ref; 0) ( fa_dun_dev_ref; 0) ( fa_dun_rot_ref; 0) ( fa_dun_semi_ref; 0) ( rama_ref; 0) ( p_aa_pp_ref; 0) ( omega_ref; 0) ( mm_lj_intra_rep_ref; 0) ( mm_lj_intra_atr_ref; 0) ( mm_twist_ref; 0) ( elec_dens_fast; 0) ( elec_dens_window; 0) ( elec_dens_whole_structure_ca; 0) ( elec_dens_whole_structure_allatom; 0) ( elec_dens_atomwise; 0) ( grid_vdw; 0) ( xtal_ml; 0) ( xtal_rwork; 0) ( xtal_rfree; 0) ( hpatch; 0) ( Menv_smooth; 0) ( wat_desolv; 0) ( ring_close; 0) ( aa_repeat; 0) ( aa_composition; 0) ( aspartimide_penalty; 0) ( hbnet; 0) ( buried_unsatisfied_penalty; 0) ( netcharge; 0) ( voids_penalty; 0) ( sap_constraint; 0) ( dna_env; 0) ( dna_pair; 0) ( dump_trajectory; 0) ( PyRosettaEnergy_first; 0) ( PyRosettaEnergy_465; 0) ( PyRosettaEnergy_466; 0) ( PyRosettaEnergy_467; 0) ( PyRosettaEnergy_468; 0) ( PyRosettaEnergy_469; 0) ( PyRosettaEnergy_470; 0) ( PyRosettaEnergy_471; 0) ( PyRosettaEnergy_472; 0) ( PyRosettaEnergy_473; 0) ( PyRosettaEnergy_last; 0) ( sidechain_neighbors; 0) ( target_clash; 0) ( membrane_span_constraint; 0) ( membrane_span_term_z_constraint; 0) ( aromatic_restraint; 0) ( rna_coarse_dist; 0) ( total_score; 427.308) ( dummy_score_type; 0) 
3.7910821714280245

Packing and Relax

Overview

这里,我们将学习如何去优化蛋白质的侧链,在Rosetta中,我们称之为packing。我们将使用TaskFactories来控制我们要选择的氨基酸残基。我们将使用这些知识来优化蛋白质中特定的区域,在下一个章节中我们将学会如何设计蛋白质。

Imports

在我们开始之前,我们需要导入Rosetta中一些特殊的模块。大部分工具在我们from pyrosetta import *的时候已经自动导入了,但是部分没有。我们需要养成导入所有需要模块的习惯。这样的话,我们可以更轻松的组织Rosetta,更容易的找到我们需要的工具。

#Python
from pyrosetta import *
from pyrosetta.rosetta import *
from pyrosetta.teaching import *

#Core Includes
from rosetta.core.kinematics import MoveMap
from rosetta.core.kinematics import FoldTree
from rosetta.core.pack.task import TaskFactory
from rosetta.core.pack.task import operation
from rosetta.core.simple_metrics import metrics
from rosetta.core.select import residue_selector as selections
from rosetta.core import select
from rosetta.core.select.movemap import *

#Protocol Includes
from rosetta.protocols import minimization_packing as pack_min
from rosetta.protocols import relax as rel
from rosetta.protocols.antibody.residue_selector import CDRResidueSelector
from rosetta.protocols.antibody import *
from rosetta.protocols.loops import *
from rosetta.protocols.relax import FastRelax

Intitlialization

为了加速我们demo过程,我们将relax默认的5次设置为两次。这在代码中有点棘手。我们还设置了输入抗体编号方案,以便Rosetta了解我们的抗体的命名法。我们也可以添加-ex1 和 -ex2来增加我们侧链的packing,但是这会减慢我们的demo,所以将其舍弃了。

init('-use_input_sc -input_ab_scheme AHo_Scheme -ignore_unrecognized_res \
     -ignore_zero_occupancy false -load_PDB_components false -relax:default_repeats 2 -no_fconfig')

Import and copy pose

开始导入pose,我们将使用来自PDB的一个抗体。这次我们是使用了clone function来复制original_pose,使用等号只会使用python中所谓的浅副本,我们对pose的任何改变都将在original_pose中看到。clone operation可以复制original_pose的所有信息,我们可以将其看成python中的copy.deep_copy

#Import a pose
pose = pose_from_pdb("inputs/2r0l_1_1.pdb")
original_pose = pose.clone()

Setup a Normal TaskFactory

TaskFactory 是我们用来控制pose中需要packing的氨基酸的,我们首先通过InitializeFromCommandline,该初始化使用了pyrosetta.init()函数中指定的任何选项。TaskFactory 是由TaskOperations的列表组成,TaskOperations由一些基本的信息组成来控制packing,然后可以设置在TaskFactory 的顺序。在Rosetta中,所有的氨基酸残基都是默认的pack和design,我们使用TaskOperations来来关闭一些操作,这里我们使用RestrictToRepacking来关闭design的操作。

tf = TaskFactory()
tf.push_back(operation.InitializeFromCommandline())
tf.push_back(operation.RestrictToRepacking())

Setup The Packer

这里,我们设置packer并将TaskFactory传递给他。正常情况下,如果可以被packer,那么他就要接受TaskFactory。蛋白质的每一次单独的packer,TaskFactory都会生成PackerTask。它包括了Rosetta需要去packing和design的说明。一些TaskOperations可以随着pose的变化而变化,例如响铃氨基酸在每一次packing的动态变化,这是为什么我们使用TaskFactory来进行packing的原因,而不是像我们早期在网络上看到的使用PackerTask 来进行设置的原因。

packer = pack_min.PackRotamersMover()
packer.task_factory(tf)

#Note that we are not passing a scorefunction here.  We will use the default, cmd-line scorefunction, 
# which is accessed through rosetta.core.scoring.get_score_function() and part of the packer.  We use use a scorefunction later. 

#Run the packer. (Note this may take a few minutes)
#Skip for tests
if not os.getenv("DEBUG"):
    packer.apply(pose)

#Dump the PDB
pose.dump_pdb('/outputs/2r0l_all_repack.pdb')

我们可以查看packing前后的pose能量值的变化:

scorefxn = get_score_function()
before = scorefxn.score(original_pose)

我们也可以查看packing前后序列的变化情况。可以使用SequenceMetric rosetta.core.simple_metrics.metrics.SequenceMetric,或者直接pose.sequence(),确保他们的序列是一样的,packing仅仅是设计了单氨基酸的侧链。

seq_metric = metrics.SequenceMetric()

print("Sequence:")
print(seq_metric.calculate(pose))
#OR
print("\nSequence:")
print(pose.sequence())
Sequence:
DIQMTQSPSSLSASVGDRVTITCRASQDVSTAVAWYQQKPGKAPKLLIYSASFLYSGVPSRFSGSGSGTDFTLTISSLQPEDFATYYCQQSYTTPPTFGQGTKVEIKREVQLVESGGGLVQPGGSLRLSCAASGFTISNSGIHWVRQAPGKGLEWVGWIYPTGGATDYADSVKGRFTISADTSKNTAYLQMNSLRAEDTAVYYCARFWWRSFDYWGQGTLVTVSSIIGGSSSLPGSHPWLAAIYIGDSFCAGSLVHTCWVVSAAHCFSHSPPRDSVSVVLGQHFFNRTTDVTQTFGIEKYIPYTLYSVFNPSDHDLVLIRLKKKGDRCATRSQFVQPICLPEPGSTFPAGHKCQIAGWGHLDENVSGYSSSLREALVPLVADHKCSSPEVYGADISPNMLCAGYFDCKSDACQGDSGGPLACEKNGVAYLYGIISWGDGCGRLHKPGVYTRVANYVDWINDRIR

Sequence:
DIQMTQSPSSLSASVGDRVTITCRASQDVSTAVAWYQQKPGKAPKLLIYSASFLYSGVPSRFSGSGSGTDFTLTISSLQPEDFATYYCQQSYTTPPTFGQGTKVEIKREVQLVESGGGLVQPGGSLRLSCAASGFTISNSGIHWVRQAPGKGLEWVGWIYPTGGATDYADSVKGRFTISADTSKNTAYLQMNSLRAEDTAVYYCARFWWRSFDYWGQGTLVTVSSIIGGSSSLPGSHPWLAAIYIGDSFCAGSLVHTCWVVSAAHCFSHSPPRDSVSVVLGQHFFNRTTDVTQTFGIEKYIPYTLYSVFNPSDHDLVLIRLKKKGDRCATRSQFVQPICLPEPGSTFPAGHKCQIAGWGHLDENVSGYSSSLREALVPLVADHKCSSPEVYGADISPNMLCAGYFDCKSDACQGDSGGPLACEKNGVAYLYGIISWGDGCGRLHKPGVYTRVANYVDWINDRIR

Regional Packing

我们使用TaskFactory和TaskOperation来对CDR的loop进行pack。我们可以使用ResidueSelector选择CDR来使问题变得简单。总的来说,ResidueSelector返回pose长度的布尔值向量。每一个布尔值都表达了氨基酸是否被选择。因为pose中的向量的长度都是一样的,索引就是氨基酸的number。在Rosetta中有许多的ResidueSelector,包含了AND和OR去结合他们,他们中的大部分都来自:from rosetta.core.select import residue_selector as selections.

Make selection using the CDRResidueSelector and NeighborhoodResidueSelector

我们将使用NeighborhoodResidueSelector 来选择CDRloop以及他周围的邻居氨基酸,默认范围是6埃。我们每pack一次,TaskFactory都会被用来生成packing说明(PackerTask),然后我们packing的邻居氨基酸都会被更新来反映出pose改变的阶段。

nbr_selector = selections.NeighborhoodResidueSelector()
cdr_selector = CDRResidueSelector()
cdr_selector.set_cdr(h1)
nbr_selector.set_focus_selector(cdr_selector)
nbr_selector.set_include_focus_in_subset(True)

Restrict to our selection

我们要关闭除了H1loop和他周围氨基酸的氨基酸,通过使用TaskFactory,每完成一次packing,我们都生成邻居氨基酸残基。使用NeighborhoodResidueSelector ,我们使用pose energies object,他有邻居信息的列表。
为了这么做,我们需要创建一个叫Residue Level Task Operation, 或者叫RLT,然后将他传递给OperateOnResidueSubset。

prevent_repacking_rlt = operation.PreventRepackingRLT()
#True indicates here that we are flipping the selection.  So that we are turning off everything but the CDR and
#  its neighbors.

prevent_subset_repacking = operation.OperateOnResidueSubset(prevent_repacking_rlt, nbr_selector, True )

让我们检查一下选择了哪些残基作为CDR,然后是CDR及其邻居。我们将使用它来确保我们的PackerTask正确设置正确:

cdr_res = []
print("CDR")
for i in select.get_residue_set_from_subset(cdr_selector.apply(pose)):
    print(i)
    cdr_res.append(i)
    
print("\nCDR+Neighbors")
for i in select.get_residue_set_from_subset(nbr_selector.apply(pose)):
    if i in cdr_res:
        print(i,"CDR")
    else:
        print(i)
CDR
basic.io.database: {0} Database file opened: sampling/antibodies/cluster_center_dihedrals.txt
protocols.antibody.AntibodyNumberingParser: {0} Antibody numbering scheme definitions read successfully
protocols.antibody.AntibodyNumberingParser: {0} Antibody CDR definition read successfully
antibody.AntibodyInfo: {0} Successfully finished the CDR definition
antibody.AntibodyInfo: {0} AC Detecting Regular CDR H3 Stem Type
antibody.AntibodyInfo: {0} ARFWWRSFDYW
antibody.AntibodyInfo: {0} AC Finished Detecting Regular CDR H3 Stem Type: KINKED
antibody.AntibodyInfo: {0} AC Finished Detecting Regular CDR H3 Stem Type: Kink: 1 Extended: 0
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H1
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 13 Omega: TTTTTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H2
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 10 Omega: TTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H3
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 10 Omega: TTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L1
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 11 Omega: TTTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L2
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 8 Omega: TTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L3
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 9 Omega: TTTTTTCTT
134
135
136
137
138
139
140
141
142
143

CDR+Neighbors
basic.io.database: {0} Database file opened: sampling/antibodies/cluster_center_dihedrals.txt
protocols.antibody.AntibodyNumberingParser: {0} Antibody numbering scheme definitions read successfully
protocols.antibody.AntibodyNumberingParser: {0} Antibody CDR definition read successfully
antibody.AntibodyInfo: {0} Successfully finished the CDR definition
antibody.AntibodyInfo: {0} AC Detecting Regular CDR H3 Stem Type
antibody.AntibodyInfo: {0} ARFWWRSFDYW
antibody.AntibodyInfo: {0} AC Finished Detecting Regular CDR H3 Stem Type: KINKED
antibody.AntibodyInfo: {0} AC Finished Detecting Regular CDR H3 Stem Type: Kink: 1 Extended: 0
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H1
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 13 Omega: TTTTTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H2
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 10 Omega: TTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H3
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 10 Omega: TTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L1
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 11 Omega: TTTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L2
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 8 Omega: TTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L3
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 9 Omega: TTTTTTCTT
96
109
110
111
112
130
131
132
133
134 CDR
135 CDR
136 CDR
137 CDR
138 CDR
139 CDR
140 CDR
141 CDR
142 CDR
143 CDR
144
145
155
156
157
158
159
160
161
162
163
165
167
178
180
181
182
183
184
185
186
187
203
204
205
206
207
208
212
214
215
268
269
270
302
304
305
306
307
308
309

Reset the pose

pose = original_pose.clone()

tf.push_back(prevent_subset_repacking)

pack_cdrs_and_neighbors_tf = tf.clone()

packer.task_factory(tf)

我们可以查看一下PackerTask。

print(tf.create_task_and_apply_taskoperations(pose))

运行packer并保存产生的pdb:

#Skip for tests
if not os.getenv("DEBUG"):
    packer.apply(pose)
    
pose.dump_pdb("outputs/2r0l_cdr_repack.pdb")
core.pack.task: {0} Packer task: initialize from command line()
basic.io.database: {0} Database file opened: sampling/antibodies/cluster_center_dihedrals.txt
protocols.antibody.AntibodyNumberingParser: {0} Antibody numbering scheme definitions read successfully
protocols.antibody.AntibodyNumberingParser: {0} Antibody CDR definition read successfully
antibody.AntibodyInfo: {0} Successfully finished the CDR definition
antibody.AntibodyInfo: {0} AC Detecting Regular CDR H3 Stem Type
antibody.AntibodyInfo: {0} ARFWWRSFDYW
antibody.AntibodyInfo: {0} AC Finished Detecting Regular CDR H3 Stem Type: KINKED
antibody.AntibodyInfo: {0} AC Finished Detecting Regular CDR H3 Stem Type: Kink: 1 Extended: 0
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H1
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 13 Omega: TTTTTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H2
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 10 Omega: TTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for H3
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 10 Omega: TTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L1
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 11 Omega: TTTTTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L2
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 8 Omega: TTTTTTTT
antibody.AntibodyInfo: {0} Setting up CDR Cluster for L3
protocols.antibody.cluster.CDRClusterMatcher: {0} Length: 9 Omega: TTTTTTCTT
core.pack.pack_rotamers: {0} built 827 rotamers at 60 positions.
core.pack.pack_rotamers: {0} Requesting all available threads for interaction graph computation.
core.pack.interaction_graph.interaction_graph_factory: {0} Instantiating DensePDInteractionGraph
core.pack.rotamer_set.RotamerSets: {0} Completed interaction graph pre-calculation in 1 available threads (1 had been requested).
True

Design

我们以及准备好了我们需要的design的文件,接下来进行design。
因为我们在TaskFactory中已经加入了RestrictToRepacking TaskOperation ,我们需要重置它。

pose = original_pose.clone()

tf.clear()
tf.push_back(operation.InitializeFromCommandline())
tf.push_back(prevent_subset_repacking)

#Turn off design of neighbors
nbr_selector2 = selections.NeighborhoodResidueSelector()
nbr_selector2.set_focus_selector(cdr_selector)
nbr_selector2.set_include_focus_in_subset(False)

restrict_to_repack = operation.RestrictToRepackingRLT()
prevent_nbr_design = operation.OperateOnResidueSubset(restrict_to_repack, nbr_selector2, False )
tf.push_back(prevent_nbr_design)

让我们检查以确保我们创建了正确的操作。现在,我们可以看到我们选择的CDR被设置为设计到任何氨基酸中。

print(tf.create_task_and_apply_taskoperations(pose))

Set and Run

传递给packer一个新的tf并运行它。这将需要几分钟的时间,因为每个CDR我们都需要用到20个氨基酸而不仅仅是 native residue。

packer.task_factory(tf)

#Skip for tests
if not os.getenv("DEBUG"):
    packer.apply(pose)
    
pose.dump_pdb("outputs/2r0l_cdr_design.pdb")

Relax

我们对整个蛋白进行relax,这会花费一定的时间。

pose = original_pose.clone()
fr = FastRelax()

#Here, we have to set a scorefunction or we segfault.  
#  Error checking is important, and protocols should use a default scorefunction. We will manage.

fr.set_scorefxn(scorefxn)

#Lets run this.  This takes a very long time, so we are going decrease the amount of minimization cycles we use.
# This is generally only recommended for cartesian, but we just want everything to run fast at the moment.
fr.max_iter(100)

#Run the code

#Dump the pdb and take a look.
#Skip for tests
if not os.getenv("DEBUG"):
    fr.apply(pose)
    
pose.dump_pdb("outputs/2r0l_relaxed.pdb")

观察relax前后的能量值的变化。

print("relaxed ",scorefxn(pose))
print("original",scorefxn(original_pose))
delta = scorefxn(pose) - scorefxn(original_pose)
print("delta   ",delta)
relaxed  -1479.54882708
original -520.742210502
delta    -958.806616578

Regional Relax

但是我们真正需要的是优化蛋白质上我们关心的区域。这可能很棘手,所以我们从一些基础的操作来观察如何去做。
我们要使用MoveMapFactory,进一步使用ResidueSelectors。默认是所有的都关掉,所以我们要打开我们需要的。

pose = original_pose.clone()
mmf = MoveMapFactory()

#mm_enable and mm_disable are Enums (numbered variables) that come when we import the MMF
mmf.add_bb_action(mm_enable, cdr_selector)
#mmf.add_chi_action(mm_enable, cdr_selector) We are taking this out for speed.

mm  = mmf.create_movemap_from_pose(pose)
print(mm)
-------------------------------
  resnum     Type  TRUE/FALSE 
-------------------------------
 DEFAULT      BB     FALSE
 DEFAULT      SC     FALSE
 DEFAULT      NU     FALSE
 DEFAULT  BRANCH     FALSE
     134      BB      TRUE
     135      BB      TRUE
     136      BB      TRUE
     137      BB      TRUE
     138      BB      TRUE
     139      BB      TRUE
     140      BB      TRUE
     141      BB      TRUE
     142      BB      TRUE
     143      BB      TRUE
-------------------------------
 jumpnum     Type  TRUE/FALSE 
-------------------------------
 DEFAULT     JUMP    FALSE
-------------------------------
  resnum  atomnum     Type  TRUE/FALSE 
-------------------------------
 DEFAULT               PHI    FALSE
 DEFAULT             THETA    FALSE
 DEFAULT                 D    FALSE
 DEFAULT               RB1    FALSE
 DEFAULT               RB2    FALSE
 DEFAULT               RB3    FALSE
 DEFAULT               RB4    FALSE
 DEFAULT               RB5    FALSE
 DEFAULT               RB6    FALSE
-------------------------------

使用print我们发现只有一部分的氨基酸残基在里面。
我们不需要对所有的氨基酸进行操作,仅需要对我们选择的氨基酸以及他们相邻的氨基酸。我们将上面的CDRs的TaskFactory应用过来,让CDRs的主链发生改变。

fr.set_movemap_factory(mmf)
fr.set_task_factory(pack_cdrs_and_neighbors_tf)
#Skip for tests
if not os.getenv("DEBUG"):
    fr.apply(pose)
    
pose.dump_pdb("outputs/2r0l_h1_relaxed.pdb")

pose改变了很多我们不想让他改变的地方,这是由于FoldTree,有两种方法解决它,一是使用Loop foldtree,二是使用cartesian-space refinement。

Regional Relax - Cartesian

pose = original_pose.clone()
cart_sf = create_score_function("ref2015_cart")
mmf.set_cartesian(True)
fr.set_movemap_factory(mmf)
fr.set_scorefxn(cart_sf)
fr.cartesian(True)

#This is a general recommendation for cartesian minimization - it lowers the number of maximum cycles.
# More than this only increases time of protocol, but has little effect on energies/structure
fr.max_iter(200)

再次运行FastRelax

#Skip for tests
if not os.getenv("DEBUG"):
    fr.apply(pose)
    
pose.dump_pdb("outputs/2r0l_cart_rel_cdrs.pdb")

Regional Relax - Classic

现在我们使用经典的方法,在我们minimize之前,我们需要创建一个FoldTree并将其应用到我们pose上。我们要创建一个 AntibodyInfo object,这会使我们的操作变得简单。否则,我们需要知道我们感兴趣的CDR loop的起点和终点。
我们还将使用函数fold_tree_from_loops,这是loop建模框架的一部分。

 
pose = original_pose.clone()

ab_info = AntibodyInfo(pose)
ft = FoldTree()


start = ab_info.get_CDR_start(h1, pose)
stop =  ab_info.get_CDR_end(h1, pose)
cutpoint = int((stop-start)/2) + start
cdr_loop = Loop(start, stop, cutpoint)
cdr_loops = Loops()
cdr_loops.add_loop(cdr_loop)
                                
fold_tree_from_loops(pose, cdr_loops, ft)
pose.fold_tree(ft)
original_ft = pose.fold_tree()
add_cutpoint_variants(pose)

#Add chainbreak term so we don't get wacky stuff.  This term helps keep the peptide closed during bb movement.
scorefxn_ch = scorefxn
scorefxn_ch.set_weight(rosetta.core.scoring.chainbreak, 100)

#Setup our FastRelax again for dihedral-space.

mmf.set_cartesian(False)
fr.set_scorefxn(scorefxn_ch)
fr.cartesian(False)
fr.set_movemap_factory(mmf)
fr.max_iter(0) #Reset to default - if its 0, then we don't set it in the MinMover that FastRelax runs

#Run relax here

#Skip for tests
if not os.getenv("DEBUG"):
    fr.apply(pose)

#Reapply the original fold tree
pose.fold_tree(original_ft)

pose.dump_pdb('outputs/2r0l_dih_rel_H1.pdb')

参考

Jupyter Notebook Viewer

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

推荐阅读更多精彩内容