How to use the solvebio.Filter function in solvebio

To help you get started, we’ve selected a few solvebio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chop-dbhi / varify / varify / variants / resources.py View on Github external
# this variant then there is no benefit to including it.
            samples_with_variant = cv.cohort.samples.filter(
                results__variant=cv.variant)

            cohort_data['samples'] = serialize(samples_with_variant,
                                               **api.templates.SimpleSample)

            cohort_list.append(cohort_data)

        data['cohorts'] = cohort_list

        if SolveBio and SolveBio.is_enabled():
            data['solvebio'] = {}

            # ClinVar integration -- use position and HGVS
            filters = Filter(chromosome=variant.chr.value,
                             start__lte=variant.pos,
                             stop__gte=variant.pos)

            if hgvs_c_values:
                filters = filters | Filter(hgvs_c__in=list(hgvs_c_values))

            # TODO: add another clinvar query for reported gene-wide variants
            # if genes:
            #     filters = filters | Filter(gene_symbol__in=list(genes))

            try:
                # Query ClinVar by its alias, return 10 results/page
                # TODO: client-side pagination
                q = SolveBio.get_dataset('clinvar').query(
                    limit=10,  # limit to 10 results (single page)
                    filters=filters)
github chop-dbhi / varify / varify / variants / resources.py View on Github external
**api.templates.SimpleSample)

            cohort_list.append(cohort_data)

        data['cohorts'] = cohort_list

        if SolveBio and SolveBio.is_enabled():
            data['solvebio'] = {}

            # ClinVar integration -- use position and HGVS
            filters = Filter(chromosome=variant.chr.value,
                             start__lte=variant.pos,
                             stop__gte=variant.pos)

            if hgvs_c_values:
                filters = filters | Filter(hgvs_c__in=list(hgvs_c_values))

            # TODO: add another clinvar query for reported gene-wide variants
            # if genes:
            #     filters = filters | Filter(gene_symbol__in=list(genes))

            try:
                # Query ClinVar by its alias, return 10 results/page
                # TODO: client-side pagination
                q = SolveBio.get_dataset('clinvar').query(
                    limit=10,  # limit to 10 results (single page)
                    filters=filters)
                # Send the first page of results to the client
                data['solvebio']['clinvar'] = {
                    'results': q.results,
                    'total': q.total
                }

solvebio

The SolveBio Python client

MIT
Latest version published 1 month ago

Package Health Score

66 / 100
Full package analysis

Similar packages