get_molecule | R Documentation |
Loads the structure of a molecule by fetching an SDF file from Pubchem, which can be piped to generate_full_scene
get_molecule(molecule)
molecule |
A character variable of a compound name or a numeric variable of an official compound ID |
List giving the atom locations and the connections between atoms.
if(run_documentation()) {
get_molecule("caffeine") %>%
generate_full_scene() %>%
render_model()
}
if(run_documentation()) {
#estradiol (aka estrogen)
get_molecule(5757) %>%
generate_full_scene() %>%
render_model()
}
if(run_documentation()) {
get_molecule("testosterone") %>%
generate_full_scene() %>%
render_model()
}
if(run_documentation()) {
get_molecule("aspirin") %>%
generate_full_scene() %>%
render_model()
}
if(run_documentation()) {
get_molecule("rutoside") %>%
generate_full_scene() %>%
render_model()
}
if(run_documentation()) {
#If the 3D SDF doesn't exist, this function will pull the 2D SDF and inform the user
get_molecule("cyanocobalamin") %>%
generate_full_scene() %>%
render_model()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.