From 953453d1ce02d002d8b08990f6854f25ca26c759 Mon Sep 17 00:00:00 2001 From: Julia Klugherz Date: Thu, 23 Jan 2025 10:11:21 -0500 Subject: [PATCH] standardize pipeline options in Load Data UI (#4603) * fix load data dag parameters * s * a few more * pr comments * oops * more * order on ui --- seqr/utils/search/add_data_utils.py | 4 +++- seqr/views/apis/data_manager_api.py | 7 +++++-- ui/pages/DataManagement/components/LoadData.jsx | 6 ++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/seqr/utils/search/add_data_utils.py b/seqr/utils/search/add_data_utils.py index d910cb23bf..f2dcdcaf39 100644 --- a/seqr/utils/search/add_data_utils.py +++ b/seqr/utils/search/add_data_utils.py @@ -115,7 +115,7 @@ def format_loading_pipeline_variables( def prepare_data_loading_request(projects: list[Project], sample_type: str, dataset_type: str, genome_version: str, data_path: str, user: User, pedigree_dir: str, raise_pedigree_error: bool = False, - individual_ids: list[int] = None, skip_validation: bool = False): + individual_ids: list[int] = None, skip_validation: bool = False, skip_check_sex_and_relatedness: bool = False): variables = format_loading_pipeline_variables( projects, genome_version, @@ -125,6 +125,8 @@ def prepare_data_loading_request(projects: list[Project], sample_type: str, data ) if skip_validation: variables['skip_validation'] = True + if skip_check_sex_and_relatedness: + variables['skip_check_sex_and_relatedness'] = True file_path = _get_pedigree_path(pedigree_dir, genome_version, sample_type, dataset_type) _upload_data_loading_files(projects, user, file_path, individual_ids, raise_pedigree_error) return variables, file_path diff --git a/seqr/views/apis/data_manager_api.py b/seqr/views/apis/data_manager_api.py index 34bdc10cd6..9a7a6954b9 100644 --- a/seqr/views/apis/data_manager_api.py +++ b/seqr/views/apis/data_manager_api.py @@ -525,7 +525,6 @@ def load_data(request): request_json = json.loads(request.body) sample_type = request_json['sampleType'] dataset_type = request_json.get('datasetType', Sample.DATASET_TYPE_VARIANT_CALLS) - skip_validation = request_json.get('skipValidation', False) projects = [json.loads(project) for project in request_json['projects']] project_samples = {p['projectGuid']: p.get('sampleIds') for p in projects} @@ -537,7 +536,11 @@ def load_data(request): loading_args = ( project_models, sample_type, dataset_type, request_json['genomeVersion'], _callset_path(request_json), ) - loading_kwargs = {'user': request.user, 'skip_validation': skip_validation} + loading_kwargs = { + 'user': request.user, + 'skip_validation': request_json.get('skipValidation', False), + 'skip_check_sex_and_relatedness': request_json.get('skipSRChecks', False), + } if AirtableSession.is_airtable_enabled(): individual_ids = _get_valid_project_samples(project_samples, dataset_type, sample_type, request.user) success_message = f'*{request.user.email}* triggered loading internal {sample_type} {dataset_type} data for {len(projects)} projects' diff --git a/ui/pages/DataManagement/components/LoadData.jsx b/ui/pages/DataManagement/components/LoadData.jsx index e9ad6d7494..2048f9b986 100644 --- a/ui/pages/DataManagement/components/LoadData.jsx +++ b/ui/pages/DataManagement/components/LoadData.jsx @@ -97,6 +97,12 @@ const MULTI_DATA_TYPE_CALLSET_PAGE = { placeholder: 'gs://', ...FILE_PATH_FIELD, }, + { + name: 'skipSRChecks', + label: 'Skip Sex and Relatedness Checks', + component: InlineToggle, + asFormInput: true, + }, ...CALLSET_PAGE_FIELDS, { name: 'datasetType',