Skip to content

Instantly share code, notes, and snippets.

@guyjacks
Created September 17, 2018 17:24
Show Gist options
  • Save guyjacks/c5d93c9906ddd66dba0e09a06e3fa64a to your computer and use it in GitHub Desktop.
Save guyjacks/c5d93c9906ddd66dba0e09a06e3fa64a to your computer and use it in GitHub Desktop.
# Gene Trait Rule Filter
{
"rule-restraints": {
"stength": {
"min": null,
"max": null
}
},
"match-restraints": {
"min-rules-matched": null,
"max-rules-matched": null
}
"filters": [
{
"type": "intersection",
"filters": [
{
"type": "gene",
"gene": "uuid-goes-here" // don't bother validating the fk reference. it just won't return anything if there are not any matches
"mutated": true
"variant": null,
"position": null
},
{
"type": "gene",
"gene": "uuid-goes-here"
"mutated": false
"variant": null,
"position": null
}
]
}
]
}
# Gene Filter Definition
# Use this to validate before storing the query filter.
# Its assumed that the json body stored in queries.filters has already passed validation
{
"can_be_applied_to": ["rules"]
"fields": [
{
"gene": {
"nullable": false,
"types": [
{
"type": "db-fk"
"db-table": "datasets_genes",
"key-fields": ["id"]
}
]
},
"mutated": {
"nullable": true,
"types": [
{
"type": "boolean"
}
]
},
"variant": {
"nullable": true,
"types": [
{
"type": "db-fk",
"db-table": "datasets_gene_mutation_variants",
"key-fields": ["id"]
}
]
},
"position": {
"nullable": true,
"types": [
{
"type": "integer",
"minimum": 0,
"maximum": null
}
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment