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

Associations Rest API Endpoint to Get All Associations #56

Open
sprintell opened this issue Sep 19, 2024 · 1 comment
Open

Associations Rest API Endpoint to Get All Associations #56

sprintell opened this issue Sep 19, 2024 · 1 comment

Comments

@sprintell
Copy link
Member

sprintell commented Sep 19, 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 associations 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/associations

{
   "associationId":14347,
   "riskFrequency":"NR",
   "pvalueDescription":"(progression)",
   "pvalueMantissa":7,
   "pvalueExponent":-8,
   "multiSnpHaplotype":false,
   "snpInteraction":false,
   "snpType":"novel",
   "standardError":null,
   "range":null,
   "description":null,
   "orPerCopyNum":null,
   "betaNum":null,
   "betaUnit":null,
   "betaDirection":null,
   "lastMappingDate":"2023-09-15T12:31:10.000+0000",
   "lastUpdateDate":"2023-09-15T12:31:10.000+0000",
   “efoTrait”: "Dupuytren Contracture",
   "pValue":7e-8,
   "_links":{
  	"self":{
     	"href":"{base_url}/v1/associations/14347"
  	},
  	"locus":{
     	"href":"{base_url}/v1/associations/14347/loci"
  	},
  	"search":{
     	"href":"{base_url}/v1/associations?fullPvalueSet"
  	}
   }
}

Must Have Additional Payload Attributes

  • riskAlleleName
  • raf
  • ci
  • ReportedTrait
  • eFoTrait
  • studyAccessionId
  • "associationId": 14347: associationId was specified across board in the old API for association data retrieval, but never displayed to the user, hence there is no way a user would have known the id to use those features, hence it should be displayed if it must be used as key for association data retrieval

Management Rules

  • Rule 1: Endpoint - /v1/associations
  • Rule 2: HTTP Request Method - GET
  • Rule 3: Endpoint should accept search page and sort parameters as in /v1/associations?page=0&size=20&sort=name,desc
  • 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
A robust search feature be made available as before, but designed in line with REST standards, this will automatically eliminate the need for 10 redundant endpoints as it was in the existing design, listed below. Therefore the /v1/associations endpoint should accept search filter parameters as in /v1/associations?{search_parameter}=

Search Parameters:

  • pubmed_id
  • rsId
  • fullPvalueSet
  • accessionId
  • efoTrait
  • accessionId

Additional details here

@sajo-ebi
Copy link
Contributor

Local code changes completed

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