Skip to content

Commit

Permalink
Merge pull request #51 from bhklab/development
Browse files Browse the repository at this point in the history
small fixes
  • Loading branch information
jjjermiah authored Apr 18, 2024
2 parents 6f1e402 + f6960f5 commit 27cbafe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: AnnotationGx
Title: AnnotationGx: A package for building, updating and querying an
annotation database for pharmaco-genomic data
Version: 0.0.0.9096
Version: 0.0.0.9097
Authors@R: c(
person("Jermiah", "Joseph", role = c("aut", "cre"),
email = "[email protected]"),
Expand Down
8 changes: 6 additions & 2 deletions R/chembl.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,13 @@ queryChemblAPI <- function(resource, field, filter_type, value, format = "json")
getChemblMechanism <- function(
chembl.ID, resources = "mechanism", field = "molecule_chembl_id", filter_type = "in",
returnURL = FALSE, raw = FALSE) {

funContext <- .funContext("getChemblMechanism")
# constructChemblQuery(resource = "mechanism", field = "molecule_chembl_id", filter_type = "in", value = "CHEMBL1413")
# urls <- constructChemblQuery(resource = resources, field = field, filter_type = filter_type, value = chembl.ID)
# urls <- URLencode(urls)

.info(funContext, "Retrieving ChEMBL Mechanism information for ", length(chembl.ID), " ChEMBL IDs.")
response_dts <- lapply(chembl.ID, function(chembl.ID) {
request <- .build_chembl_request(resource = resources, field = field, filter_type = filter_type, value = chembl.ID)

Expand Down Expand Up @@ -165,8 +169,8 @@ getChemblMechanism <- function(
}
x
})

data.table::rbindlist(response_dts)
data.table::rbindlist(response_dts, fill = TRUE)
}


Expand Down
7 changes: 6 additions & 1 deletion R/unichem.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ queryUnichemCompound <- function(
if(raw) return(response)

if(response$response != "Success"){
.err("Unichem API request failed.")
msg <- paste(
"Unichem API request failed for compound", compound, "
with type", type,
" . Error:", response$error
)
.err(.funContext("AnnotationGx::queryUnichemCompound"), msg)
}

# Mapping names to be consistent with other API calls
Expand Down

0 comments on commit 27cbafe

Please sign in to comment.