diff --git a/app/api/models/resolver.py b/app/api/models/resolver.py index c126277..c07c83f 100644 --- a/app/api/models/resolver.py +++ b/app/api/models/resolver.py @@ -1,4 +1,4 @@ -from typing import Optional, Literal, List +from typing import Optional, Literal, List, Dict from pydantic import BaseModel, Field @@ -31,7 +31,8 @@ class MetadataResult(BaseModel): assembly: Assembly scientific_name: str common_name: str - type: Optional[str] = None + type: Optional[Dict[str, str]] = None + is_reference: bool = False class ResolvedPayload(MetadataResult): diff --git a/app/api/resources/templates/search_results.html b/app/api/resources/templates/search_results.html index 07aba1f..ca0381f 100644 --- a/app/api/resources/templates/search_results.html +++ b/app/api/resources/templates/search_results.html @@ -21,8 +21,17 @@

Resolved URLs

{{ item.assembly.accession_id }} {{ item.scientific_name }} {{ item.common_name }} - {{ item.species }} - {{ item.type }} + + {% if item.type and item.is_reference %} + {{ item.type.kind }} - {{ item.type.value }}, Reference + {% elif item.is_reference %} + Reference + {% elif item.type %} + {{ item.type.kind }} - {{ item.type.value }} + {% else %} + - + {% endif %} + Ensembl diff --git a/app/static/APISpecification.yaml b/app/static/APISpecification.yaml index 638da11..d5a5a1c 100644 --- a/app/static/APISpecification.yaml +++ b/app/static/APISpecification.yaml @@ -87,6 +87,9 @@ paths: resolved_url: type: string description: Resolved url to Ensembl site + is_reference: + type: boolean + description: Whether a genome is reference or not '302': description: Redirect to resolved URL headers: diff --git a/requirements-dev.txt b/requirements-dev.txt index 78395dd..e93212e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ -r requirements.txt -pre-commit=3.8.0 -black=24.8.0 -flake8==7.1.1 +pre-commit==3.8.0 +black==24.8.0