Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
API scripts
Commits
8ae65b27
Commit
8ae65b27
authored
May 02, 2022
by
Marek Ostaszewski
Browse files
version updates, improved reaction query
parent
e274e22a
Changes
2
Hide whitespace changes
Inline
Side-by-side
R/API_find_drug_targets.R
View file @
8ae65b27
##################################################
##################################################
## Script purpose: An example of MINERVA API call to retrieve
## Script purpose: An example of MINERVA API call to retrieve
## HGNC symbols of elements target
t
ed by a given drug,
## HGNC symbols of elements targeted by a given drug,
## and to retrieve drugs target
t
ing elements with a given UniProt
## and to retrieve drugs targeting elements with a given UniProt
## Date: 17/03/2020
## Date: 17/03/2020
(updated 02.05.2022)
## Author: Marek Ostaszewski (marek.ostaszewski@uni.lu)
## Author: Marek Ostaszewski (marek.ostaszewski@uni.lu)
## MINERVA API version: 1
4
.0
## MINERVA API version: 1
5
.0
##################################################
##################################################
### A convenience function to handle GET and POST requests to MINERVA API
### A convenience function to handle GET and POST requests to MINERVA API
...
...
R/API_retrieve.R
View file @
8ae65b27
##################################################
##################################################
## Script purpose: An example of MINERVA API call to retrieve elements with a
## Script purpose: An example of MINERVA API call to retrieve elements with a
## given
u
ni
p
rot id and their interactions
## given
U
ni
P
rot id and their interactions
## Date: 17/03/2020
## Date: 17/03/2020
(updated 02.05.2022)
## Author: Marek Ostaszewski (marek.ostaszewski@uni.lu)
## Author: Marek Ostaszewski (marek.ostaszewski@uni.lu)
## MINERVA API version: 1
4
.0
## MINERVA API version: 1
5
.0
##################################################
##################################################
### A convenience function to handle GET and POST requests to MINERVA API
### A convenience function to handle GET and POST requests to MINERVA API
...
@@ -47,13 +47,14 @@ identifiers <- model_elements$id[hits]
...
@@ -47,13 +47,14 @@ identifiers <- model_elements$id[hits]
model_reactions
<-
fromJSON
(
ask_GET
(
base_url
,
model_reactions
<-
fromJSON
(
ask_GET
(
base_url
,
paste0
(
"models/*/bioEntities/reactions/?participantId="
,
paste0
(
"models/*/bioEntities/reactions/?participantId="
,
paste
(
identifiers
,
collapse
=
","
),
paste
(
identifiers
,
collapse
=
","
),
"&columns=
reactionI
d"
)))
"&columns=
i
d"
)))
### Create a validation URL for the disease map these identifiers come from
### Create a validation URL for the disease map these identifiers come from
visualize_reactions
<-
"https://pdmap.uni.lu/minerva/?search="
### "search.perfect=true" is needed if we use MINERVA internal identifiers
visualize_reactions
<-
"https://pdmap.uni.lu/minerva/?search.perfect=true&search="
### Get searchable reaction identifiers from the search results
### Get searchable reaction identifiers from the search results
searchable_identifiers
<-
paste
(
paste0
(
"reaction:"
,
model_reactions
$
reactionI
d
),
collapse
=
";"
)
searchable_identifiers
<-
paste
(
paste0
(
"reaction:"
,
model_reactions
$
i
d
),
collapse
=
";"
)
### Create the final link
### Create the final link
print
(
paste0
(
visualize_reactions
,
searchable_identifiers
))
print
(
paste0
(
visualize_reactions
,
searchable_identifiers
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment