| addStructure | R Documentation |
Add a structure to the NGLVieweR object, either from a PDB entry code, a file, or directly from the R environment.
addStructure(NGLVieweR, data, format = NULL)
NGLVieweR |
A NGLVieweR object. |
data |
Structure data to be added, in the same forms as in
|
format |
Format of the structure, as in |
This function allows you to add a structure to the NGLVieweR widget.
You can add the structure using a PDB entry code, by specifying a local
file, or by providing the structure data directly. If the format is not
clear from the input, you may need to specify it using the format
parameter.
An updated NGLVieweR object with the added structure.
NGLVieweR("1CRN") %>%
addRepresentation("cartoon", param = list(color = "blue")) %>%
addStructure("1CRN") %>%
addRepresentation("cartoon", param = list(color = "orange")) %>%
setPosition(x = 20, y = 0, z = 0) %>%
setRotation(x = 2, y = 0, z = 0, degrees = FALSE) %>%
setScale(0.5)
# Note: The first "1CRN" structure is represented in blue, while the second
# "1CRN" structure is represented in orange. Transformations such as
# setPosition, setRotation, and setScale apply to the second
# (most recently added) structure.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.