From 9874e636488ff78eace1ea6fcf590adeeebcd8dd Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Sat, 28 Sep 2024 08:28:42 -0400 Subject: [PATCH] Replace restricted confound sets with config files (#1255) --- .circleci/config.yml | 41 +- docs/outputs.rst | 7 +- docs/usage.rst | 108 ++- docs/workflows.rst | 146 +++- xcp_d/cli/parser.py | 102 ++- xcp_d/cli/parser_utils.py | 49 ++ xcp_d/cli/run.py | 1 - xcp_d/cli/workflow.py | 17 +- xcp_d/config.py | 17 +- xcp_d/data/nuisance/24P.yml | 44 + xcp_d/data/nuisance/27P.yml | 48 ++ xcp_d/data/nuisance/36P.yml | 57 ++ xcp_d/data/nuisance/acompcor.yml | 38 + xcp_d/data/nuisance/acompcor_gsr.yml | 42 + xcp_d/data/nuisance/aroma.yml | 33 + xcp_d/data/nuisance/aroma_gsr.yml | 33 + xcp_d/data/nuisance/gsr_only.yml | 17 + xcp_d/data/nuisance/rapidtide+24P.yml | 53 ++ xcp_d/data/tests/config.toml | 6 +- xcp_d/interfaces/censoring.py | 766 ++++++++++++------ xcp_d/interfaces/concatenation.py | 37 +- xcp_d/interfaces/nilearn.py | 35 +- xcp_d/interfaces/plotting.py | 44 +- xcp_d/interfaces/utils.py | 31 +- xcp_d/tests/conftest.py | 36 +- xcp_d/tests/data/ds001419_nifti_filter.json | 2 +- .../data/test_ds001419_cifti_outputs.txt | 26 +- .../data/test_ds001419_nifti_outputs.txt | 92 +-- xcp_d/tests/data/test_pnc_cifti_outputs.txt | 4 +- .../data/test_pnc_cifti_t2wonly_outputs.txt | 4 +- xcp_d/tests/data/test_ukbiobank_outputs.txt | 4 +- xcp_d/tests/test_TR.py | 195 ----- xcp_d/tests/test_cli.py | 60 +- xcp_d/tests/test_cli_run.py | 39 +- xcp_d/tests/test_interfaces_censoring.py | 425 +++++++++- xcp_d/tests/test_interfaces_concatenation.py | 26 +- xcp_d/tests/test_interfaces_nilearn.py | 26 +- xcp_d/tests/test_utils_bids.py | 40 +- xcp_d/tests/test_utils_boilerplate.py | 128 +-- xcp_d/tests/test_utils_confounds.py | 158 +--- xcp_d/tests/test_utils_execsummary.py | 2 +- xcp_d/tests/test_utils_plotting.py | 8 +- xcp_d/tests/test_utils_utils.py | 72 +- xcp_d/tests/test_utils_write_save.py | 2 +- xcp_d/tests/utils.py | 19 +- xcp_d/utils/bids.py | 205 ++++- xcp_d/utils/boilerplate.py | 146 +--- xcp_d/utils/confounds.py | 296 +------ xcp_d/utils/doc.py | 15 +- xcp_d/utils/modified_data.py | 23 +- xcp_d/utils/plotting.py | 11 +- xcp_d/workflows/base.py | 18 +- xcp_d/workflows/bold/cifti.py | 60 +- xcp_d/workflows/bold/concatenation.py | 28 +- xcp_d/workflows/bold/connectivity.py | 6 +- xcp_d/workflows/bold/nifti.py | 63 +- xcp_d/workflows/bold/outputs.py | 63 +- xcp_d/workflows/bold/plotting.py | 16 +- xcp_d/workflows/bold/postprocessing.py | 182 +++-- 59 files changed, 2437 insertions(+), 1835 deletions(-) create mode 100644 xcp_d/data/nuisance/24P.yml create mode 100644 xcp_d/data/nuisance/27P.yml create mode 100644 xcp_d/data/nuisance/36P.yml create mode 100644 xcp_d/data/nuisance/acompcor.yml create mode 100644 xcp_d/data/nuisance/acompcor_gsr.yml create mode 100644 xcp_d/data/nuisance/aroma.yml create mode 100644 xcp_d/data/nuisance/aroma_gsr.yml create mode 100644 xcp_d/data/nuisance/gsr_only.yml create mode 100644 xcp_d/data/nuisance/rapidtide+24P.yml delete mode 100644 xcp_d/tests/test_TR.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d9a23be6..63d28e08a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,21 +40,38 @@ jobs: steps: - checkout - restore_cache: - key: ds001419-fmriprep-08 + key: ds001419-10 - run: *runinstall - run: - name: Download ds001419-fmriprep test data + name: Download ds001419 fMRIPrep test data command: | cd /src/xcp_d/.circleci python get_data.py $PWD/data ds001419 - save_cache: - key: ds001419-fmriprep-08 + key: ds001419-10 paths: - - /src/xcp_d/.circleci/data/ds001419-fmriprep + - /src/xcp_d/.circleci/data/ds001419 # The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass # Why do we need a big executor for this job? resource_class: large + download_data_ds001419_aroma: + <<: *dockersetup + steps: + - checkout + - restore_cache: + key: ds001419-aroma-02 + - run: *runinstall + - run: + name: Download ds001419 fMRIPost-AROMA test data + command: | + cd /src/xcp_d/.circleci + python get_data.py $PWD/data ds001419-aroma + - save_cache: + key: ds001419-aroma-02 + paths: + - /src/xcp_d/.circleci/data/ds001419-aroma + download_data_pnc: <<: *dockersetup steps: @@ -227,7 +244,9 @@ jobs: circleci step halt fi - restore_cache: - key: ds001419-fmriprep-08 + key: ds001419-10 + - restore_cache: + key: ds001419-aroma-02 - run: *runinstall - run: name: Run full xcp_d on nifti with freesurfer @@ -269,7 +288,7 @@ jobs: circleci step halt fi - restore_cache: - key: ds001419-fmriprep-08 + key: ds001419-10 - run: *runinstall - run: name: Run full xcp_d on cifti with freesurfer @@ -481,7 +500,7 @@ jobs: - restore_cache: key: pnc-02 - restore_cache: - key: ds001419-fmriprep-08 + key: ds001419-10 - restore_cache: key: fmriprepwithoutfreesurfer-03 - restore_cache: @@ -594,6 +613,13 @@ workflows: tags: only: /.*/ + - download_data_ds001419_aroma: + requires: + - build + filters: + tags: + only: /.*/ + - download_data_pnc: requires: - build @@ -658,6 +684,7 @@ workflows: - ds001419_nifti: requires: - download_data_ds001419 + - download_data_ds001419_aroma filters: branches: ignore: diff --git a/docs/outputs.rst b/docs/outputs.rst index 9baab309b..98f086068 100644 --- a/docs/outputs.rst +++ b/docs/outputs.rst @@ -315,14 +315,15 @@ Other outputs include quality control, framewise displacement, and confounds fil sub-