Pymol指令大全。官方社区——海量Pymol作图的代码

Gallery - PyMOLWikihttps://pymolwiki.org/index.php/Gallery美观的PyMOL生成的图像及其脚本。(需要科学上网)

这个官方社区网站聚集了大量大佬以及他们的pymol脚本。使用pymol的脚本作图会更方便!

# example script for creation of an image with a slice region
load $PYMOL_PATH/test/dat/1tii.pdb
orient

# must disable depth cue and shadows
unset depth_cue
unset ray_shadows
set ray_trace_mode, 0

# this controls the z depth of the slice plane
# (sets it halfway between the clipping planes)
fraction = 0.42
view = cmd.get_view()
near_dist = fraction*(view[16]-view[15])
far_dist = (view[16]-view[15]) - near_dist
cmd.clip("near", -near_dist)

# render opaque background image
as surface
set ray_interior_color, grey80
set opaque_background
set surface_color, white
ray
save image_back.png

cmd.clip("near", near_dist)
cmd.clip("far", far_dist)

# render the foreground image
as cartoon
util.cbc
unset opaque_background
ray
save image_front.png

# now use Photoshop, Gimp, or ImageMagick to combine the images
system composite image_front.png image_back.png image_merged.png
system display image_merged.png

 


 

 

pymol展现对接口袋:

load $TUT/1hpv.pdb, tmp
extract lig, organic
extract prot, polymer
delete tmp

set surface_carve_cutoff, 4.5
set surface_carve_selection, lig
set surface_carve_normal_cutoff, -0.1

show surface, prot within 8 of lig
set two_sided_lighting
set transparency, 0.5
show sticks, lig
orient lig

set surface_color, white
set surface_type, 2  # mesh
unset ray_shadows

赶紧去玩玩。


pymol 选择对接的分子5A 范围内的氨基酸残基

图形界面选中配体,action - modify - around 5A residues

9pc是4dxd这个蛋白质晶体中的配体,以9pc为中心,在4dxd这个蛋白质里找出跟9pc距离在5 A的氨基酸,生成一个pocket,:

>>> create pocket, byres 4dxd within 5 of resn 9pc

或者下面的命令

>>> select 5Alig, byres lig around 5
>>> show sticks, 5Alig

选择残基100.102,108-111
    select res, resi 100+102+108-111

阴影关掉
set ray_shadow, off

ray 渲染,然后保存图片(分辨率为300dpi) 及pse格式


出版社要求全版图片宽度≤2000像素,半版图片宽度≤1000像素,分辨率≥300 dpi
save pocket.pse
png h_bond.png, width=20cm, height=20cm, dpi=600

参考链接:

https://blog.csdn.net/xiaolan39/article/details/111066591

  • 2
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
数学建模作图大全代码说明 1. 绘制函数图像 代码: ```python import numpy as np import matplotlib.pyplot as plt # 定义函数 def f(x): return np.sin(x) # 生成数据 x = np.linspace(-np.pi, np.pi, 300) y = f(x) # 绘制函数图像 plt.plot(x, y) # 添加标题和标签 plt.title('Function Plot') plt.xlabel('x') plt.ylabel('y') # 显示图像 plt.show() ``` 2. 绘制散点图 代码: ```python import numpy as np import matplotlib.pyplot as plt # 生成数据 x = np.random.rand(100) y = np.random.rand(100) # 绘制散点图 plt.scatter(x, y) # 添加标题和标签 plt.title('Scatter Plot') plt.xlabel('x') plt.ylabel('y') # 显示图像 plt.show() ``` 3. 绘制折线图 代码: ```python import numpy as np import matplotlib.pyplot as plt # 生成数据 x = np.linspace(0, 10, 100) y = np.sin(x) # 绘制折线图 plt.plot(x, y) # 添加标题和标签 plt.title('Line Plot') plt.xlabel('x') plt.ylabel('y') # 显示图像 plt.show() ``` 4. 绘制直方图 代码: ```python import numpy as np import matplotlib.pyplot as plt # 生成数据 x = np.random.randn(10000) # 绘制直方图 plt.hist(x, bins=50, density=True) # 添加标题和标签 plt.title('Histogram') plt.xlabel('x') plt.ylabel('y') # 显示图像 plt.show() ``` 5. 绘制等高线图 代码: ```python import numpy as np import matplotlib.pyplot as plt # 定义函数 def f(x, y): return np.sin(x) + np.cos(y) # 生成数据 x = np.linspace(0, 2*np.pi, 100) y = np.linspace(0, 2*np.pi, 100) X, Y = np.meshgrid(x, y) Z = f(X, Y) # 绘制等高线图 plt.contour(X, Y, Z) # 添加标题和标签 plt.title('Contour Plot') plt.xlabel('x') plt.ylabel('y') # 显示图像 plt.show() ``` 以上是常见的数学建模作图方法,你可以根据不同的需求进行代码修改和优化,实现更加丰富多样的图形。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值