Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
htsget-openapi-factored.yaml
openapi: 3.0.0
servers:
- description: htsget genomics api
url: https://virtserver.swaggerhub.com/brainkod/htsget/1.1.1
info:
description: "This data retrieval API bridges from existing genomics bulk data transfers to a client/server model"
version: "1.1.1"
title: htsget
contact:
name: GA4GH
email: security-notification@ga4gh.org
license:
name: GPLv3
paths:
/reads/{id}:
get:
summary: Gets the reads from a pre-indexed id
operationId: searchReadId
description: |
Searches a pre-indexed object id.
parameters:
$ref: '#/components/schemas/commonRequestParameters'
- in: "query"
name: format
description: File format, BAM (default), CRAM.
example: "BAM"
required: false
schema:
type: string
- in: "query"
name: fields
description: A list of fields to include, such as QNAME, FLAG, RNAME, etc...
example: "fields=QNAME,RNAME"
required: false
schema:
enum:
- "QNAME"
- "FLAG"
- "RNAME"
- "POS"
- "MAPQ"
- "CIGAR"
- "RNEXT"
- "PNEXT"
- "TLEN"
- "SEQ"
- "QUAL"
type: string
responses:
'200':
description: results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/readIdResponse'
'400':
description: something went wrong
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponses'
'500':
description: Unexpected error
security:
- htsget_auth:
- read:genomic_reads
/variants/{id}:
get:
summary: Gets the variants from a pre-indexed id
operationId: searchVariantId
description: |
Searches a pre-indexed object id.
parameters:
$ref: '#/components/schemas/commonRequestParameters'
- in: "query"
name: format
description: File format, VCF (default), BCF.
example: "VCF"
required: false
schema:
type: string
- in: "query"
name: fields
description: A list of variant fields to include, such as INFO, SAMPLE, FORMAT, etc.
example: "fields=INFO,SAMPLE"
required: false
schema:
enum:
- "INFO"
- "SAMPLE"
- "FILTER"
- "FORMAT"
- "ALT"
type: string
responses:
'200':
description: results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/variantIdResponse'
'400':
description: something went wrong
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponses'
'500':
description: Unexpected error
security:
- htsget_auth:
- read:genomic_variants
components:
schemas:
readIdResponse:
$ref: '#/components/schemas/htsgetResponse'
variantIdResponse:
$ref: '#/components/schemas/htsgetResponse'
commonRequestParameters:
- in: "path"
name: id
description: identifier of the variant object
required: true
schema:
type: string
- in: "query"
name: referenceName
description: VReference sequence name
example: "chr1"
required: false
schema:
type: string
- in: "query"
name: start
description: The start position of the range on the reference, 0-based, inclusive.
example: "12312"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: end
description: The end position of the range on the reference, 0-based exclusive.
example: "99999"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: tags
description: A comma separated list of tags to include, by default all.
example: "cancer,melanoma"
required: false
schema:
type: string
- in: "query"
name: notags
description: A comma separated list of tags to exclude, default none.
example: "normal,skin"
required: false
schema:
type: string
htsgetResponse:
type: object
properties:
htsget:
type: object
required:
- format
- urls
properties:
format:
type: string
example:
"BAM"
urls:
$ref: '#/components/schemas/htsgetUrlsHeaders'
md5:
type: string
example: "8a6049fad4943ff4c6de5c22df97d001"
htsgetUrlsHeaders:
type: array
example:
- url: "data:application/vnd.ga4gh.bam;base64,QkFNAQ=="
- url: "data:application/vnd.ga4gh.vcf;base64,QkFNAQ=="
headers:
"Authorization": "Bearer xxxxx"
"Range": "bytes=65536-1003750"
items:
$ref: '#/components/schemas/urlsItems'
urlsItems:
type: object
required:
- url
properties:
url:
type: string
headers:
type: object
# HTTP 400 errors
errorResponses:
oneOf:
- $ref: '#/components/schemas/UnsupportedFormat'
- $ref: '#/components/schemas/InvalidInput'
- $ref: '#/components/schemas/InvalidRange'
UnsupportedFormat:
description: The requested file format is not supported by the server
InvalidInput:
description: The request parameters do not adhere to the specification
InvalidRange:
description: The requested range cannot be satisfied
securitySchemes:
htsget_auth:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://example.com/api/oauth/dialog
tokenUrl: https://example.com/api/oauth/token
scopes:
read:genomic_reads: read access to genomic reads
read:genomic_variants: read access to genomic variants
openapi: 3.0.0
servers:
- description: htsget genomics api
url: https://virtserver.swaggerhub.com/brainkod/htsget/1.1.1
info:
description: "This data retrieval API bridges from existing genomics bulk data transfers to a client/server model"
version: "1.1.1"
title: htsget
contact:
name: GA4GH
email: security-notification@ga4gh.org
license:
name: GPLv3
paths:
/reads/{id}:
get:
summary: Gets the reads from a pre-indexed id
operationId: searchReadId
description: |
Searches a pre-indexed object id.
parameters:
- in: "path"
name: id
description: identifier of the read object
required: true
schema:
type: string
- in: "query"
name: format
description: File format, BAM (default), CRAM.
example: "BAM"
required: false
schema:
type: string
- in: "query"
name: referenceName
description: VReference sequence name
example: "chr1"
required: false
schema:
type: string
- in: "query"
name: start
description: The start position of the range on the reference, 0-based, inclusive.
example: "12312"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: end
description: The end position of the range on the reference, 0-based exclusive.
example: "99999"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: fields
description: A list of fields to include, such as QNAME, FLAG, RNAME, etc...
example: "fields=QNAME,RNAME"
required: false
schema:
enum:
- "QNAME"
- "FLAG"
- "RNAME"
- "POS"
- "MAPQ"
- "CIGAR"
- "RNEXT"
- "PNEXT"
- "TLEN"
- "SEQ"
- "QUAL"
type: string
- in: "query"
name: tags
description: A comma separated list of tags to include, by default all.
example: "cancer,melanoma"
required: false
schema:
type: string
- in: "query"
name: notags
description: A comma separated list of tags to exclude, default none.
example: "normal,healthy"
required: false
schema:
type: string
responses:
'200':
description: results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/readIdResponse'
'400':
description: something went wrong
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponses'
'500':
description: Unexpected error
security:
- htsget_auth:
- read:genomic_reads
/variants/{id}:
get:
summary: Gets the variants from a pre-indexed id
operationId: searchVariantId
description: |
Searches a pre-indexed object id.
parameters:
- in: "path"
name: id
description: identifier of the variant object
required: true
schema:
type: string
- in: "query"
name: format
description: File format, VCF (default), BCF.
example: "VCF"
required: false
schema:
type: string
- in: "query"
name: referenceName
description: VReference sequence name
example: "chr1"
required: false
schema:
type: string
- in: "query"
name: start
description: The start position of the range on the reference, 0-based, inclusive.
example: "12312"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: end
description: The end position of the range on the reference, 0-based exclusive.
example: "99999"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: fields
description: A list of variant fields to include, such as INFO, SAMPLE, FORMAT, etc.
example: "fields=INFO,SAMPLE"
required: false
schema:
enum:
- "INFO"
- "SAMPLE"
- "FILTER"
- "FORMAT"
- "ALT"
type: string
- in: "query"
name: tags
description: A comma separated list of tags to include, by default all.
example: "cancer,melanoma"
required: false
schema:
type: string
- in: "query"
name: notags
description: A comma separated list of tags to exclude, default none.
example: "normal,skin"
required: false
schema:
type: string
responses:
'200':
description: results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/variantIdResponse'
'400':
description: something went wrong
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponses'
'500':
description: Unexpected error
security:
- htsget_auth:
- read:genomic_variants
components:
schemas:
readIdResponse:
$ref: '#/components/schemas/htsgetResponse'
variantIdResponse:
$ref: '#/components/schemas/htsgetResponse'
htsgetResponse:
type: object
properties:
htsget:
type: object
required:
- format
- urls
properties:
format:
type: string
example:
"BAM"
urls:
$ref: '#/components/schemas/htsgetUrlsHeaders'
md5:
type: string
example: "8a6049fad4943ff4c6de5c22df97d001"
htsgetUrlsHeaders:
type: array
example:
- url: "data:application/vnd.ga4gh.bam;base64,QkFNAQ=="
- url: "data:application/vnd.ga4gh.vcf;base64,QkFNAQ=="
headers:
"Authorization": "Bearer xxxxx"
"Range": "bytes=65536-1003750"
items:
$ref: '#/components/schemas/urlsItems'
urlsItems:
type: object
required:
- url
properties:
url:
type: string
headers:
type: object
# HTTP 400 errors
errorResponses:
oneOf:
- $ref: '#/components/schemas/UnsupportedFormat'
- $ref: '#/components/schemas/InvalidInput'
- $ref: '#/components/schemas/InvalidRange'
UnsupportedFormat:
description: The requested file format is not supported by the server
InvalidInput:
description: The request parameters do not adhere to the specification
InvalidRange:
description: The requested range cannot be satisfied
securitySchemes:
htsget_auth:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://example.com/api/oauth/dialog
tokenUrl: https://example.com/api/oauth/token
scopes:
read:genomic_reads: read access to genomic reads
read:genomic_variants: read access to genomic variants
openapi: 3.0.2
servers:
- description: WIP WIP WIP htsget genomics api WIP WIP WIP
url: https://virtserver.swaggerhub.com/brainkod/htsget/1.2.0
info:
description: "This data retrieval API bridges from existing genomics bulk data transfers to a client/server model"
version: "1.2.0"
title: htsget
contact:
name: GA4GH
email: security-notification@ga4gh.org
paths:
/reads/{id}:
get:
summary: Gets the reads from a pre-indexed id
operationId: searchReadId
description: |
Searches a pre-indexed object id.
parameters:
- in: "path"
name: id
description: identifier of the read object
required: true
schema:
type: string
- in: "query"
name: format
description: File format, BAM (default), CRAM.
example: "BAM"
required: false
schema:
type: string
- in: "query"
name: referenceName
description: Reference sequence name
example: "chr1"
required: false
schema:
type: string
- in: "query"
name: start
description: The start position of the range on the reference, 0-based, inclusive.
example: "12312"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: end
description: The end position of the range on the reference, 0-based exclusive.
example: "99999"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: fields
description: A list of fields to include, such as QNAME, FLAG, RNAME, etc...
example: "fields=QNAME,RNAME"
required: false
schema:
enum:
- "QNAME"
- "FLAG"
- "RNAME"
- "POS"
- "MAPQ"
- "CIGAR"
- "RNEXT"
- "PNEXT"
- "TLEN"
- "SEQ"
- "QUAL"
type: string
- in: "query"
name: tags
description: A comma separated list of tags to include, by default all.
example: "cancer,melanoma"
required: false
schema:
type: string
- in: "query"
name: notags
description: A comma separated list of tags to exclude, default none.
example: "normal,healthy"
required: false
schema:
type: string
# Cannot reuse those since responses does not accept $ref directly, yet:
# https://github.com/OAI/OpenAPI-Specification/issues/1586
responses:
'200':
$ref: '#/components/schemas/success'
'400':
$ref: '#/components/schemas/errors/Unspecified'
'401':
$ref: '#/components/schemas/errors/AuthInvalid'
'403':
$ref: '#/components/schemas/errors/AuthAccessDenied'
'404':
$ref: '#/components/schemas/errors/NotFound'
'500':
$ref: '#/components/schemas/errors/InternalServer'
default:
$ref: '#/components/schemas/errors/InternalServer'
security:
- htsget_auth:
- read:genomic_reads
/variants/{id}:
get:
summary: Gets the variants from a pre-indexed id
operationId: searchVariantId
description: Searches a pre-indexed object id.
parameters:
- in: "path"
name: id
description: identifier of the variant object
required: true
schema:
type: string
- in: "query"
name: format
description: File format, VCF (default), BCF.
example: "VCF"
required: false
schema:
type: string
- in: "query"
name: referenceName
description: Reference sequence name
example: "chr1"
required: false
schema:
type: string
- in: "query"
name: start
description: The start position of the range on the reference, 0-based, inclusive.
example: "12312"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: end
description: The end position of the range on the reference, 0-based exclusive.
example: "99999"
required: false
schema:
type: integer
format: int64
minimum: 0
- in: "query"
name: tags
description: A comma separated list of tags to include, by default all.
example: "cancer,melanoma"
required: false
schema:
type: string
- in: "query"
name: notags
description: A comma separated list of tags to exclude, default none.
example: "normal,skin"
required: false
schema:
type: string
responses:
'200':
$ref: '#/components/schemas/success'
'400':
$ref: '#/components/schemas/errors/Unspecified'
'401':
$ref: '#/components/schemas/errors/AuthInvalid'
'403':
$ref: '#/components/schemas/errors/AuthAccessDenied'
'404':
$ref: '#/components/schemas/errors/NotFound'
'500':
$ref: '#/components/schemas/errors/InternalServer'
default:
$ref: '#/components/schemas/errors/InternalServer'
security:
- htsget_auth:
- read:genomic_variants
components:
schemas:
IdResponse:
$ref: '#/components/schemas/htsgetResponse'
htsgetResponse:
type: object
properties:
htsget:
type: object
required:
- format
- urls
properties:
format:
type: string
example:
"BAM"
urls:
$ref: '#/components/schemas/htsgetUrlsHeaders'
md5:
type: string
example: "8a6049fad4943ff4c6de5c22df97d001"
htsgetUrlsHeaders:
type: array
example:
- url: "data:application/vnd.ga4gh.vcf;base64,QkFNAQ=="
- url: "https://htsget.blocksrv.example/sample1234/run1.bam"
headers:
"Authorization": "Bearer xxxxx"
"Range": "bytes=65536-1003750"
items:
$ref: '#/components/schemas/urlsItems'
urlsItems:
type: object
required:
- url
properties:
url:
type: string
headers:
type: object
success:
description: results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/IdResponse'
example:
{
"htsget" : {
"format" : "BAM",
"urls" : [
{
"url" : "https://htsget.blocksrv.example/sample1234/run1.bam",
"headers" : {
"Authorization" : "Bearer xxxx",
"Range" : "bytes=2744831-9375732"
},
"class" : "body"
}
]
}
}
errors:
UnsupportedFormat:
description: The requested file format is not supported by the server
InvalidInput:
description: The request parameters do not adhere to the specification
InvalidRange:
description: The requested range cannot be satisfied
AuthInvalid:
description: Authorization provided is invalid
AuthAccessDenied:
description: Authorization is required to access the resource
NotFound:
description: Authorization is required to access the resource
InternalServer:
description: Internal Server Error
Unspecified:
description: Something went wrong
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/errors/UnsupportedFormat'
- $ref: '#/components/schemas/errors/InvalidInput'
- $ref: '#/components/schemas/errors/InvalidRange'
securitySchemes:
htsget_auth:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://example.com/api/oauth/dialog
tokenUrl: https://example.com/api/oauth/token
scopes:
read:genomic_reads: read access to genomic reads
read:genomic_variants: read access to genomic variants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.