Ramachandran绘图工具
RamachanDraw的Python项目详细描述
Ramachandran绘图工具
根据输入的PDB文件绘制Ramachandran图(例如1MBN.pdb公司). 利用高斯KDE(核密度估计)来绘制有利扭转角(φ和ψ)的密度。在
安装
RamachanDraw托管在PyPi。在
pip install RamachanDraw
使用
RamachanDraw包含一些有用的函数,可以轻松地绘制Ramachandran图。在
从eHB在线获取文件>
要绘制拉玛钱德兰图,我们需要一个PDB文件。可以通过指定路径来使用本地PDB文件。另外,RamachanDraw还可以方便地包含一个函数,用于自动获取和本地存储给定PDB id的PDB文件
参数
^{pr2}$pdb_file (str)
:与要下载的PDB条目相对应的PDB id。在Returns
:PDB文件的路径。在
提取φ和ψ角
RamachanDraw利用Biopython模块从PDB文件中提取φ和ψ角。
此外,未绘制在图上的氨基酸残基可以使用return_ignored
参数提取。在
参数
phi_psi(pdb_file, return_ignored)
pdb_file (str)
:与要下载的PDB条目相对应的PDB id。在return_ignored (bool)
:True
返回一个元组列表,格式为(氨基酸,(phi,psi))
Returns
:字典,键为氨基酸残基,值为(phi,psi)角值。在
Ramachandran地块
利用matplotlib模块绘制一个高度可定制的Ramachandran图。在
参数
plot(pdb_file, cmap='viridis', alpha=0.75, dpi=100, save=True, show=False, out='plot.png')
pdb_file (str)
:与要下载的PDB条目相对应的PDB id。在cmap (str)
:colormap(来自matplotlib)用于偏好(“允许”)区域的密度;默认值为viridis。在alpha (float)
:设置颜色贴图的不透明度(值介于0-1之间);默认值为0.75。在dpi (int)
:分辨率(dots/inch);默认值为100。在save (bool)
:True
:在本地保存绘图;默认值为True。在
show (bool)
:True
:显示使用Qt5Agg后端的绘图;默认值为False。在
out (str)
:保存绘图时使用的文件名(即save=True
);默认值为绘图.png。在Returns
:Ramachandran绘图(可以本地保存)。在
示例
在此,您将从PDB id中找到一个与蛋白质数据库中的肌红蛋白条目1MBN-相对应的示例。在
from RamachanDraw import fetch, phi_psi, plot
# PDB id to be downloaded
PDB_id = '1MBN'
# Drawing the Ramachandran plot
plot(fetch(PDB_id))
# Generating a dictionary to store the phi and psi angles
# And returning the ignored aminoacid residues
phi_psi_dict, ignored_res = phi_psi(fetch(PDB_id), return_ignored=True)
贡献
欢迎反馈和建设性的批评:a.dias.cirilo@umail.leidenuniv.nl。在
许可证
- 项目
标签: