Case & Query API
The REST API for case access and is described in this section. Cases are not managed directly but through the Case Import API.
Versioning
For accept header versioning, the following media type and version are expected in the current VarFish version:
Accept: application/vnd.bihealth.varfish+json; version=0.23.9
Return Data
The return data for each request will be a JSON document unless otherwise specified.
If return data is not specified in the documentation of an API view, it will
return the appropriate HTTP status code along with an optional detail
JSON
field upon a successfully processed request.
For creation views, the sodar_uuid
of the created object is returned
along with other object fields.
Query Settings
The query follows a JSON Schema.
API Views
- class variants.views_api.CaseListApiView(**kwargs)[source]
List all cases in the current project.
URL:
/variants/api/case/{project.sodar_uid}/
Methods:
GET
Returns: List of project details (see
CaseRetrieveApiView
)
- class variants.views_api.CaseRetrieveApiView(**kwargs)[source]
Retrieve detail of the specified case.
URL:
/variants/api/case/{project.sodar_uuid}/{case.sodar_uuid}/
Methods:
GET
Returns:
date_created
- creation timestamp (ISO 8601str
)date_modified
- modification timestamp (ISO 8601str
)index
- index sample name (str
)name
- case name (str
)notes
- any notes related to case (str
ornull
)num_small_vars
- number of small variants (int
ornull
)num_svs
- number of structural variants (int
ornull
)pedigree
-list
ofdict
representing pedigree entries,dict
have keyssex
- PLINK-PED encoded biological sample sex (int
, 0-unknown, 1-male, 2-female)father
- father sample name (str
)mother
- mother sample name (str
)name
- current sample’s name (str
)affected
- PLINK-PED encoded affected state (int
, 0-unknown, 1-unaffected, 2-affected)has_gt_entries
- whether sample has genotype entries (boolean
)
project
- UUID of owning project (str
)release
- genome build (str
, one of["GRCh37", "GRCh37"]
)sodar_uuid
- case UUID (str
)status
- status of case (str
, one of"initial"
,"active"
,"closed-unsolved"
,"closed-uncertain"
,"closed-solved"
)tags
-list
ofstr
tags
- class variants.views_api.SmallVariantQueryListApiView(**kwargs)[source]
List small variant queries for the given Case.
URL:
/variants/api/query-case/list/{case.sodar_uuid}
Methods:
GET
Parameters:
page
- specify page to return (default/first is1
)page_size
– number of elements per page (default is10
, maximum is100
)
Returns:
count
- number of total elements (int
)next
- URL to next page (str
ornull
)previous
- URL to next page (str
ornull
)results
-list
of case small variant query details (seeSmallVariantQuery
)
- class variants.views_api.SmallVariantQueryCreateApiView(**kwargs)[source]
Create new small variant query for the given case.
URL:
/variants/api/query-case/create/{case.sodar_uuid}
Methods:
POST
Parameters:
form_id
: query settings form (str
, use"variants.small_variant_filter_form"
)form_version
: query settings version (int
, only valid:1
)query_settings
: the query settings (dict
, cf. Case Query Schema V1)name
: optional string (str
, defaults toNone
)public
: whether or not this query (settings) are public (bool
, defaults toFalse
)
Returns:
JSON serialization of case small variant query details (see
SmallVariantQuery
)
- class variants.views_api.SmallVariantQueryRetrieveApiView(**kwargs)[source]
Retrieve small variant query details for the qiven query.
URL:
/variants/api/query-case/retrieve/{query.sodar_uuid}
Methods:
GET
Parameters:
None
Returns:
JSON serialization of case small variant query details (see
SmallVariantQuery
)
- class variants.views_api.SmallVariantQueryStatusApiView(**kwargs)[source]
Returns the status of the small variant query.
URL:
/variants/api/query-case/status/{query.sodar_uuid}
Methods:
GET
Parameters:
None
Returns:
dict
with one keystatus
(str
)
- class variants.views_api.SmallVariantQueryUpdateApiView(**kwargs)[source]
Update small variant query for the qiven query.
URL:
/variants/api/query-case/update/{query.sodar_uuid}
Methods:
PUT
,PATCH
Parameters:
name
: new name attribute of the querypublic
: whether or not to make this query public
Returns:
JSON serialization of updated case small variant query details (see
SmallVariantQuery
)
- class variants.views_api.SmallVariantQueryFetchResultsApiView(*args, **kwargs)[source]
Fetch results for small variant query.
Will return a HTTP 400 if the results are not ready yet.
URL:
/variants/api/query-case/results/{query.sodar_uuid}
Methods:
GET
page
- specify page to return (default/first is1
)page_size
– number of elements per page (default is10
, maximum is100
)
Returns:
count
- number of total elements (int
)next
- URL to next page (str
ornull
)previous
- URL to next page (str
ornull
)results
-list
of results (dict
)
- class variants.views_api.SmallVariantQuerySettingsShortcutApiView(**kwargs)[source]
Generate query settings for a given case by certain shortcuts.
URL:
/variants/api/query-case/settings-shortcut/{case.uuid}
Methods:
GET
Parameters:
database
- the database to query, one of"refseq"
(default) and"ensembl"
quick_preset
- overall preset selection using the presets below, valid values aredefaults
- applies presets that are recommended for starting out without a specific hypothesisde_novo
- applies presets that are recommended for starting out when the hypothesis is dominannt inheritance with de novo variantsdominant
- applies presets that are recommended for starting out when the hypothesis is dominant inheritance (but not with de novo variants)homozygous_recessive
- applies presets that are recommended for starting out when the hypothesis is recessive with homzygous variantscompound_heterozygous
- applies presets that are recommended for starting out when the hypothesis is recessive with compound heterozygous variantsrecessive
- applies presets that are recommended for starting out when the hypothesis is recessive mode of inheritancex_recessive
- applies presets that are recommended for starting out when the hypothesis is X recessive mode of inheritanceclinvar_pathogenic
- apply presets that are recommended for screening variants for known pathogenic variants present Clinvarmitochondrial
- apply presets recommended for starting out to filter for mitochondrial mode of inheritancewhole_exomes
- apply presets that return all variants of the case, regardless of frequency, quality etc.
inheritance
- preset selection for mode of inheritance, valid values areany
- no particular constraint on inheritance (default)dominant
- allow variants compatible with dominant mode of inheritance (includes de novo variants)homozygous_recessive
- allow variants compatible with homozygous recessive mode of inheritancecompound_heterozygous
- allow variants compatible with compound heterozygous recessive mode of inheritancerecessive
- allow variants compatible with recessive mode of inheritance of a disease/trait (includes both homozygous and compound heterozygous recessive)x_recessive
- allow variants compatible with X_recessive mode of inheritance of a disease/traitmitochondrial
- mitochondrial inheritance (also applicable for “clinvar pathogenic”)custom
- indicates custom settings such that none of the above inheritance settings applies
frequency
- preset selection for frequencies, valid values aredominant_super_strict
- apply thresholds considered “very strict” in a dominant disease contextdominant_strict
- apply thresholds considered “strict” in a dominant disease context (default)dominant_relaxed
- apply thresholds considered “relaxed” in a dominant disease contextrecessive_strict
- apply thresholds considered “strict” in a recessiv disease contextrecessive_relaxed
- apply thresholds considered “relaxed” in a recessiv disease contextcustom
- indicates custom settings such that none of the above frequency settings applies
impact
- preset selection for molecular impact values, valid values arenull_variant
- allow variants that are predicted to be null variantsaa_change_splicing
- allow variants that are predicted to change the amino acid of the gene’s protein and also splicing variantsall_coding_deep_intronic
- allow all coding variants and also deeply intronic oneswhole_transcript
- allow variants from the whole transcript (exonic/intronic)any_impact
- allow any predicted molecular impactcustom
- indicates custom settings such that none of the above impact settings applies
quality
- preset selection for variant call quality values, valid values aresuper_strict
- very stricdt quality settingsstrict
- strict quality settings, used as the defaultrelaxed
- relaxed quality settingsany
- ignore quality, all variants pass filtercustom
- indicates custom settings such that none of the above quality settings applies
chromosomes
- preset selection for selecting chromosomes/regions/genes allow/block lists, valid values arewhole_genome
- the defaults settings selecting the whole genomeautosomes
- select the variants lying on the autosomes onlyx_chromosome
- select variants on the X chromosome onlyy_chromosome
- select variants on the Y chromosome onlymt_chromosome
- select variants on the mitochondrial chromosome onlycustom
- indicates custom settings such that none of the above chromosomes presets applies
flags_etc
- preset selection for “flags etc.” section, valid values aredefaults
- the defaults also used in the user interfaceclinvar_only
- select variants present in Clinvar onlyuser_flagged
- select user_flagged variants onlycustom
- indicates custom settings such that none of the above flags etc. presets apply
Returns:
presets
- adict
with the following keys; this mirrors back the quick presets and further presets selected in the parametersquick_presets
- one of thequick_presets
preset values from aboveinheritance
- one of theinheritance
preset values from abovefrequency
- one of thefrequency
preset values from aboveimpact
- one of theimpact
preset values from abovequality
- one of thequality
preset values from abovechromosomes
- one of thechromosomes
preset values from aboveflags_etc
- one of theflags_etc
preset values from above
query_settings
- adict
with the query settings ready to be used for the given case; this will follow Case Query Schema V1.