Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# 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
}
except SolveError as e:
log.exception('SolveBio ClinVar query failed: {0}'.format(e))
data['genome_version'] = GENOME_VERSION
return data