statgen / bravo_api

Server side data processing and retrieval endpoints for BRAVO
MIT License
1 stars 2 forks source link

CramSource get_info should return single dict instead of list with only one dict in it. #23

Open grosscol opened 1 year ago

grosscol commented 1 year ago

Issue or current state

The get_info method of the legacy sequences hander returned a list with a single dictionary in it. The CramSource class mirrors this behavior to keep the API the same.

Resolved when

Change made in CramSource and subclasses:

Corresponding issue made in Bravue project.

Note about Bravue

The relevant code in the UI is in src/components/Reads.vue. An issue will have to be filed there and the changes to the API reflected in the data processing on the UI side.

     .get(`${this.api}/variant/api/snv/cram/summary/${this.variant.variant_id}`)
      .then( response => {
        var result = response.data;
        if (result.data.length > 0) {
          var counts = result.data[0];
          this.counts.n_homs = counts.n_homozygous;
          this.counts.n_hets = counts.n_heterozygous;
        }
grosscol commented 1 year ago

Relevant function in api: https://github.com/statgen/bravo_api/blob/56623a783033de7919d7638420952f2ea399d93f/bravo_api/core/cram_source.py#L79-L88

called from: https://github.com/statgen/bravo_api/blob/56623a783033de7919d7638420952f2ea399d93f/bravo_api/core/fs_cram_source.py#L175-L177