DNA Trait assessments
- We assume that you completed second tutorial Providing genetic files and that you have:
- Access token stored in
ACCESS_TOKEN
environment variable - Created Sample object and stored sample ID in
SAMPLE_ID
environment variable - Created Genotype with valid genetic file
- Access token stored in
Notes:
{ACCESS_TOKEN}
must be obtained from the authentication endpoint. See Auth docs for examples.- Before reading trait assessments, Sample object with genetic data must be created. See Basic Sample Setup.
Waiting for DNA Trait Assessments
DNA Trait Assessments will be available once the Genotype analysis is succefuly
completed. Genotype analysis is an asynchronous process that is initiated
automatically after genotype is created and PBS object identified by genotype's
source_uri
property becomes available. That means that the API client doesn't
initiate processing explicitly and API client is not blockeduntil the file
processing is finished.
Client needs to check genotype state by invoking Get
Genotype
operation.
Once file processing is completed, genotype state
will transition to processed
:
{
"id": "312235f8-...-c8b71648471d",
"assembly": "grch37",
"source_uri": "string",
"source_blob_metadata": null,
"state": "processed",
...
}
Reading Trait Assessments
Trait assessments can be fetched by invoking
List DNA Traits
All trait assessments can be fetched with a single request:
curl --request GET \
--url "https://se1.lifenome.com/platform-api/api/core-api/samples/${SAMPLE_ID}/traits/" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${ACCESS_TOKEN}"
Response will contain paginated list of trait assessment objects:
{
"count": 179,
"next": "https://se1.lifenome.com/platform-api/api/samples-api/samples/{SAMPLE_ID}/traits/?limit=50&offset=50",
"previous": null,
"results": [
{
"trait_code": "achilles-tendinopathy",
"trait": {
"code": "achilles-tendinopathy",
"name": "Achilles Tendinopathy",
"description": null
},
"assessment": {
"score": 2.5,
"level": 2,
"percentile": 95.0
},
"coverage": {
"lookup_snps": 8,
"snps_found": 6,
"inhibiting_snps": 1,
"contributing_snps": 5
},
"recommendations": [],
"axengine": {
"engine": "default",
"module": "lfn-wellness-grch37"
}
},
"_comment": "skipped..."
]
}
Also, single trait assessment can be retrieved by providing TRAIT_CODE
in the URL:
curl --request GET \
--url "https://se1.lifenome.com/platform-api/api/core-api/samples/${SAMPLE_ID}/traits/${TRAIT_CODE}/" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${ACCESS_TOKEN}"
For example, when TRAIT_CODE="achilles-tendinopathy"
, response is:
{
"trait_code": "achilles-tendinopathy",
"trait": {
"code": "achilles-tendinopathy",
"name": "Achilles Tendinopathy",
"description": null
},
"assessment": {
"score": 2.5,
"level": 2,
"percentile": 95.0
},
"coverage": {
"lookup_snps": 8,
"snps_found": 6,
"inhibiting_snps": 1,
"contributing_snps": 5
},
"recommendations": [],
"axengine": {
"engine": "default",
"module": "lfn-wellness-grch37"
}
}