Comments (3)
Thanks for the bump, will try to get this done
from crul.
I think this would only work for async when we can construct URLs ahead of time because the whole point of async requests is to send off a bunch of requests at the same time. Thus, it can't work if you have to do request A to get the information to do request B. Should work if e..g, you know you want 1000 results, and you know the pagination query param names
from crul.
Yeah it looks like it would need to be a two-step process then since we don't know the range of values to give for page=<n>
where n is unknown:
Alerts Information Uniprot - Get target alerts by uniprotid
https://api.targetsafety.info/api/target/alerts/param?
Parameter
Field | Type | Description |
---|---|---|
uniprotid | String | [required] Uniprot ID |
page | Number | [required] Page number |
token | String | [required] Token |
adverse_event_idoptional | Number | [optional] Adverse Event ID |
ref_source_typeoptional | String | [optional] Reference source type |
alert_typeoptional | String | [optional] Alert Type |
alert_phaseoptional | String | [optional] Alert Phase |
alert_level_evidenceoptional | String | [optional] Level of evidence |
alert_onoff_targetoptional | String | [optional] On/Off target |
alert_severityoptional | String | [optional] Alert Severity |
alert_speciesoptional | String | [optional] Alert Species |
alert_date_fromoptional | String | [optional] Date from |
alert_date_tooptional | String | [optional] Date to |
order_by_dateoptional | String | [optional] Order by dateOnly one ordering is possible |
order_by_advoptional | String | [optional] Order by adverse eventOnly one ordering is possible |
Success 200
Field | Type | Description |
---|---|---|
page | Number | Page |
numberPages | Number | Number pages |
target_id | Number | Target ID |
target_name | String | Target name |
action_id | Number | Action ID |
action_name | String | Action name |
alerts | Object[] | Alerts |
affected_system_id | Number | Affected system ID |
affected_system | String | Affected system |
adverse_event_id | Number | Adverse event ID |
adverse_event | String | Adverse event |
ref_id | Number | Reference ID |
ref_source_type | String | Reference source type |
ref_title | String | Reference title |
ref_citation | String | Reference citation |
ref_pubmed_id | Number | PubMed ID |
ref_link | String | Reference link |
ref_date | String | Reference date |
alert_detail_id | Number | Alert detail ID |
alert_title | String | Alert title |
alert_date | String | Alert date |
alert_genetic_study_variant | String | Alert genetic study variant |
alert_type | String | Alert type |
alert_phase | String | Alert phase |
alert_onoff_target | String | On/Off target |
alert_level_evidence | String | Level of evidence |
alert_severity | String | Alert severity |
alert_species | String | Alert species |
drugs | Object | Drugs related |
drug_id | Number | Drug ID |
drug_name | String | Drug name |
{
"page": 1,
"numberPages": 11,
"targets": [
{
"target_id": 158,
"target_name": "SGLT2",
"actions": [
{
"action_id": 2,
"action_name": "Activators",
"alerts": [
{
"affected_system_id": 10015919,
"affected_system": "eye disorders",
"adverse_event_id": 10015916,
"adverse_event": "eye disorder",
"ref_id": 62872,
"ref_source_type": "Journal",
"ref_title": "Leveraging Human Genetics to Identify Safety Signals Prior to Drug Marketing Approval and Clinical Use",
"ref_citation": "Drug Saf 2020 Feb 28",
"ref_pubmed_id": "32112228",
"ref_link": null,
"ref_date": "2020-02-28",
"alert_detail_id": 662867,
"alert_title": "Phenome-wide association study identifying human gene mutations that could be used for in silico prediction of potential adverse drug effects. Results revealed 8 positive associations correlating gene mutation phenotypes with known safety signals from drugs targeting the protein. These associations were PCSK9 (spina bifida), TNF-alpha (cellulitis and leg abscess), PPARgamma (obesity), estrogen receptor-alpha (hemorrhages), ACE (congenital urinary anomalies), phospholipase A2 (primary hypercoagulable state), GluN2B (symbolic dysfunction) and GluN2A (paroxysmal tachycardia, pulmonary heart disease and sleep disorders). Other safety issues are listed.",
"alert_date": "2020-03-11",
"alert_genetic_study_variant": "gain-of-function mutation",
"alert_type": "Class Alert",
"alert_phase": "Target Discovery",
"alert_onoff_target": "On-Target",
"alert_level_evidence": "Suspected",
"alert_severity": "no",
"alert_species": "human",
"drugs": []
}
]
}
]
}
]
}
Only upon a successful API call (Success 200) would we get n from numberPages
.
So with a bit more effort we could grep numberPages
from each successful API call and then construct these URLs ahead of time.
Closing this issue since I asked them to provide us with a bulk data download instead... 💁🏼
from crul.
Related Issues (20)
- funky times headers should warn instead of error HOT 6
- Add HttpClient tests for new number formatting
- Update docs telling users about number formatting for query params
- POSTing GraphQL Mutations? HOT 4
- How do you avoid exceeding the rate limit when making API calls? HOT 11
- S3 method for async ``$responses` method
- consider making `AsyncQueue` non-blocking
- How to retry requests for AsyncQueue? HOT 4
- How to parse .xlsx content from crul response? HOT 4
- `Error in nchar(hh) : invalid multibyte string` when response has Latin1 headers HOT 1
- Async$get fails with non default disc param HOT 3
- server certificate verification failed. CAfile: none CRLfile: none HOT 2
- Integrate progress bars for Async requests HOT 3
- Number of parallel requests with AsyncVaried HOT 9
- use cookies from browser HOT 1
- tweak tests/egs to make cran happy HOT 1
- rgbif users reporting that "HTTP/2 stream was not closed cleanly before end of the underlying stream" HOT 4
- Fix errors in cran checks
- Add _PACKAGE thingy for pkg level doc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crul.