Getting started — Hello, Genomelink!


This tutorial is aimed at developers using Genomelink API for the first time and covers the method for acquiring the genetic tendency of eye color of a demo user using a command line. It's only for a demo user (not an actual application user) but if Genomelink is used, you should be able to test how the application users' genetic tendencies can be read into your application even without specialist knowledge of genome.

Let's get started!

Call endpoint for genetic insights


Genomelink has /reports as the endpoint for acquiring the genetic tendency information.

As /reports endpoint requires following params,

/v1/reports/name?population=population
param type key required eg. description
path param name TRUE eye-color url-safe name of phenotype: list of phenotyes
query param population TRUE european currently only european is a valid value. other population is not available now.

It should become apparent by looking at the "list of items" which can be acquired via /reports that, in order to obtain the tendency for eye color,

  • name = eye-color
  • population = european

needs to be specified. Start-up the terminal and run the following curl command.

Eg.
$ curl -H "Authorization: Bearer GENOMELINKTEST001" "https://genomelink.io/v1/reports/eye-color?population=european"

The value specified by -H option here is a special value for acquiring the data resource for the demo user (-H option is an option which specified the HTTP Header). Genomelink uses OAuth flow for the authentication of the user but a tutorial later on will cover more detail about process beyond that point.

Did you successfully manage to get a response? If an error response such as below is returned, please check once again that there are no errors with the -H option or URI specification.

{"detail":"Authentication credentials were not provided."}
{"detail":"invalid population param. it MUST be in (european, east-asian, african, global)"}

A JSON response like the one below is returned if call is successful.

Eg.
{
  "phenotype": {
    "url_name": "eye-color",
    "display_name": "Eye color",
    "category": "trait"
  },
  "population": "european",
  "scores": [
    {
      "score": 0,
      "text": "Tend to not have brown eyes"
    },
    {
      "score": 1,
      "text": "Tend to not have brown eyes, slightly"
    },
    {
      "score": 2,
      "text": "Intermediate"
    },
    {
      "score": 3,
      "text": "Slight tendency for brown eyes"
    },
    {
      "score": 4,
      "text": "Stronger tendency for brown eyes"
    }
  ],
  "summary": {
    "score": 0,
    "text": "Tend to not have brown eyes",
    "warnings": []
  }
}

Here, summary.score and summary.text represent the tendency data for phenotype.display_name = Eye color. This example showed that it "tend to not have brown eyes".

Congratulations! You have managed to acquire the information relating to eye color tendency of the demo user. Wasn't that easy? In real application development, tendency information based on the genome of the application users can be obtained by implementing the OAuth authentication which was skipped on this occasion.