Skip to content

Commit

Permalink
proper filteringTerms definition for models
Browse files Browse the repository at this point in the history
The previous filteringTerms.yaml/json endpoint definitions were odd:
 - either defined as empty lists (well, okish)
- or having some random values

This PR redefines filteringTerms endpoints as containing a list of

https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm

items. Should be non-breaking.
  • Loading branch information
mbaudis committed Aug 21, 2024
1 parent 1686220 commit f37b3df
Show file tree
Hide file tree
Showing 21 changed files with 81 additions and 71 deletions.
2 changes: 1 addition & 1 deletion bin/beaconYamler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/python3
#!/usr/bin/env python3

import sys, re, json
import pathlib
Expand Down
32 changes: 20 additions & 12 deletions framework/json/responses/sections/beaconFilteringTermsResults.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,32 @@
],
"type": "string"
},
"scopes": {
"description": "Entry types affected by this filter.",
"examples": [
[
"individual",
"biosample",
"analysis",
"run",
"genomicVariation"
],
[
"biosample"
]
],
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"description": "Either \"custom\", \"alphanumeric\" or ontology/terminology full name. TODO: An ontology ... with a registered prefix does not need a full name so one may better use CURIE to indicate that the resource can be retrieved from the id. This also will allow to provide an enum here.",
"examples": [
"Human Phenotype Ontology",
"alphanumeric"
],
"type": "string"
},
"scopes": {
"description": "Entry types affected by this filter.",
"examples": [
["individual", "biosample", "analysis", "run", "genomicVariation"],
["biosample"]
],
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
Expand Down Expand Up @@ -115,4 +123,4 @@
}
},
"type": "object"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ definitions:
- 'B Lymphoblastic Leukemia/Lymphoma'
- 'Aplasia/Hypoplasia of the middle ear'
scopes:
description: >-
description: >-
Entry types affected by this filter.
examples:
-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"filteringTerms": []
"items": {
"$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm"
},
"type": "array"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"filteringTerms": []
"items": {
"$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm"
},
"type": "array"
}
12 changes: 4 additions & 8 deletions models/json/beacon-v2-default-model/cohorts/filteringTerms.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"filteringTerms": [
{
"ftType": "ontologyTerm",
"id": "DUO:0000006",
"label": "health or medical or biomedical research",
"version": "2021-02-23"
}
]
"items": {
"$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm"
},
"type": "array"
}
4 changes: 2 additions & 2 deletions models/json/beacon-v2-default-model/common/age.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Age value definition. Provenance: GA4GH Phenopackets v2 `Age`",
"properties": {
"iso8601duration": {
"description": "Represents age as a ISO8601 duration (e.g., 'P40Y10M05D').",
"description": "Represents age as a ISO8601 duration (e.g., P40Y10M05D).",
"example": "P32Y6M1D",
"type": "string"
}
Expand All @@ -13,4 +13,4 @@
],
"title": "Age",
"type": "object"
}
}
4 changes: 2 additions & 2 deletions models/json/beacon-v2-default-model/common/ageRange.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}
},
"required": [
"end",
"start"
"start",
"end"
],
"title": "AgeRange",
"type": "object"
Expand Down
4 changes: 3 additions & 1 deletion models/json/beacon-v2-default-model/common/complexValue.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"type": "array"
}
},
"required": [ "typedQuantities" ],
"required": [
"typedQuantities"
],
"title": "Complex Value",
"type": "object"
}
12 changes: 4 additions & 8 deletions models/json/beacon-v2-default-model/datasets/filteringTerms.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"filteringTerms": [
{
"ftType": "ontologyTerm",
"id": "DUO:0000006",
"label": "health or medical or biomedical research",
"version": "2021-02-23"
}
]
"items": {
"$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm"
},
"type": "array"
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"filteringTerms": [
{
"ftType": "alphanumeric",
"id": "gene"
},
{
"ftType": "alphanumeric",
"id": "aminoacidChanges"
}
]
"items": {
"$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm"
},
"type": "array"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"$ref": "./requestParametersComponents.json#/definitions/Assembly"
},
"end": {
"description": "Precise or bracketing the end of the variants of interest: * (0-based, exclusive) - see `start` * for bracket queries, provide 2 values (e.g. [111,222]).",
"description": "Precise or bracketing the end of the variants of interest: * (0-based, exclusive) - see `start` * for bracket queries, provide 2 values (e.g. [111,222]).\"",
"items": {
"format": "int64",
"minimum": 1,
Expand Down Expand Up @@ -52,7 +52,7 @@
"$ref": "./requestParametersComponents.json#/definitions/RefSeqId"
},
"start": {
"description": "Precise or fuzzy start coordinate position(s), allele locus (0-based, inclusive). * `start` only:\n - for single positions, e.g. the start of a specified sequence\nalteration where the size is given through the specified `alternateBases`\n - typical use are queries for SNV and small InDels\n - the use of `start` without an `end` parameter requires the use of\n`alternateBases`\n* 1 value each in both `start` and `end`:\n - for searching any variant falling fully or partially within the range\n between `start` and `end` (a.k.a. \"range query\")\n - additional use of `variantType` OR `alternateBases` can limit the\n scope of the query\n - by convention, partial overlaps of variants with the indicated genomic\n range are accepted; for specific overlap requirements the 4-parameter\n \"Bracket Queries\" should be employed\n* 2 values in both `start` and `end` for constructing a \"Bracket Query\":\n - can be used to match any contiguous genomic interval, e.g. for querying\n imprecise positions\n - identifies all structural variants starting between `start[0]` and `start[1]`,\n and ending between `end[0]` <-> `end[1]`\n - single or double sided precise matches can be achieved by setting\n `start[1]=start[0]+1` and `end[1]=end[0]+1`",
"description": "Precise or fuzzy start coordinate position(s), allele locus (0-based, inclusive). * `start` only:\n - for single positions, e.g. the start of a specified sequence\n alteration where the size is given through the specified `alternateBases`\n - typical use are queries for SNV and small InDels\n - the use of `start` without an `end` parameter requires the use of\n `alternateBases`\n* 1 value in both `start` and `end`:\n - for searching any variant falling fully or partially within the range\n between `start` and `end` (a.k.a. \"range query\")\n - additional use of `variantType` OR `alternateBases` can limit the\n scope of the query\n - by convention, partial overlaps of variants with the indicated genomic\n range are accepted; for specific overlap requirements the 4-parameter\n \"Bracket Queries\" should be employed\n* 2 values in both `start` and `end` for constructing a \"Bracket Query\":\n - can be used to match any contiguous genomic interval, e.g. for querying\n imprecise positions\n - identifies all structural variants starting between `start[0]` and `start[1]`,\n and ending between `end[0]` <-> `end[1]`\n - single or double sided precise matches can be achieved by setting\n `start[1]=start[0]+1` and `end[1]=end[0]+1`",
"items": {
"format": "int64",
"minimum": 0,
Expand Down Expand Up @@ -87,4 +87,4 @@
},
"type": "object"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"filteringTerms": []
"items": {
"$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm"
},
"type": "array"
}
5 changes: 4 additions & 1 deletion models/json/beacon-v2-default-model/runs/filteringTerms.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"filteringTerms": []
"items": {
"$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm"
},
"type": "array"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$schema: https://json-schema.org/draft/2020-12/schema
filteringTerms: []
type: array
items:
$ref: https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$schema: https://json-schema.org/draft/2020-12/schema
filteringTerms: []
type: array
items:
$ref: https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
$schema: https://json-schema.org/draft/2020-12/schema
filteringTerms:
- ftType: ontologyTerm
id: DUO:0000006
label: health or medical or biomedical research
version: '2021-02-23'
type: array
items:
$ref: https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
$schema: https://json-schema.org/draft/2020-12/schema
filteringTerms:
- ftType: ontologyTerm
id: DUO:0000006
label: health or medical or biomedical research
version: '2021-02-23'
type: array
items:
$ref: https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
$schema: https://json-schema.org/draft/2020-12/schema
filteringTerms:
- ftType: alphanumeric
id: gene
- ftType: alphanumeric
id: aminoacidChanges
type: array
items:
$ref: https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$schema: https://json-schema.org/draft/2020-12/schema
filteringTerms: []
type: array
items:
$ref: https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm
4 changes: 3 additions & 1 deletion models/src/beacon-v2-default-model/runs/filteringTerms.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$schema: https://json-schema.org/draft/2020-12/schema
filteringTerms: []
type: array
items:
$ref: https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/sections/beaconFilteringTermsResults.json#/definitions/FilteringTerm

0 comments on commit f37b3df

Please sign in to comment.