代码改变世界

Pymol里常用到的命令,随用随记

2020-06-09 16:04  丨o聽乄雨o丨  阅读(2772)  评论(0编辑  收藏  举报

python脚本运行方式:

1, File->Run Script->选择python脚本;

2, run python脚本

常用命令:

load *.pdb

remove solvent

select str1, resn Cl-

remove str1

align WT_ligs, WT_box_wat_eq3 #后面的是target

alignto WT_ligs #把所有pdb都align到WT_ligs

show sticks, resi 87

set label_size, -1.4

set label_color, black, selection

select selection, resid 84+85+86+94+98+101+151+273+274+278+282+285+336+341+342+345+346+348+418+421+422+423+425+426+430

png image.png, 10cm, dpi=300, ray=1

png image.png, width=3000, height=2400, dpi=300, ray=1

 

高精度做图命令:

hide

hide labels, agi

show sticks, lig | res  #棒状显示lig和res对象,"|"为逻辑“或”

select 5A, byres ligand around 5 #选取ligand5A范围内残基

hide sticks, h.  #隐藏H原子

zoom lig | res  #居中放大lig和res,其他对象虚化

color wheat, lig & name C*  #将lig的碳原子(以C开头的原子名)设为小麦色

set label_size, 30

set label_font_id, 9

#########

import center_of_mass

select AGI1, resn AGI & name C2+C3+C4+C5+C6

com AGI1, object=p1

select AGI2, resn AGI & name C7+C8+C9+C10+C11

com AGI2, object=p2

hide everything, p*

show spheres, p*

set sphere_scale, 0.4

hide labels, measure*

set dash_length, 0.3

set dash_radius, 0.08

set dash_gap, 0.3

color green, measure01

color gray70, measure02

bg_color white

show cartoon

#########

color smudge, lig & name C*

set cartoon_transparency, 0.5

set cartoon_round_helices, 1

set cartoon_fancy_helices, 1

set cartoon_fancy_sheets, 1

set cartoon_color, green, FLS_TPP_DHA & chain A  #设置不同链的cartoon不同颜色

set stick_ball #显示棍棒模型

set stick_ball_ratio, 1.3

set stick_h_scale, 0.8

unset opaque_background   # 设置背景透明,只在ray下有用

#########

save focus.pse

png label.png

hide labels

png focus.png, 16.93cm, 16.93cm, dpi=300, ray=1

zoom

set cartoon_transparency, 0

png overview.png, 20cm, 18cm, dpi=300, ray=1

save overview.pse

高阶命令:

load candidate.pdb, c_run4

select run4_AGI, c_run4 & resn AGI

sel active, byres 1xru & chain A within 5 of resn AGI

select 736A2_active, byres CYP736A2 within 3 of CYP736A2 & resn UNK

show sticks, active_run4

show surface, active_run4

show surface, byres c_run4 within 5 of run4_AGI

显示双键:

# In editing mode: select the bond using Ctrl-right-click, then enter:
unbond pk1,pk2
bond pk1,pk2,4
# 1: single bond, 2: double bond, 3:triple bond, 4:delocalized,

...

额外记录一些颜色:

set_color high_lddt_c, [0,0.325490196078431,0.843137254901961 ]
set_color normal_lddt_c, [0.341176470588235,0.792156862745098,0.976470588235294]
set_color medium_lddt_c, [1,0.858823529411765,0.070588235294118]
set_color low_lddt_c, [1,0.494117647058824,0.270588235294118]

由白到红的10种渐变色:

set_color color1,  [255,255,255]

set_color color2,  [255,230,230]

set_color color3,  [255,204,204]

set_color color4,  [255,179,179]

set_color color5,  [255,153,153]

set_color color6,  [255,128,128]

set_color color7,  [255,102,102]

set_color color8,  [255,77,77]

set_color color9,  [255,51,51]

set_color color10,  [255,0,0]