def _get_project_child_entities(project, user): families_by_guid = _retrieve_families(project.guid, user) individuals_by_guid = _retrieve_individuals(project.guid, user) for individual_guid, individual in individuals_by_guid.items(): families_by_guid[individual['familyGuid']]['individualGuids'].add(individual_guid) samples_by_guid = _retrieve_samples(project.guid, individuals_by_guid) analysis_groups_by_guid = _retrieve_analysis_groups(project) locus_lists = get_sorted_project_locus_lists(project, user) locus_lists_by_guid = {locus_list['locusListGuid']: locus_list for locus_list in locus_lists} return families_by_guid, individuals_by_guid, samples_by_guid, analysis_groups_by_guid, locus_lists_by_guid
def delete_project_locus_lists(request, project_guid): project = get_project_and_check_permissions(project_guid, request.user, CAN_EDIT) request_json = json.loads(request.body) locus_lists = LocusList.objects.filter( guid__in=request_json['locusListGuids']) for locus_list in locus_lists: remove_perm(user_or_group=project.can_view_group, perm=CAN_VIEW, obj=locus_list) return create_json_response({ 'locusListGuids': [ locus_list['locusListGuid'] for locus_list in get_sorted_project_locus_lists( project, request.user) ], })
def _get_project_child_entities(project, user): families_by_guid = _retrieve_families(project.guid, user) individuals_by_guid, individual_models = _retrieve_individuals(project.guid, user) for individual_guid, individual in individuals_by_guid.items(): families_by_guid[individual['familyGuid']]['individualGuids'].add(individual_guid) samples_by_guid = _retrieve_samples(project.guid, individuals_by_guid, individual_models) mme_submissions_by_guid = _retrieve_mme_submissions(individuals_by_guid, individual_models) analysis_groups_by_guid = _retrieve_analysis_groups(project) locus_lists = get_sorted_project_locus_lists(project, user) locus_lists_by_guid = {locus_list['locusListGuid']: locus_list for locus_list in locus_lists} return { 'familiesByGuid': families_by_guid, 'individualsByGuid': individuals_by_guid, 'samplesByGuid': samples_by_guid, 'locusListsByGuid': locus_lists_by_guid, 'analysisGroupsByGuid': analysis_groups_by_guid, 'mmeSubmissionsByGuid': mme_submissions_by_guid, }