Phenotypes
Phenotypes
Bases: Endpoint
Queries phenotypes/ endpoints
Functions
get(**kwargs)
Queries phenotypes/, with optional query parameters
NOTE
- See the following URL for more information on query parameters: https://conceptlibrary.saildatabank.com/api/v1/#operations-tag-phenotypes
Other Parameters:
Name | Type | Description |
---|---|---|
search |
string
|
Keyword search |
collections |
list
|
IDs of collections |
tags |
list
|
IDs of tags |
datasources |
list
|
IDs of datasources |
Response (dict|list): - If paginated: a dict of phenotypes matching query parameters - If unpaginated: a list of phenotypes matching query parameters
Examples:
get_versions(id)
Queries phenotypes/{id}/get-versions/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
ID of entity to query, in format PH[\d+] |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
list
|
Version list of queried phenotype |
Examples:
get_detail(id, version_id=None)
Queries phenotypes/{id}/detail/ or phenotypes/{id}/version/{version_id}/detail if version_id is supplied
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
ID of entity to query, in format PH[\d+] |
required |
version_id
|
int
|
version ID of entity |
None
|
Returns:
Name | Type | Description |
---|---|---|
Response |
list
|
Details of queried phenotype |
Examples:
get_codelist(id, version_id=None)
Queries phenotypes/{id}/export/codes/ or phenotypes/{id}/version/{version_id}/export/codes if version_id is supplied
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
ID of entity to query, in format PH[\d+] |
required |
version_id
|
int
|
version ID of entity |
None
|
Returns:
Name | Type | Description |
---|---|---|
Response |
list
|
Codelist of queried phenotype |
Examples:
save_definition_file(path, id, version_id=None)
Saves the YAML definition of the queried phenotype to file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Location to save the YAML file |
required |
id
|
str
|
ID of entity to query, in format PH[\d+] |
required |
version_id
|
int
|
version ID of entity |
None
|
Examples:
create(path)
Uploads the specified phenotype definition file to the ConceptLibrary and creates a new phenotype
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Location where the definition file is saved on your local machine |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
list
|
Details of the newly created phenotype |
Examples:
update(path)
Uses the specified phenotype definition file to update an already existing phenotype
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Location where the definition file is saved on your local machine |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
list
|
Details of the updated phenotype |
Examples: