Skip to content

API Alleles

Alexandre P Francisco edited this page Jun 20, 2023 · 16 revisions

GET /taxa/{taxon}/loci/{locus}/alleles

Description: Retrieves the specified page of alleles

Request:

  • URI Params:
    • taxon (String) Taxon identifier
    • locus (String) Locus identifier
  • Query String:
    • page (Integer, Optional) Page to retrieve. Default value is 0
    • project (String, Optional) Project identifier. Default value is null
  • Example:
curl --location --request GET 'http://localhost:8080/taxa/bbacilliformis/loci/ftsZ/alleles?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: A list of objects with the resumed information of the alleles
  • Content Type:
    • application/json
  • Schema:
[
   {
      "id": String
      "project_id": String (Optional)
      "version": Integer
   },
   ...
]
  • Example:
[{"id": "1", "version": 1}, {"id": "2", "version": 2}]

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

GET /taxa/{taxon}/loci/{locus}/alleles/{allele}

Description: Retrieves the specified allele

Request:

  • URI Params:
    • taxon (String) Taxon identifier
    • locus (String) Locus identifier
    • allele (String) Allele identifier
  • Query String:
    • version (Integer, Optional) Version of the allele information. Default value is the current version
    • project (String, Optional) Project identifier. Default value is null
  • Example:
curl --location --request GET 'http://localhost:8080/taxa/bbacilliformis/loci/ftsZ/alleles/1?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: An object with the information of the allele
  • Content Type:
    • application/json
  • Schema:
{
   "taxon_id": String
   "locus_id": String
   "id": String
   "project_id": String (Optional)
   "version": Integer
   "deprecated": Boolean
   "sequence": String
}
  • Example:
{
   "taxon_id": "bbacilliformis",
   "locus_id": "ftsZ",
   "id": "1",
   "version": 1,
   "deprecated": false,
   "sequence": "TCGAGGAACCGCTCGAG"
}

Error Responses:

  • 404 Not Found
  • 401 Unauthorized

Role: User

GET /taxa/{taxon}/loci/{locus}/alleles/files

Description: Retrieves the specified page of alleles in a FASTA formatted string

Request:

  • URI Params:
    • taxon (String) Taxon identifier
    • locus (String) Locus identifier
  • Query String:
    • page (Integer, Optional) Page to retrieve. Default value is 0
    • project (String, Optional) Project identifier. Default value is null
  • Example:
curl --location --request GET 'http://localhost:8080/taxa/bbacilliformis/loci/ftsZ/alleles/files?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: A string with the respective page of alleles formatted in FASTA
  • Content Type:
    • text/plain
  • Example:
>ftsZ_1 TCGAGGAACCGCTCGAGAGGTGATCCTGTCG
>ftsZ_2 TCGAGGAACCGCTCGAGAGGTGATCCTGTCG

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

PUT /taxa/{taxon}/loci/{locus}/alleles/{allele}

Description: Stores the specified allele

Request:

  • URI Params:
    • taxon (String) Taxon identifier
    • locus (String) Locus identifier
    • allele (String) Allele identifier
  • Content: An object with the information of the allele
  • Content Type:
    • application/json
  • Schema:
{
   "id": String
   "sequence": String
}
  • Example:
{
   "id": "1",
   "sequence": "TCGAGGAACCGCTCGAG"
}

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

PUT /taxa/{taxon}/loci/{locus}/alleles/files

Description: Stores the alleles of the file

Request:

  • URI Params:
    • taxon (String) Taxon identifier
    • locus (String) Locus identifier
  • Query String:
    • file (File) File that contains the alleles
  • Content: A file with alleles formatted in FASTA
  • Content Type:
    • multipart/form-data
  • Example:
curl --location --request PUT 'http://localhost:8080/taxa/bbacilliformis/loci/glpF/alleles/files?provider=google'
--header 'Content-Type: multipart/form-data'
--header 'Authorization: Bearer {Access Token}'
--form 'file=@/filelocation/filename.txt'

Success Response:

  • Status Code: 200 OK
  • Content: An object with the invalid lines and invalid alleles
  • Content Type:
    • application/json
  • Schema:
{
   "invalid_lines": Integer[]
   "invalid_entities": String[]
}
  • Example:
{
   "invalid_lines": [1, 2],
   "invalid_entities": ["3"]
}

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

POST /taxa/{taxon}/loci/{locus}/alleles/files

Description: Stores the non-existing alleles of the file

Request:

  • URI Params:
    • taxon (String) Taxon identifier
    • locus (String) Locus identifier
  • Query String:
    • file (File) File that contains the alleles
  • Content: A file with alleles formatted in FASTA
  • Content Type:
    • multipart/form-data
  • Example:
curl --location --request POST 'http://localhost:8080/taxa/bbacilliformis/loci/glpF/alleles/files?provider=google'
--header 'Content-Type: multipart/form-data'
--header 'Authorization: Bearer {Access Token}'
--form 'file=@/filelocation/filename.txt'

Success Response:

  • Status Code: 200 OK
  • Content: An object with the invalid lines and invalid alleles
  • Content Type:
    • application/json
  • Schema:
{
   "invalid_lines": Integer[]
   "invalid_entities": String[]
}
  • Example:
{
   "invalid_lines": [1, 2],
   "invalid_entities": ["3"]
}

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

DELETE /taxa/{taxon}/loci/{locus}/alleles/{allele}

Description: Deprecates the specified allele

Request:

  • URI Params:
    • taxon (String) Taxon identifier
    • locus (String) Locus identifier
    • allele (String) Allele identifier
  • Example:
curl --location --request DELETE 'http://localhost:8080/taxa/bbacilliformis/loci/ftsZ/alleles/1?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 401 Unauthorized

Role: User

Clone this wiki locally