Skip to content

Simplify queue logic in hgvs population script #580

@sallybg

Description

@sallybg

You could simplify this queue logic by building the strings up front and then batching the list with the batched function from mavedb/lib/utils.py.

In pseudocode, you would:

hgvs_strings = []
for mv in mapped_variants:
    append hgvs to hgvs_strings, warn on missing

for hgvs_batch in batched(hgvs_strings, 200):
    get_functional_consequence(hgvs_batch)
    existing logic ...

Implemented like this, we don't have to handle a half filled queue or worry about checking the queue length at all. We just generate the list of items we'd like to annotate, batch them, and handle all requests and results identically.

Originally posted by @bencap in #553 (comment)

Metadata

Metadata

Assignees

Labels

app: backendTask implementation touches the backendtype: enhancementEnhancement to an existing feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions