2

使用 R 包bio3d,我想绘制蛋白质上两个原子之间的键,并使用pymol().

library(bio3d)

# Import PDB file
pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )

# Atom 1
sele.1 <- atom.select(pdb, "calpha", resno=43, verbose=TRUE)

# Atom 2
sele.2 <- atom.select(pdb, "calpha", resno=54, verbose=TRUE)

在这个例子中,我想在原子之间画一条键/切线/线sele.1-sele.2一个相当微不足道的问题,这可能吗?

4

1 回答 1

1

可以从 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 终端。

于 2017-12-05T11:18:43.160 回答