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

Add Global Search and Global Beacon support #410

Merged
merged 22 commits into from Jan 14, 2022

Conversation

davecap
Copy link
Member

@davecap davecap commented Dec 10, 2021

closes #409

Description

Adding support:

  • Global Beacon functionality:
    • Toggle on/off global beacon for the dataset
    • Check Global Beacon indexing status
  • Global Search functionality
    • Low level search functionality, similar as there is on the Mesh web application (Global Search docs)
  • Example Jupiter notebooks files for demonstrating new functionality that is introduced:

Examples

  • Global Beacon
    # Dataset object
    dataset = solvebio.Object.retrieve(123456789)
    
    # Global Beacon functions
    dataset.enable_global_beacon()
    dataset.disable_global_beacon()
    dataset.get_global_beacon_status()
  • Global Seach
    # Advanced search
    advanced_query_results = GlobalSearch("fuji")
    
    # Entity search example
    GlobalSearch(entities=[["variant", "GRCH38-7-140753336-140753336-T"]])
    
    # Get list of subjects for the entity search
    GlobalSearch(entities=[["gene","BRCA2"]]).subjects()
    
    # Date range
    search = GlobalSearch()
    objects = search.filter(created_at__range=["2021-11-28","2021-12-28"])
    
    # Search for all datasets that are creted by the user Nikola
    f = Filter(type="dataset") & Filter(user="Nikola")
    results = GlobalSearch(filters=f)
    # Chaining function calls for filter, entity, subjects
    s = GlobalSearch()
    
    for result in s.entity(gene="BRCA2"):
        print(result['id'])
    
    # Get subjects with BRCA2 in public vault
    s.filter(vault="public").entity(gene="BRCA2").subjects()
    
    # Get subjects count with BRCA2 in public vault
    s.filter(vault="public").entity(gene="BRCA2").subjects_count()
    
    # Get all vaults with BRCA2 datasets
    s.entity(gene="BRCA2").facets("vault")

@krivi95 krivi95 self-assigned this Jan 12, 2022
solvebio/global_search.py Outdated Show resolved Hide resolved
solvebio/global_search.py Outdated Show resolved Hide resolved
solvebio/global_search.py Outdated Show resolved Hide resolved
solvebio/global_search.py Outdated Show resolved Hide resolved
@krivi95
Copy link
Contributor

krivi95 commented Jan 13, 2022

@davecap I'm going to approve this PR, as you're the one who created it and cannot approve it yourself.

I'm not going to merge it yet until everything is double-checked and resolved.

@krivi95 krivi95 self-requested a review January 13, 2022 16:34
solvebio/global_search.py Outdated Show resolved Hide resolved
@davecap
Copy link
Member Author

davecap commented Jan 13, 2022

LGTM!

@krivi95 krivi95 changed the title add toggle and status functions for global beacons Add Global Search and Global Beacon support Jan 14, 2022
@krivi95 krivi95 merged commit cb37420 into master Jan 14, 2022
@krivi95 krivi95 deleted the issue-409-global-beacon-basics branch January 14, 2022 08:59
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.

Add Global Beacon support
2 participants