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

Single Nucleotide Polymorphism (SNP) Rest API Endpoint to Get All SNP Data #58

Open
sprintell opened this issue Sep 19, 2024 · 0 comments

Comments

@sprintell
Copy link
Member

sprintell commented Sep 19, 2024

As developer I want an api endpoint such that that when I send a GET request to the URL, hateoas compliant, paginated list of all SNPs 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/singleNucleotidePolymorphisms

{
   "id":34567,
   "rsId":"rs12019358",
   "merged":0,
   "currentSnp":"",
   "functionalClass":"intergenic_variant",
   "lastUpdateDate":"2023-09-14T13:00:23.399+0000",
   "location":{
      "id":7868,   
      "chromosomeName":"12",
      "chromosomePosition":95867790,
      "region":{
  	   "name":"12q23.1"
      }
   },
   "_links":{
  	"self":{
     	"href":"http://localhost:8089/api/single-nucleotide-polymorphisms/rs12019358"
  	},
  	"locations":{
     	"href":"{base_url}/v1/single-nucleotide-polymorphisms/rs12019358/locations"
  	},
  	"genomic-contexts":{
     	"href":"{base_url}/v1/single-nucleotide-polymorphisms/rs12019358/genomic-contexts"
  	},
  	"search":{
     	"href":"{base_url}/v1/single-nucleotide-polymorphisms?fullPvalueSet"
  	}
   }
}

Management Rules

  • Rule 1: Endpoint - /v1/single-nucleotide-polymorphisms
  • Rule 2: HTTP Request Method - GET
  • Rule 3: Endpoint should accept search page and sort parameters as in /v1/single-nucleotide-polymorphisms?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/single-nucleotide-polymorphisms endpoint should accept search filter parameters as in /v1/single-nucleotide-polymorphisms?{search_parameter}=

Search Parameter

  • currentSnp
  • bpLocation
  • chrom,bpStart,bpEnd
  • pubmedId
  • rsId
  • geneName

Additional details here

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

1 participant