Skip to content

Commit

Permalink
standardize pipeline options in Load Data UI (#4603)
Browse files Browse the repository at this point in the history
* fix load data dag parameters

* s

* a few more

* pr comments

* oops

* more

* order on ui
  • Loading branch information
jklugherz authored Jan 23, 2025
1 parent cc9e7f8 commit 953453d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion seqr/utils/search/add_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions seqr/views/apis/data_manager_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions ui/pages/DataManagement/components/LoadData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 953453d

Please sign in to comment.