Biopython: How to avoid particular amino acid sequences from a protein so as to plot Ramachandran plot?

99封情书 提交于 2019-12-06 02:16:43

You can remove them after indexing the GLYs:

for poly_index, poly in enumerate(polypeptides):
    gly_index = [i for i, res in enumerate(poly) if res.get_resname() == "GLY"]

After the main loop and phy/psi calculation, delete the points from the array:

new_phi_psi = np.delete(phi_psi, gly_index, 0)
phi, psi = np.transpose(new_phi_psi)

Remove the step where you get rid of the NaNs. Now plot the points to get something like this:

h=ax.hexbin(phi, psi, extent=[-180,180,-180,180],cmap=plt.cm.Blues)
h=ax.hexbin(n_phi, n_psi, extent=[-180,180,-180,180],cmap=plt.cm.Reds)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!