Pymol渲染(Ray)笔记
2018-02-26 本文已影响22人
生信杂谈
Ray
ray将会创建一个现在的框架图像的渲染(ray-traced)图像。我们平常使用pymol的时候可能就是直接ray一下出图,其实ray有许多功能可以挖掘,这里简单介绍一小部分。
使用
ray [width,height [,renderer [,angle [,shift ]]]
angle和shift将会生成立体的配对
width和height为设置ray的长宽,可以超出现在的框架
例子
默认图像

简单渲染
#全部使用默认设置
ray

PyMol API
cmd.ray(int width,int height,int renderer=-1,float shift=0)
设置
渲染模式
设置Ray_trace_mode设置可以修改最终成图的时候的PyMOL的内部渲染蛋白的模式.
下面可以查看不同模式的效果
# 普通颜色
set ray_trace_mode, 0
# 普通颜色+黑色线
set ray_trace_mode, 1
# 仅包含黑色线
set ray_trace_mode, 2
# 倍色+黑色线
set ray_trace_mode, 3
# 建议设置
set antialias, 2
# 更改线的颜色
set ray_trace_color, magenta
效果如下
ray_trace_mode, 1

ray_trace_mode, 2

ray_trace_mode, 3

ray_trace_color, magenta

透视
在0.98版本以后,渲染速度得到了提升,选择的开关如下:
set orthoscopic, off
set orthoscopic, on
放大近景如下:
set field_of_view, X
当50<X<70,默认为20.50-70 拥有非常强的透视效果。透视的轴为Y轴,而不是X轴
orthoscopic, off

orthoscopic, on

set field_of_view, 70

不知道为何我做出来没有效果,可以看官方的图例
[图片上传中...(3fbi-10.png-aae662-1519623768708-0)]
渲染
renderer = -1
为默认渲染
renderer = 0
为PyMOL内部渲染器
renderer = 1
使用PovRay渲染器, Unix-only
例子如下
# ray trace with an external renderer.
ray renderer=0
比较了一下-1和0模式的效果差别不大。