Skip to content

Allow field selection in variant info queries #108

@Lotriy

Description

@Lotriy

Description:
Currently, Mobidetails always returns the full set of variant annotations for every query. In many use cases we only need a handful of fields (e.g. gene, consequence, ClinVar status) and don’t want to fetch or process the entire payload each time.

Use case:
• A downstream service needs only HGVS, gene symbol and clinical significance for display.
• A batch script wants only allele frequency and impact score to prioritize variants.
• A biologist performing variant validation needs just the in-silico prediction scores (PolyPhen, SIFT, etc.) or the gnomAD population frequency.

Proposed solution:

Add an optional fields (or select) query parameter to the variant lookup endpoint, e.g.
GET /api/variant/chr1-12345-A-T?fields=hgvs,gene,clinvar
When fields is present, return only the requested keys in the JSON response; otherwise fall back to full output.
Support comma-separated lists and nested fields (e.g. annotations.impact,annotations.polyphen).
Benefits:
• Reduced payload sizes and faster response times for clients that don’t need all data.
• More flexible API tailored to diverse consumer needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions