Skip to contents

This function takes a vector of chemical identifiers as input, resolves them using chemi_resolver_lookup, and then uses an external API to predict their properties. It sends a POST request to the API endpoint, passing the resolved chemical names in the request body.

Usage

chemi_predict(query, report = "JSON")

Arguments

query

A character vector of chemical identifiers to predict properties for.

report

A character string specifying the report format. Must be one of "UNKNOWN", "SDF", "SMI", "MOL", "CSV", "TSV", "JSON", "XLSX", "PDF", "HTML", "XML", or "DOCX". Defaults to "JSON".

Value

A list containing the API response. Returns NULL if the API returns no results for a given query.

Examples

if (FALSE) { # \dontrun{
# Example usage with a single identifier:
predicted_properties <- chemi_predict(c("aspirin"))
print(predicted_properties)

# Example usage with multiple identifiers:
predicted_properties <- chemi_predict(c("aspirin", "ibuprofen", "water"))
print(predicted_properties)
} # }