目标:我想比较计算相同残基的RMSD,例如131Thr,来自相同目标的2个pdb文件。使用pymol,我计算了一个5个残基的滑动窗口以进行局部比对,然后选择该残基并计算两个残基之间的均方根值,其灵感来自此处的帖子https://pymolwiki.org/index.php/RmsdByResidue。 唯一的区别是:我预先定义了一个5个残基的滑动窗口以进行局部比对。
代码段(Python / Pymol接口):
referenceProteinChain = cmd.fetch(pbdstructure1)
targetProteinChain = cmd.fetch(pdbstructure2)
sel = referenceProteinChain
list_atoms = [[133, 133]] # example list, I want to calculate the rmsd between residue 133 and residue 133 of two pdb structures
for j in list_atoms:
# I formulate my sliding window of 5 residues, my residue of interest is in the middle
ref_begin = int(j[0])-2
ref_end = int(j[0])+2
target_begin = int(j[1])-2
target_end = int(j[1])+2
# I create a selection for the reference protein and the target protein
cmd.create("ref_gzt", referenceProteinChain+" and polymer and not alt B and not Alt C and not alt D and resi %s-%s"
cmd.alter("ref_gzt", "chain='A'")
cmd.alter("ref_gzt", "segi=''")
cmd.create("target_gzt", targetProteinChain+" and polymer and not alt B and not Alt C and not alt D and resi %s-%s" %(target_begin,target_end) )
cmd.alter("target_gzt", "chain='A'")
cmd.alter("target_gzt", "segi=''")
# I align my selected 5 residues for a local alignment window
cmd.align("target_gzt","ref_gzt",object="align", cycles =5)
# select alpha carbon of in reference structure to loop over
calpha=cmd.get_model(sel+" and name CA and not alt B and not Alt C and not alt D and resi %s-%s" %(ref_begin,ref_end) )
## here I loop over all residues in the sliding window and calculte the rmsd for my residues of interest.
for g in calpha.atom : I loop over the slinding window
if g.resi == str(j[0]): ## we select only our residue of interest within the sliding window
if cmd.count_atoms("ref_gzt and polymer and resi "+g.resi)==cmd.count_atoms("target_gzt and polymer and resi "+g.resi):
## calculte the pairwise RMSD between the residues I specified in list_atoms
rmsdRes=cmd.rms_cur("ref_gzt and polymer and resi "+g.resi,"target_gzt and polymer and resi "+g.resi)
我的问题: 我选择的残基得到的原子数不同,因此无法计算我的RMSD
注意:我检查了原始pdb文件中的残基是否匹配。他们是这样。我如何选择残留物似乎是Pymol问题。
作为Pymol的新手-如果有人可以给我一个建议,将不胜感激!我检查了pymol邮件列表并尝试了其他功能,例如使用cmd.select,但没有任何进一步的内容。