Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studies Rest API Endpoint to Get All Studies #54

Open
sprintell opened this issue Aug 21, 2024 · 2 comments
Open

Studies Rest API Endpoint to Get All Studies #54

sprintell opened this issue Aug 21, 2024 · 2 comments

Comments

@sprintell
Copy link
Member

sprintell commented Aug 21, 2024

As developer I want an API endpoint such that when I send a GET request to the URL, hateoas compliant, paginated list of all studies in the database is returned in JSON Format.

This will be a replacement to the old endpoint https://www.ebi.ac.uk/gwas/rest/api/studies

{
  "initialSampleSize": "...",  
  "replicationSampleSize": "2,698 European ancestry Bipolar disorder cases, 1,649 …",
  "gxe": false,
  "gxg": false,
  "snpCount": 1922309,
  "qualifier": null,
  "imputed": true,
  "pooled": false,
  "studyDesignComment": null,
  "accessionId": "GCST000854",
  "fullPvalueSet": false,
  "userRequested": false,
  "pubmedId": "20971583",
  "platforms": [{}],
  "diseaseTrait": "Suicide risk",
  "genotypingTechnologies": [{}],
  "efo_uri": "EFO_0004229",
  "efoTrait": "Dupuytren Contracture",
  "_links": {
	"self": {
  	"href": "{base_url}/v1/studies/GCST000841"
	},
	"ancestries": {
  	"href": "{base_url}/v1/studies/GCST000841/ancestries"
	},
	"search": {
  	"href": "{base_url}/v1/studies?pubmed_id"
	}
  }
}

Must Have Additional Payload Attributes - These are displayed on the catalog UI:

  • discovery_ancestry (country of recruitment): "4390 European (U.K.)"
  • Traits: ["mental or behavioural disorder", "attempted suicide"]
  • Platform [SNPs passing QC]: "Affymetrix [1922309] (imputed)"
  • Replication ancestry (country of recruitment): "1649 NR (NR), 2698 European (Germany)"
  • Full Summary Statistics: "NA"
  • Terms/Licence: "https://www.ebi.ac.uk/about/terms-of-use/"
  • backgroundEfoTraits: ["",""]

Management Rules

  • Rule 1: Endpoint - /v1/studies
  • Rule 2: HTTP Request Method - GET
  • Rule 3: Endpoint should accept search page and sort parameters as in /v1/studies?page=0&size=20&sort=…
  • Rule 4: Endpoint should be accessible to all
  • Rule 5: HATEOAS, sorting, pagination, and some search and filter specification
  • Rule 6: Endpoints should be cached based on request parameters to amplify query speed

API Endpoint Search Parameters
This search parameter will automatically eliminate the need for 10 redundant endpoints as it was in the old design, listed below. Therefore the /v1/studies endpoint should accept search filter parameters as in /v1/studies?{search_parameter}=

Search Parameters:

  • pubmed_id
  • disease_trait
  • fullPvalueSet
  • userRequested
  • efo-uri
  • efoTrait
  • accessionId
  • fullPvalueSet

Few additional details here

@sajo-ebi sajo-ebi self-assigned this Sep 4, 2024
@sajo-ebi
Copy link
Contributor

sajo-ebi commented Sep 4, 2024

@sprintell need some clarity on the new fields in API

@sprintell sprintell changed the title Studies Rest API Endpoint Studies Rest API Endpoint to Get All Studies Sep 19, 2024
@sprintell
Copy link
Member Author

sprintell commented Oct 2, 2024

@sajo-ebi and @sprintell should investigate in addition of how to enhance this rest end point to handle child trait data ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants