Skip to content

Commit

Permalink
Merge pull request #1 from MassBank/342
Browse files Browse the repository at this point in the history
skip executing CCTE examples
  • Loading branch information
Tobias Schulze authored Aug 28, 2023
2 parents e715196 + f2a7d77 commit 785b576
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 7 deletions.
14 changes: 11 additions & 3 deletions R/createMassBank.R
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,19 @@ gatherData <- function(id)
# Get the api key from the settings
api_key = getOption("RMassBank")$settings$ccte_api_key

dtxsid <- getDTXSID(key = inchikey_split, api_key = api_key)

if(is.null(dtxsid)){
if(!is.null(api_key)) {
dtxsid <- getDTXSID(key = inchikey_split, api_key = api_key)

if(is.null(dtxsid)){
dtxsid <- NA
}
}
else {
dtxsid <- NA
}




##Use CTS to retrieve information
CTSinfo <- getCtsRecord(inchikey_split)
Expand Down
12 changes: 10 additions & 2 deletions R/webAccess.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ getPcId <- function(query, from = "inchikey")
#' CCTE REST:
#' \url{https://api-ccte.epa.gov/docs}
#' @examples
#' \dontrun{
#' getDTXSID("MKXZASYAUGDDCJ-NJAFHUGGSA-N")
#'
#' }
#' @export
getDTXSID <- function(key, api_key)

Expand Down Expand Up @@ -208,8 +209,9 @@ getDTXSID <- function(key, api_key)
#' CCTE REST:
#' \url{https://api-ccte.epa.gov/docs}
#' @examples
#' \dontrun{
#' getDTXCID("MKXZASYAUGDDCJ-NJAFHUGGSA-N")
#'
#' }
#' @export
getDTXCID <- function(key, api_key)

Expand Down Expand Up @@ -258,7 +260,9 @@ getDTXCID <- function(key, api_key)
#' CCTE REST:
#' \url{https://api-ccte.epa.gov/docs}
#' @examples
#' \dontrun{
#' getPrefName("MKXZASYAUGDDCJ-NJAFHUGGSA-N")
#' }
#'
#' @export
getPrefName <- function(key, api_key)
Expand Down Expand Up @@ -310,7 +314,9 @@ getPrefName <- function(key, api_key)
#' CCTE REST:
#' \url{https://api-ccte.epa.gov/docs}
#' @examples
#' \dontrun{
#' getCASRN("MKXZASYAUGDDCJ-NJAFHUGGSA-N")
#' }
#'
#' @export
getCASRN <- function(key, api_key)
Expand Down Expand Up @@ -361,7 +367,9 @@ getCASRN <- function(key, api_key)
#' CCTE REST:
#' \url{https://api-ccte.epa.gov/docs}
#' @examples
#' \dontrun{
#' getDTXSMILES("MKXZASYAUGDDCJ-NJAFHUGGSA-N")
#' }
#'
#' @export
getDTXSMILES <- function(key, api_key)
Expand Down
2 changes: 2 additions & 0 deletions man/getCASRN.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/getDTXCID.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/getDTXSID.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/getDTXSMILES.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/getPrefName.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 785b576

Please sign in to comment.