pymol {bio3d} | R Documentation

## Biomolecular Visualization with PyMOL

### Description

Visualize Bio3D structure objects in PyMOL

### Usage

    pymol(...)

    ## S3 method for class 'pdbs'
    pymol(pdbs, col=NULL, as="ribbon", file=NULL, type="script",
                         exefile=NULL, ...)

    ## S3 method for class 'nma'
    pymol(...)

    ## S3 method for class 'pca'
    pymol(...)

    ## S3 method for class 'modes'
    pymol(modes, mode=NULL, file=NULL, scale=5, dual=FALSE,
                         type="script", exefile=NULL, ...)

    ## S3 method for class 'dccm'
    pymol(dccm, pdb, file=NULL,
                         step=0.2, omit=0.2, radius = 0.15,
                         type="script", exefile=NULL, ...)

### Arguments

`pdbs` | aligned C-alpha Cartesian coordinates as obtained with `read.fasta.pdb` or `pdbaln`.
`col` | a single element character vector specifying the coloring of the structures. Options are: ‘index’, ‘index2’, ‘gaps’, ‘rmsf’. Special cases: Provide a ‘core’ object as obtained by `core.find` to color on the invariant core. Alternatively, provide a vector containing the color code for each structure in the ‘pdbs’ object.
`as` | show as ‘ribbon’, ‘cartoon’, ‘lines’, ‘putty’.
`file` | a single element character vector specifying the file name of the PyMOL session/script file.
`type` | a single element character vector specifying the output type: ‘script’ generates a .pml script; ‘session’ generates a .pse session file; ‘launch’ launches pymol.
`exefile` | file path to the ‘PYMOL’ program on your system (i.e. how is ‘PYMOL’ invoked). If `NULL`, use OS-dependent default path to the program.
`modes` | an object of class `nma` or `pca` as obtained from functions `nma` or `pca.xyz`.
`mode` | the mode number for which the vector field should be made.
`scale` | global scaling factor.
`dual` | logical, if TRUE mode vectors are also drawn in both direction.
`dccm` | an object of class `dccm` as obtained from function `dccm`.
`pdb` | an object of class `pdb` as obtained from function `read.pdb` or a numerical vector of Cartesian coordinates.
`step` | binning interval of cross-correlation coefficents.
`omit` | correlation coefficents with values (0-omit, 0+omit) will be omitted from visualization.
`radius` | numeric, radius of visualized correlation cylinders in PyMol. Alternatively, a matrix with the same dimesions as `dccm` can be provided, e.g. to draw cylinders with radii associated to the pairwise correlation value.
`...` | arguments passed to function `pymol.modes` for ‘nma’ and ‘pca’ objects.

### Details

These functions provides a convenient approach for the visualization of Bio3D objects in PyMOL. See examples for more details.

DCCM PyMOL visualization: This function generates a PyMOL (python) script that will draw colored lines between (anti)correlated residues. The PyMOL script file is stored in the working directory with filename “R.py”. PyMOL will only be launched (and opened) when using argument ‘type='launch'’. Alternatively a PDB file with CONECT records will be generated (when argument `type='pdb'`).

For the PyMOL version, PyMOL CGO objects are generated - each object representing a range of correlation values (corresponding to the actual correlation values as found in the correlation matrix). E.g. the PyMOL object with name “cor_-1_-08” would display all pairs of correlations with values between -1 and -0.8.

NMA / PCA PyMOL vector field visualization: This function generates a PyMOL (python) script for drawing mode vectors on a PDB structure. The PyMOL script file is stored in the working directory with filename “R.py”.

### Value

Called for its action

### Author(s)

Lars Skjaerven

### References

Skjaerven, L. et al. (2014) BMC Bioinformatics 15, 399. Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.

### See Also

`view`

### Examples

    ## Not run:

    ##- pymol with a 'pdbs' object
    attach(transducin)

    # build a pymol session containing all structures in the PDBs object
    pymol(pdbs)

    # color by invariant core (
    # core <- core.find(pdbs)
    pymol(pdbs, col=core)

    # color by RMSF
    pymol(pdbs, col="rmsf")

    # color by clustering
    rd <- rmsd(pdbs$xyz)
    hc <- hclust(as.dist(rd))
    grps <- cutree(hc, k=3)
    pymol(pdbs, col=grps)

    ##- pymol with a 'dccm' object
    ## Fetch stucture
    pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )

    ## Calculate normal modes
    modes <- nma(pdb)

    ## Calculate correlation matrix
    cm <- dccm.nma(modes)

    pymol(cm, modes$xyz)

    ##- pymol with a 'nma' or 'pca' object
    pymol(modes, mode=7)

    detach(transducin)

    ## End(Not run)

[Package bio3d version 2.3-4 Index]