Ktor Specifications¶
In this document, we will discuss the BrAPI
endpoints provided by the Ktor server implemented in the
start-server
command.
Overview¶
As stated in the "Export data" documentation,
start-server
is a command that allows users to start a
"RESTful" web service. This
service can provide access to a centralized PHG database, allowing
multiple individuals in a team to simultaneously retrieve
PHG-relevant information. This service relies on two components:
the Ktor framework and BrAPI-compliant endpoints.
Ktor is an asynchronous framework for building web applications and microservices in Kotlin. It is designed for creating connected systems, focusing on scalability, high performance, and ease of use. Ktor supports both server and client-side development, allowing developers to create RESTful APIs, web sockets, and various other server applications. It provides a DSL (Domain-Specific Language) to define routing, request handling, and response production, making it highly customizable and flexible for a wide range of use cases.
This framework aids in the deployment of BrAPI-compliant data endpoints. BrAPI is a standardized RESTful web service API specification for plant breeding data. It ensures interoperability among breeding databases and tools by providing a common framework. Additionally (and most importantly), BrAPI is developed by a global community of contributors and is intended to be an open and accessible standard for anyone involved in plant breeding data management.
Relevant endpoints¶
While BrAPI comprises several "modules", PHGv2 leverages data endpoints found within the core and genotyping modules:
serverinfo
- Usage:
<host-url>:<port>/brapi/v2/serverinfo
- Find all available BrAPI calls implemented for the server
- Usage:
samples
- Usage:
<host-url>:<port>/brapi/v2/samples
- List all samples available in the PHG database
- Usage:
variants
- Usage:
<host-url>:<port>/brapi/v2/variants
- List all reference ranges available in the PHG database
- Usage:
variantsets
- Usage:
<host-url>:<port>/brapi/v2/variantsets
- Downloadable link for a composite hVCF file. (Currently for all data)
- Usage:
Response fields¶
Each of the prior BrAPI calls will contain "key-value" response fields which contain the actual data:
serverinfo
calls
- array of available calls to the serverdataTypes
- possible data formats returned by the available call (e.g.,"APPLICATION_JSON"
)methods
- HTTP methods to be used for each call (e.g.,GET
)service
- name of the call (e.g.,samples
)version
- supported versions for a given call (e.g.,"_2"
)
samples
additionalInfo
- "free" space for further information (not bound by any data type)sampleDbId
- internal ID value for given samplesampleDescription
- description of samplesampleName
- name of sample in PHG database
variants
additionalInfo
- an object for additional informationalternateBases
- an array of alternate base sequencesciend
- an array of confidence interval end positionscipos
- an array of confidence interval start positionscreated
- the creation timestamp of the variantend
- the end position of the variantfiltersApplied
- a boolean indicating if filters were appliedfiltersFailed
- an array of failed filtersfiltersPassed
- a boolean indicating if the variant passed filtersreferenceBases
- the reference base sequencereferenceName
- the reference chromosome or scaffold namestart
- the start position of the variantsvlen
- the structural variant lengthupdated
- the last update timestamp of the variantvariantDbId
- the unique identifier of the variantvariantNames
- an array of variant namesvariantSetDbId
- an array of associated variant set IDsvariantType
- the type of variant (e.g.,"REF_RANGE"
)
variantsets
additionalInfo
- an object for additional informationanalysis
- an array of analysis related to the variant setavailableFormats
- a list of available formats with detailsdataFormat
- the data format (e.g.,"VCF"
)fileFormat
- the file format (e.g.,"TEXT_TSV"
)fileURL
- the URL to access the file
callSetCount
- the count of call setsreferenceSetDbId
- the unique identifier of the reference setstudyDbId
- the unique identifier of the studyvariantCount
- the count of variantsvariantSetDbId
- the unique identifier of the variant setvariantSetName
- the name of the variant set