compounds <- get_compounds(
identifier = c("aspirin", "ibuprofen", "rstudio"),
namespace = "name"
)
# Extract information for "aspirin"
aspirin <- instance(compounds, "aspirin")
# print(aspirin)
# Extract a specific slot from the "aspirin" compound.
retrieve(aspirin, "props", .to.data.frame = TRUE)
# Examples (PubChemInstanceList)
retrieve(compounds, "aspirin", "props", .to.data.frame = TRUE)
# Verbose Assay References to R Console
assays <- get_assays(identifier = c(1234, 7815), namespace = "aid")
instance(assays, "7815")
retrieve(assays, "7815", "xref", .verbose = TRUE)
# Print assay protocol to R console (if available)
# Note that it may be too long to print for some assays.
# retrieve(assays, "1234", "protocol", .verbose = TRUE)
# No protocol is available for assay "1234".
# retrieve(assays, "7815", "protocol", .verbose = TRUE)
# Ignores ".verbose" and ".which" if ".combine.all = TRUE".
retrieve(assays, .slot = "xref", .verbose = TRUE, .combine.all = TRUE)
### PUG VIEW EXAMPLES ###
pview <- get_pug_view(identifier = "2244", annotation = "data", domain = "compound")
# PugViewSectionList object.
# This object contains all the section information related to the PubChem request.
sect <- retrieve(pview, .slot = "Section")
print(sect)
retrieve(pview, .slot = "RecordType", .to.data.frame = TRUE)
Run the code above in your browser using DataLab