-
Notifications
You must be signed in to change notification settings - Fork 5
/
get_example_molecule.R
23 lines (23 loc) · 991 Bytes
/
get_example_molecule.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#' Get Example Molecule
#'
#' Loads the structure of the built-in molecules. All SDF files obtained from Pubchem.
#' txt extension only included to pass R CHECK.
#'
#' @param molecule One of the built-in SDF files. These are "benzene", "buckyball",
#' "caffeine", "capsaicin", "cinnemaldehyde", "geraniol", "luciferin", "morphine",
#' "penicillin", "pfoa", "skatole", "tubocurarine_chloride".
#'
#' @return List giving the atom locations and the connections between atoms.
#' @export
#'
#' @examples
#' get_example_molecule("benzene")
#' get_example_molecule("cinnemaldehyde")
#' get_example_molecule("geraniol")
get_example_molecule = function(molecule) {
if(!molecule %in% c("benzene", "buckyball","caffeine", "capsaicin", "cinnemaldehyde", "geraniol", "luciferin", "morphine",
"penicillin", "pfoa", "skatole", "tubocurarine_chloride")) {
stop("molecule ", molecule, "not found")
}
system.file("extdata", sprintf("%s.txt",molecule), package="raymolecule")
}