Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# 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)
**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
}