Skip to content

odm_api.ReferenceGenomeApi

All URIs are relative to http://localhost

Method HTTP request Description
get_reference_genome_by_accession GET /api/v1/reference-genomes/{id} Retrieve a single Reference Genome object by ID (accession)
search_reference_genomes GET /api/v1/reference-genomes List or search for Reference Genome objects
upload POST /api/v1/reference-genomes Upload reference genome to ODM

get_reference_genome_by_accession

RGItem get_reference_genome_by_accession(id)

Retrieve a single Reference Genome object by ID (accession)

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.rg_item import RGItem
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.ReferenceGenomeApi(api_client)
    id = 'id_example' # str | Unique identifier (Genestack accession) of Reference Genome object.

    try:
        # Retrieve a single Reference Genome object by ID (accession)
        api_response = api_instance.get_reference_genome_by_accession(id)
        print("The response of ReferenceGenomeApi->get_reference_genome_by_accession:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ReferenceGenomeApi->get_reference_genome_by_accession: %s\n" % e)

Parameters

Name Type Description Notes
id str Unique identifier (Genestack accession) of Reference Genome object.

Return type

RGItem

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is the object. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
404 No object exists with the given ID. -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_reference_genomes

ListResponse search_reference_genomes(organism=organism, assembly=assembly, release=release, query=query, page_limit=page_limit, page_offset=page_offset)

List or search for Reference Genome objects

Retrieve Reference Genome metadata objects by searching/listing Reference Genome metadata.

Metadata full-text queries

Single words can be supplied as is, otherwise use speech marks (") to quote queries that include whitespace. Speech marks and backslash characters in the query need to be escaped with a backslash (\).

Paging

For performance reasons, this endpoint returns results in "pages" of limited size. In order to retrieve all matching results the client needs to request multiple pages starting from an offset to the first result. You can do this using the pageOffset query parameter. A value of 0 (the default) instructs the server to return the first page of results, 100 would return a page of results starting from the 101st result and so on. To retrieve all results, iterate through pages by increasing the offset in multiples of limit (e.g., offset = n * limit), until all results have been retrieved. The total number of pages can be calculated by dividing the total number of results by the limit.

List operation

This endpoint can be called without any query parameters. When called this way, it returns a list of all Reference Genome objects.

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.list_response import ListResponse
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.ReferenceGenomeApi(api_client)
    organism = 'organism_example' # str | Scientific name of an organism (species) used in reference genome file (e.g. `Homo sapiens`). (optional)
    assembly = 'assembly_example' # str | Major version (for example, `GRCh38`). (optional)
    release = 'release_example' # str | Ensembl reference genome minor version (for example, `75` or `109`). (optional)
    query = 'query_example' # str | Search for reference genome via a full-text query over all reference genome metadata fields (e.g. `GRCh38`). (optional)
    page_limit = 56 # int | Maximum number of results to return per page (see Paging above). This value must be between 0 and 2000 (inclusive). The default is 2000. (optional)
    page_offset = 56 # int | Show the page {pageOffset + 1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. (optional)

    try:
        # List or search for Reference Genome objects
        api_response = api_instance.search_reference_genomes(organism=organism, assembly=assembly, release=release, query=query, page_limit=page_limit, page_offset=page_offset)
        print("The response of ReferenceGenomeApi->search_reference_genomes:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ReferenceGenomeApi->search_reference_genomes: %s\n" % e)

Parameters

Name Type Description Notes
organism str Scientific name of an organism (species) used in reference genome file (e.g. `Homo sapiens`). [optional]
assembly str Major version (for example, `GRCh38`). [optional]
release str Ensembl reference genome minor version (for example, `75` or `109`). [optional]
query str Search for reference genome via a full-text query over all reference genome metadata fields (e.g. `GRCh38`). [optional]
page_limit int Maximum number of results to return per page (see Paging above). This value must be between 0 and 2000 (inclusive). The default is 2000. [optional]
page_offset int Show the page {pageOffset + 1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. [optional]

Return type

ListResponse

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is a list of objects. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upload

AccessionResponse upload(body=body)

Upload reference genome to ODM

In order to import reference genome file, please fill in the following fields:

  • annotationUrl - link to the non-vertebrae organism or any custom reference genome in .gtf format, archived in .gz format. Note: if any of the parameters below are not corresponding to the available Ensembl data (for example, organism name or assembly is changed), the link must be provided.
  • organism - scientific name (default: Homo sapiens). Please see the list of available organisms here. Note: for some specific cases (Canis lupus breeds, Mus musculus strains, etc.) please see the species folders name in the Ensembl FTP (release 113) to provide the same organism name as shown in the list.
  • assembly - major version (for example, GRCh38). Please see the list of available assemblies here.
  • release - Ensembl reference genome minor version (for example, 75 or 109).
  • name - customized reference genome title that is used for linkage variant files. By default is combined from species, assembly and release parameters: {species} reference genome {assembly}.{release}.

Reference genome will be available after initialisation. Please track initialisation task status.

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.accession_response import AccessionResponse
from odm_api.models.upload_rg_request import UploadRGRequest
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.ReferenceGenomeApi(api_client)
    body = odm_api.UploadRGRequest() # UploadRGRequest |  (optional)

    try:
        # Upload reference genome to ODM
        api_response = api_instance.upload(body=body)
        print("The response of ReferenceGenomeApi->upload:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ReferenceGenomeApi->upload: %s\n" % e)

Parameters

Name Type Description Notes
body UploadRGRequest [optional]

Return type

AccessionResponse

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The object was successfully created. -
400 The object cannot be created. This error occurs when the supplied data or metadata are incorrect. Please see error message for details. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
403 Not enough permissions to call method. -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]