可以从 R 解析 PyMOL 脚本:
# Return a string of commands to draw
pymol.bond.sele.command = function(atom1, atom2, nbond, chainID){
# return PyMOL command to draw a bond between atoms 1 and 2
return(paste(paste('distance ', paste('mydist', nbond, ', ', sep=''),
'chain ', pymolchain, ' and ', atom1, '/CA, ', 'chain ', pymolchain, ' and ', atom2, '/CA', sep='')))
}
> pymol.bond.sele.command(43, 54, 1, A)
[1] distance mydist1, chain A and 43/CA, chain A and 54/CA
将输出复制pymol.bond.sele.command()
到 PyMOL 终端。
要删除距离标签:
pymol.bond.lab.rm.command = function(nbond, chainID){
# return PyMOL command to remove the distance label drawn for distance element x
return(paste('hide labels, mydist', nbond, sep=''))
}
> pymol.bond.lab.rm.command(1, A)
[1] hide labels, mydist1
将输出复制pymol.bond.lab.rm.command()
到 PyMOL 终端。