varfish-org / varfish-server

VarFish: comprehensive DNA variant analysis for diagnostics and research
MIT License
43 stars 11 forks source link

[clinvar] Provide API endpoint for Variant Information Transfer #1163

Open xiamaz opened 11 months ago

xiamaz commented 11 months ago

We need to export Variant Information including Interpretation from Varfish into a database for bookkeeping and at some point for creation of reports.

This process is also currently used to create Clinvar uploads, at some point, this might be moved into Varfish, but for now a combined endpoint for all information could make this work reliably without a lot of additional work.

Requirements

The following information needs to be provided by the endpoint:

Current status

Currently this info can be obtained from a number of separate endpoints:

    case_info_url = "/variants/api/case/retrieve/{varfish_uuid}/"
    case_comment_url = "/cases/api/case-comment/list-create/{varfish_uuid}"
    smallvar_annos_url = "/variants/ajax/smallvariant/user-annotated-case/{varfish_uuid}"

    smallvar_flags_url = "/variants/api/small-variant-flags/list-create/{varfish_uuid}"
    smallvar_comment_url = "/variants/api/small-variant-comment/list-create/{varfish_uuid}/"
    smallvar_acmg_url = "/variants/api/acmg-criteria-rating/list-create/{varfish_uuid}/"
    smallvar_row_url = "/variants/api/query-result-row/retrieve/{smallvar_uuid}"

    mehari_url = "/proxy/varfish/mehari/tx/csq"

    svs_flags_url = "/svs/ajax/structural-variant-flags/list-create/{varfish_uuid}"
    svs_comment_url = "/svs/ajax/structural-variant-comment/list-create/{varfish_uuid}"
    svs_details_url = "/svs/sv-query-result-row/retrieve/{sv_uuid}"

These endpoints are partially internal and might be subject to change.

Proposed change

A new versioned API endpoint should be defined which allows for returning for a single varfish case all of the following information:

xiamaz commented 11 months ago

Currently the CaseUserAnnotatedVariantsAjaxView provides most information needed for small variants, but it still needs alt-transcript information from mehari.

A similar endpoint providing all needed info, currently does not exist for SVs. Best place should be cases/views_api.py for implementation. Pulling from mehari, might be considered, but should be discussed first and might need some changes to the mehari API to make it resonably performant.