Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] switch to parallel queries, and write intermediate dataframes to disk #522

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

akotlar
Copy link
Collaborator

@akotlar akotlar commented Jun 7, 2024

  • Switch get_annotation_result_from_query to parallel executor
  • Save memory by writing intermediate dataframes to disk, and reading in the data as memory mapped file

WIP. Tests still need to be written, and schema must be provided explicitly.

# Default behavior is to show 1 sample per row, e.g. `melt_samples=True`
query_result_df_array_of_structs_select_fields = get_annotation_result_from_query(
    query_string="cadd:>20",
    index_name=index_name,
    bystro_api_auth=user,
    fields=['refSeq.name2', 'refSeq.name', 'refSeq.exonicAlleleFunction', 'refSeq.siteType'],
    explode_field='refSeq.name2',
    tmp_dir='/mnt/ssd1/bystro/python/python/bystro/examples/tmp',
    output_path='foo'
)
query_result_df_array_of_structs_select_fields.head(n=10)

Here tmp_dir and output_path are optional. If these are not provided the intermediate files as well as the concatenated final table will be cleaned up after completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant