def deprecated_retrieve_saved_variants_json(project, variant_tuples, create_if_missing): project_id = project.deprecated_project_id xbrowse_project = BaseProject.objects.get(project_id=project_id) user = User.objects.filter(is_staff=True).first( ) # HGMD annotations are only returned for staff users variants = get_variants_from_variant_tuples(xbrowse_project, variant_tuples, user=user) if not create_if_missing: variants = [ var for var in variants if not var.get_extra('created_variant') ] add_extra_info_to_variants_project(get_reference(), xbrowse_project, variants, add_populations=True) family_guids_by_id = { f.family_id: f.guid for f in Family.objects.filter(project=project) } individual_guids_by_id = { i.individual_id: i.guid for i in Individual.objects.filter(family__project=project) } return [ _variant_details(variant.toJSON(), family_guids_by_id, individual_guids_by_id) for variant in variants ]
def _deprecated_retrieve_saved_variants_json(project, variant_tuples, create_if_missing): project_id = project.deprecated_project_id xbrowse_project = BaseProject.objects.get(project_id=project_id) user = User.objects.filter(is_staff=True).first() # HGMD annotations are only returned for staff users variants = get_variants_from_variant_tuples(xbrowse_project, variant_tuples, user=user) if not create_if_missing: variants = [var for var in variants if not var.get_extra('created_variant')] add_extra_info_to_variants_project(get_reference(), xbrowse_project, variants, add_populations=True) return [variant.toJSON() for variant in variants]
def _deprecated_retrieve_saved_variants_json(project, variant_tuples, create_if_missing): project_id = project.deprecated_project_id xbrowse_project = BaseProject.objects.get(project_id=project_id) user = User.objects.filter(is_staff=True).first() # HGMD annotations are only returned for staff users variants = get_variants_from_variant_tuples(xbrowse_project, variant_tuples, user=user) if not create_if_missing: variants = [var for var in variants if not var.get_extra('created_variant')] add_extra_info_to_variants_project(get_reference(), xbrowse_project, variants, add_populations=True) return [variant.toJSON() for variant in variants]