Skip to content

Commit 4fd3eae

Browse files
committed
Resolve more comments
1 parent 6c4fb68 commit 4fd3eae

3 files changed

Lines changed: 21 additions & 13 deletions

File tree

R/chembl.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ chembl_files <- function(version = "latest") {
232232
#' - version: character; database version to use in "offline" mode (default
233233
#' "latest").
234234
#' @param verbose logical; should a verbose output be printed on the console?
235-
#' @param ... addition arguments, only used for internal testing.
235+
#' @param ... additional arguments, only used for internal testing.
236236
#' @return The function returns a list of lists, where each element of the list
237237
#' contains a list of respective query results. If `tidy = TRUE` results are
238238
#' simplified, if possible.
@@ -274,7 +274,7 @@ chembl_files <- function(version = "latest") {
274274
#' chembl_query(
275275
#' "CHEMBL266429",
276276
#' resource = "compound_structural_alert",
277-
#' options = list(tidy = FALSE)
277+
#' options = chembl_options(tidy = FALSE)
278278
#' )
279279
#'
280280
#' # Resource: compound_record - requires compound record ID
@@ -294,7 +294,7 @@ chembl_files <- function(version = "latest") {
294294
#' # By default, the function will use 70 as similarity threshold
295295
#' chembl_query(
296296
#' "CC(=O)Oc1ccccc1C(=O)O", resource = "similarity",
297-
#' options = list(similarity = 70)
297+
#' options = chembl_options(similarity = 70)
298298
#' )
299299
#'
300300
#' # Resource: substructure - requires compound SMILES

R/chembl_offline.R

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,12 @@ chembl_compare_service <- function(
864864
#' @return A list with the comparison status and any unique elements found in
865865
#' either input.
866866
#' @noRd
867+
#' @examples
868+
#' \dontrun{
869+
#' ws <- chembl_query("CHEMBL1082", resource = "molecule")
870+
#' off <- chembl_query("CHEMBL1082", resource = "molecule", mode = "offline")
871+
#' compare_service_lists(ws$CHEMBL1082, off$CHEMBL1082)
872+
#' }
867873
compare_service_lists <- function(ws, offline) {
868874
ws_na <- length(ws) == 1 && is.na(ws)
869875
offline_na <- length(offline) == 1 && is.na(offline)
@@ -904,8 +910,10 @@ compare_service_lists <- function(ws, offline) {
904910
if (is.atomic(ws_elem)) {
905911
if (!identical(ws_elem, off_elem)) {
906912
stop(sprintf(
907-
"Atomic element '%s' differs between webservice and offline.\n",
908-
"Webservice value: %s\nOffline value: %s",
913+
paste0(
914+
"Atomic element '%s' differs between webservice and offline.\n",
915+
"Webservice value: %s\nOffline value: %s"
916+
),
909917
n,
910918
paste0(utils::capture.output(print(ws_elem)), collapse = "\n"),
911919
paste0(utils::capture.output(print(off_elem)), collapse = "\n")
@@ -926,12 +934,12 @@ compare_service_lists <- function(ws, offline) {
926934
} else {
927935
stop(sprintf("Element '%s' should be either atomic or a data frame.", n))
928936
}
929-
return(list(
930-
status = "OK",
931-
ws_extra = ws_unique_element,
932-
offline_extra = offline_unique_element
933-
))
934937
}
938+
return(list(
939+
status = "OK",
940+
ws_extra = ws_unique_element,
941+
offline_extra = offline_unique_element
942+
))
935943
}
936944

937945
#' Compare Two Named Lists of Atomic Elements

man/chembl_query.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)