Genomics¶
Endpoints de anotación de variantes y consulta de stores y perfiles.
POST /genomics/annotate¶
Recibe una lista de VariantAnnotation serializados, los pasa por el
pipeline de anotación seleccionado y devuelve las variantes anotadas.
Request body:
{
"variants": [ { "...VariantAnnotation serializado..." } ],
"profile": "clinical",
"add": ["cadd"],
"exclude": [],
"workers": 4
}
Response:
{
"variants": [ { "...VariantAnnotation anotado..." } ],
"total": 1234,
"stores_applied": ["clinvar", "mcps_af", "loftee"]
}
Ejemplo completo¶
import httpx
from iris.adapters.driven.serializers.variant import converter
from iris.domain.genomics.entities import VariantAnnotation
variants: list[VariantAnnotation] = [...]
response = httpx.post(
"http://localhost:8000/genomics/annotate",
json={
"variants": [converter.unstructure(va) for va in variants],
"profile": "clinical",
"workers": 8,
},
)
result = response.json()
annotated = [converter.structure(v, VariantAnnotation) for v in result["variants"]]
GET /genomics/stores¶
Devuelve todos los stores registrados con su estado de disponibilidad.
Response:
[
{ "name": "clinvar", "kind": "annotator+region", "available": true },
{ "name": "mcps_af", "kind": "annotator+region", "available": true },
{ "name": "loftee", "kind": "annotator", "available": false },
{ "name": "gencode", "kind": "gene", "available": true }
]
GET /genomics/profiles¶
Devuelve los perfiles definidos en profiles.toml.
Response:
[
{ "name": "clinical", "stores": ["clinvar", "mcps_af", "loftee"] },
{ "name": "research", "stores": ["clinvar", "mcps_af", "cadd", "dbnsfp", "loftee"] },
{ "name": "minimal", "stores": ["clinvar", "mcps_af"] },
{ "name": "gene_view", "stores": ["clinvar", "loftee"] }
]
Referencia¶
iris.applications.api.routers.genomics
¶
Genomics API router — variant annotation pipeline.
annotate
async
¶
Annotate a list of VariantAnnotation objects through a configurable store pipeline.
The pipeline is resolved as:
profile stores (in profile order) + add stores − exclude stores
| PARAMETER | DESCRIPTION |
|---|---|
body
|
JSON object with keys:
-
TYPE:
|
Source code in src/iris/applications/api/routers/genomics.py
stores
async
¶
Return all registered stores with their availability status.
Source code in src/iris/applications/api/routers/genomics.py
profiles
async
¶
Return all annotation profiles with their store lists.
Source code in src/iris/applications/api/routers/genomics.py
iris.applications.api.stores
¶
Store registries and profile resolution for the iris API.
Three registries¶
AnnotatorRegistry name → VariantAnnotator (annotate list[VariantAnnotation]) RegionRegistry name → McpsAFAnnotator (query_region → list[VariantAnnotation]) GeneRegistry name → GencodeGeneRepository (get_annotation → GeneAnnotation)
All registries are built lazily at first access and cached for the lifetime
of the process. A store whose configured path is empty or missing is
registered as available=False and raises HTTPException(503) when
called.
StoreInfo
dataclass
¶
Metadata about a registered store.
resolve_stores
¶
Return the ordered list of store names for a request.
Final order: profile stores (profile order) + add stores, minus any names in exclude.
Source code in src/iris/applications/api/stores.py
get_annotator_registry
cached
¶
Return the cached annotator registry (built once at first call).
get_region_registry
cached
¶
get_gene_registry
cached
¶
get_profiles
cached
¶
require_annotator
¶
Return the annotator for name, or raise 503/422.
Source code in src/iris/applications/api/stores.py
require_region_store
¶
Return the region store for name, or raise 503/422.
Source code in src/iris/applications/api/stores.py
require_gene_source
¶
Return the gene source for name, or raise 503/422.
Source code in src/iris/applications/api/stores.py
list_store_info
¶
Return metadata for all registered stores across all registries.