Skip to content

Commit

Permalink
fix(build): Remove onload function and setting env variables (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonywu1999 authored Jan 24, 2025
1 parent 834bf19 commit 6d988b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
14 changes: 8 additions & 6 deletions R/utils_annotateProteinInfoFromIndra.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
INDRA_API_URL = "https://discovery.indra.bio"

#' Call API to get UniProt IDs from UniProt mnemonic IDs
#' @param uniprotMnemonicIds list of UniProt mnemonic ids
#' @return list of UniProt IDs
Expand Down Expand Up @@ -33,7 +35,7 @@
stop("An error occurred converting uniprot mnemonic IDs to character strings: ", e$message)
})

apiUrl <- file.path(Sys.getenv("INDRA_API_URL"), "api/get_uniprot_ids_from_uniprot_mnemonic_ids")
apiUrl <- file.path(INDRA_API_URL, "api/get_uniprot_ids_from_uniprot_mnemonic_ids")

requestBody <- list(uniprot_mnemonic_ids = uniprotMnemonicIds)
requestBody <- jsonlite::toJSON(requestBody, auto_unbox = TRUE)
Expand Down Expand Up @@ -73,7 +75,7 @@
stop("Input list must not be empty.")
}

apiUrl <- file.path(Sys.getenv("INDRA_API_URL"), "api/get_hgnc_ids_from_uniprot_ids")
apiUrl <- file.path(INDRA_API_URL, "api/get_hgnc_ids_from_uniprot_ids")

requestBody <- list(uniprot_ids = uniprotIds)
requestBody <- jsonlite::toJSON(requestBody, auto_unbox = TRUE)
Expand Down Expand Up @@ -113,7 +115,7 @@
stop("Input list must not be empty.")
}

apiUrl <- file.path(Sys.getenv("INDRA_API_URL"), "api/get_hgnc_names_from_hgnc_ids")
apiUrl <- file.path(INDRA_API_URL, "api/get_hgnc_names_from_hgnc_ids")

requestBody <- list(hgnc_ids = hgncIds)
requestBody <- jsonlite::toJSON(requestBody, auto_unbox = TRUE)
Expand Down Expand Up @@ -153,7 +155,7 @@
stop("Input list must not be empty.")
}

apiUrl <- file.path(Sys.getenv("INDRA_API_URL"), "api/is_kinase")
apiUrl <- file.path(INDRA_API_URL, "api/is_kinase")

requestBody <- list(genes = genes)
requestBody <- jsonlite::toJSON(requestBody, auto_unbox = TRUE)
Expand Down Expand Up @@ -193,7 +195,7 @@
stop("Input list must not be empty.")
}

apiUrl <- file.path(Sys.getenv("INDRA_API_URL"), "api/is_phosphatase")
apiUrl <- file.path(INDRA_API_URL, "api/is_phosphatase")

requestBody <- list(genes = genes)
requestBody <- jsonlite::toJSON(requestBody, auto_unbox = TRUE)
Expand Down Expand Up @@ -233,7 +235,7 @@
stop("Input list must not be empty.")
}

apiUrl <- file.path(Sys.getenv("INDRA_API_URL"), "api/is_transcription_factor")
apiUrl <- file.path(INDRA_API_URL, "api/is_transcription_factor")

requestBody <- list(genes = genes)
requestBody <- jsonlite::toJSON(requestBody, auto_unbox = TRUE)
Expand Down
7 changes: 0 additions & 7 deletions R/utils_onLoad.R

This file was deleted.

0 comments on commit 6d988b6

Please sign in to comment.