From a4a4618a6e595f4c3161339753264e5efba30a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Cl=C3=A9net?= Date: Fri, 21 Jun 2024 17:50:37 +0200 Subject: [PATCH 1/2] Updating 2T6S notebook [skip ci] --- docs/environment.md | 3 +- examples/notebooks/reproduction_2T6S.ipynb | 161 ++++++++------------- setup.py | 5 +- 3 files changed, 65 insertions(+), 104 deletions(-) diff --git a/docs/environment.md b/docs/environment.md index 31c029b4..5305f3e9 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -33,10 +33,11 @@ docker run -it \ Then, from inside the container : ```bash +pip install .[examples] jupyter notebook --port=8888 --no-browser --ip=0.0.0.0 ``` -You can now access Jupyter using the address provided by the command line. +You can now access Jupyter using the address provided by the jupyter command line. > [!NOTE] > Find useful information on the [Docker documentation page](https://docs.docker.com/get-started/). Here is a [cheat sheet with Docker commands](https://docs.docker.com/get-started/docker_cheatsheet.pdf) diff --git a/examples/notebooks/reproduction_2T6S.ipynb b/examples/notebooks/reproduction_2T6S.ipynb index b7b74a18..5a3dcf63 100755 --- a/examples/notebooks/reproduction_2T6S.ipynb +++ b/examples/notebooks/reproduction_2T6S.ipynb @@ -13,112 +13,68 @@ "id": "digital-murray", "metadata": {}, "source": [ - "This notebook reproduce the analysis made by team **2T6S** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n", + "This notebook reproduces the analysis made by team **2T6S** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n", "\n", "**To use this notebook :** \n", - "- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n", + "- Follow the [instructions](https://github.com/Inria-Empenn/narps_open_pipelines/blob/main/INSTALL.md) to get the input data (only derivatives are needed.\n", "- Modify the paths:\n", - " - **exp_dir**: directory where the ds001734-download repository is stored\n", - " - **result_dir**: directory where the intermediate and final repositories will be stored\n", - " - **working_dir**: name of the directory where intermediate results will be stored\n", - " - **output_dir**: name of the directory where final results will be stored\n", - "\n", - "Botvinik-Nezer, R., Holzmeister, F., Camerer, C.F., Dreber, A., Huber, J., Johannesson, M., Kirchler, M., Iwanir, R., Mumford, J.A., ..., Nichols, T.E., Poldrack, R.A., Schonberg, T. (2020). Variability in the analysis of a single neuroimaging dataset by many teams. Nature. https://doi.org/10.1038/s41586-020-2314-9." + " - `dataset_dir`: directory where the ds001734 repository is stored\n", + " - `result_dir`: directory where the intermediate and final results will be stored\n", + "- Select the number of cores on which you want to run the analysis (`nb_cores`)" ] }, { "cell_type": "code", - "execution_count": null, - "id": "satellite-launch", - "metadata": {}, - "outputs": [], - "source": [ - "# Set the path to matlab \n", - "## NECESSARY TO USE SPM\n", - "from nipype.interfaces import spm\n", - "matlab_cmd = '/opt/spm12-r7771/run_spm12.sh /opt/matlabmcr-2010a/v713/ script'\n", - "spm.SPMCommand.set_mlab_paths(matlab_cmd=matlab_cmd, use_mcr=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 1, + "execution_count": 6, "id": "digital-intention", "metadata": {}, "outputs": [], "source": [ - "from narps_open.pipelines import team_2T6S\n", - "\n", - "from os.path import join as opj\n", - "import os\n", - "import json" + "from os.path import isfile\n", + "from narps_open.pipelines.team_2T6S import PipelineTeam2T6S" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "id": "occasional-rotation", "metadata": {}, "outputs": [], "source": [ - "team_ID = \"2T6S\"\n", - "# Important directories\n", - "## exp_dir : where the data are stored (where the ds001734 directory is stored)\n", - "exp_dir = '../data/original'\n", - "\n", - "## result_dir : where the intermediate and final results will be store\n", - "result_dir = \"../data/derived/reproduced\"\n", - "\n", - "## working_dir : where the intermediate outputs will be store\n", - "working_dir = f\"NARPS-{team_ID}-reproduced/intermediate_results\"\n", - "\n", - "## output_dir : where the final results will be store\n", - "output_dir = f\"NARPS-{team_ID}-reproduced\"" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "systematic-worry", - "metadata": {}, - "outputs": [], - "source": [ - "dir_list = os.listdir(exp_dir)" + "# Change these values if needed\n", + "dataset_dir = '/work/data/original'\n", + "results_dir = '/work/data/reproduced'\n", + "nb_cores = 2" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 3, "id": "separate-trade", "metadata": {}, "outputs": [], "source": [ "# Subject list (to which we will do the analysis)\n", - "subject_list = []\n", - "for dirs in dir_list:\n", - " if dirs[0:3] == 'sub':\n", - " subject_list.append(dirs[-3:])" + "subject_list = ['020', '001', '070', '013']\n", + "\n", + "# Runs to use for this analysis\n", + "run_list = ['01', '02', '03', '04']" ] }, { "cell_type": "code", "execution_count": 8, - "id": "convenient-virus", + "id": "83180b3e-bd2c-456b-93d9-90aa702378eb", "metadata": {}, "outputs": [], "source": [ - "subject_list=['001']\n", - "n_sub = len(subject_list)\n", - "# Run to use for this analysis\n", - "run_list = ['01', '02', '03', '04']\n", - "\n", - "#TR\n", - "with open(opj(exp_dir, 'task-MGT_bold.json'), 'rt') as fp:\n", - " task_info = json.load(fp)\n", - "TR = task_info['RepetitionTime']\n", - "\n", - "#FWHM to smooth (team chose a kernel of 8mm for smoothing)\n", - "fwhm = 8" + "pipeline = PipelineTeam2T6S()\n", + "pipeline.subject_list = subject_list\n", + "pipeline.run_list = run_list\n", + "pipeline.directories.dataset_dir = dataset_dir\n", + "pipeline.directories.results_dir = results_dir\n", + "pipeline.directories.set_output_dir_with_team_id('2T6S')\n", + "pipeline.directories.set_working_dir_with_team_id('2T6S')" ] }, { @@ -136,8 +92,7 @@ "metadata": {}, "outputs": [], "source": [ - "l1_analysis = team_2T6S.get_l1_analysis(subject_list, TR, fwhm, run_list, exp_dir, \n", - " result_dir, working_dir, output_dir)" + "subject_level_analysis = pipeline.get_subject_level_analysis()" ] }, { @@ -149,7 +104,7 @@ }, "outputs": [], "source": [ - "l1_analysis.run('MultiProc', plugin_args={'n_procs': 2})" + "subject_level_analysis.run('MultiProc', plugin_args = {'n_procs': nb_cores})" ] }, { @@ -163,85 +118,87 @@ { "cell_type": "code", "execution_count": null, - "id": "intimate-upgrade", + "id": "silent-twist", "metadata": {}, "outputs": [], "source": [ - "contrast_list = ['01', '02', '03', '04']" + "# Get workflows for the group level analyses in the equalIndifference (ei) equalRange (er) and group comparison (gc) cases\n", + "group_level_analysis_ei, group_level_analysis_er, group_level_analysis_gc = pipeline.get_group_level_analysis()" ] }, { "cell_type": "code", "execution_count": null, - "id": "silent-twist", + "id": "champion-chess", "metadata": {}, "outputs": [], "source": [ - "l2_analysis_equal_indiff = team_2T6S.get_l2_analysis(subject_list, n_sub, contrast_list, \"equalIndifference\", \n", - " exp_dir, result_dir, working_dir, output_dir)" + "group_level_analysis_ei.run('MultiProc', plugin_args = {'n_procs': nb_cores})" ] }, { "cell_type": "code", "execution_count": null, - "id": "champion-chess", + "id": "rolled-fairy", "metadata": {}, "outputs": [], "source": [ - "l2_analysis_equal_indiff.run('MultiProc', plugin_args={'n_procs': 8})" + "group_level_analysis_er.run('MultiProc', plugin_args = {'n_procs': nb_cores})" ] }, { "cell_type": "code", "execution_count": null, - "id": "rolled-fairy", + "id": "reduced-portugal", "metadata": {}, "outputs": [], "source": [ - "l2_analysis_equal_range = team_2T6S.get_l2_analysis(subject_list, n_sub, contrast_list, \"equalRange\", \n", - " exp_dir, result_dir, working_dir, output_dir)" + "group_level_analysis_gc.run('MultiProc', plugin_args = {'n_procs': nb_cores})" ] }, { - "cell_type": "code", - "execution_count": null, - "id": "reduced-portugal", + "cell_type": "markdown", + "id": "216140b0-f15e-4e18-80d4-8552d887c249", "metadata": {}, - "outputs": [], "source": [ - "l2_analysis_equal_range.run('MultiProc', plugin_args={'n_procs': 2})" + "## Check results" ] }, { "cell_type": "code", - "execution_count": null, - "id": "powered-agent", + "execution_count": 10, + "id": "05dc2724-6e68-4158-9103-535275297486", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalIndifference_nsub_4/_contrast_id_0002/_threshold0/spmT_0001_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalIndifference_nsub_4/_contrast_id_0002/spmT_0001.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalRange_nsub_4/_contrast_id_0002/_threshold0/spmT_0001_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalRange_nsub_4/_contrast_id_0002/spmT_0001.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalIndifference_nsub_4/_contrast_id_0002/_threshold0/spmT_0001_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalIndifference_nsub_4/_contrast_id_0002/spmT_0001.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalRange_nsub_4/_contrast_id_0002/_threshold0/spmT_0001_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalRange_nsub_4/_contrast_id_0002/spmT_0001.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalIndifference_nsub_4/_contrast_id_0003/_threshold0/spmT_0001_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalIndifference_nsub_4/_contrast_id_0003/spmT_0001.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalRange_nsub_4/_contrast_id_0003/_threshold1/spmT_0002_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalRange_nsub_4/_contrast_id_0003/spmT_0002.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalIndifference_nsub_4/_contrast_id_0003/_threshold0/spmT_0001_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalIndifference_nsub_4/_contrast_id_0003/spmT_0001.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalRange_nsub_4/_contrast_id_0003/_threshold1/spmT_0002_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_equalRange_nsub_4/_contrast_id_0003/spmT_0002.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_groupComp_nsub_4/_contrast_id_0003/_threshold0/spmT_0001_thr.nii', '/work/data/reproduced/NARPS-2T6S-reproduced/l2_analysis_groupComp_nsub_4/_contrast_id_0003/spmT_0001.nii']\n" + ] + } + ], "source": [ - "l2_analysis_groupcomp = team_2T6S.get_l2_analysis(subject_list, n_sub, contrast_list, \"groupComp\", \n", - " exp_dir, result_dir, working_dir, output_dir)" + "# Print the list of non existing hypotheses files\n", + "hypothesis_files = pipeline.get_hypotheses_outputs()\n", + "print([f for f in hypothesis_files if not isfile(f)])" ] }, { "cell_type": "code", "execution_count": null, - "id": "abstract-charger", + "id": "13cee529-aea0-408f-9992-2004f41c26b7", "metadata": {}, "outputs": [], - "source": [ - "l2_analysis_groupcomp.run('MultiProc', plugin_args={'n_procs': 8})" - ] + "source": [] }, { "cell_type": "code", "execution_count": null, - "id": "convenient-idaho", + "id": "56270182-17a6-41e9-95d8-5b1076933751", "metadata": {}, "outputs": [], - "source": [ - "pipelines_2T6S.reorganize_results(result_dir, output_dir, n_sub, team_ID)" - ] + "source": [] } ], "metadata": { @@ -260,7 +217,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.8.15" } }, "nbformat": 4, diff --git a/setup.py b/setup.py index e3c65bb0..d2884309 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,10 @@ 'pytest-helpers-namespace>=2021.12.29,<2021.13', 'pytest-mock>=3.12.0,<3.13', 'checksumdir>=1.2.0,<1.3' - ] + ], + 'examples': [ + 'notebook>=7.2.1,<7.3' + ] } setup( From 78698c495458edec50a1c0f27090850f08e0cd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Cl=C3=A9net?= Date: Mon, 24 Jun 2024 09:08:50 +0200 Subject: [PATCH 2/2] Paths in 2T6S notebook [skip ci] --- examples/notebooks/reproduction_2T6S.ipynb | 226 ++++++++++++++++++++- 1 file changed, 216 insertions(+), 10 deletions(-) diff --git a/examples/notebooks/reproduction_2T6S.ipynb b/examples/notebooks/reproduction_2T6S.ipynb index 5a3dcf63..6fc8e979 100755 --- a/examples/notebooks/reproduction_2T6S.ipynb +++ b/examples/notebooks/reproduction_2T6S.ipynb @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 1, "id": "digital-intention", "metadata": {}, "outputs": [], @@ -42,8 +42,8 @@ "outputs": [], "source": [ "# Change these values if needed\n", - "dataset_dir = '/work/data/original'\n", - "results_dir = '/work/data/reproduced'\n", + "dataset_dir = '/work/data/original/ds001734/'\n", + "results_dir = '/work/run/reproduced/'\n", "nb_cores = 2" ] }, @@ -63,7 +63,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 4, "id": "83180b3e-bd2c-456b-93d9-90aa702378eb", "metadata": {}, "outputs": [], @@ -87,22 +87,195 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "continental-waterproof", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "stty: 'standard input': Inappropriate ioctl for device\n" + ] + } + ], "source": [ "subject_level_analysis = pipeline.get_subject_level_analysis()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "pleasant-jacksonville", "metadata": { "scrolled": true }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "240624-07:04:03,203 nipype.workflow INFO:\n", + "\t Workflow l1_analysis settings: ['check', 'execution', 'logging', 'monitoring']\n", + "240624-07:04:03,244 nipype.workflow INFO:\n", + "\t Running in parallel.\n", + "240624-07:04:03,303 nipype.workflow INFO:\n", + "\t [MultiProc] Running 0 tasks, and 5 jobs ready. Free memory (GB): 13.77/13.77, Free processors: 2/2.\n", + "240624-07:04:03,380 nipype.workflow INFO:\n", + "\t [Job 0] Cached (l1_analysis.contrasts).\n", + "240624-07:04:03,415 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.selectfiles\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_020/selectfiles\".\n", + "240624-07:04:03,427 nipype.workflow INFO:\n", + "\t [Node] Executing \"selectfiles\" \n", + "240624-07:04:03,703 nipype.workflow INFO:\n", + "\t [Node] Finished \"selectfiles\", elapsed time 0.271548s.\n", + "240624-07:04:05,306 nipype.workflow INFO:\n", + "\t [Job 1] Completed (l1_analysis.selectfiles).\n", + "240624-07:04:05,311 nipype.workflow INFO:\n", + "\t [MultiProc] Running 0 tasks, and 6 jobs ready. Free memory (GB): 13.77/13.77, Free processors: 2/2.\n", + "240624-07:04:05,412 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.selectfiles\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_001/selectfiles\".\n", + "240624-07:04:05,415 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.selectfiles\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_070/selectfiles\".\n", + "240624-07:04:05,420 nipype.workflow INFO:\n", + "\t [Node] Executing \"selectfiles\" \n", + "240624-07:04:05,421 nipype.workflow INFO:\n", + "\t [Node] Executing \"selectfiles\" \n", + "240624-07:04:05,628 nipype.workflow INFO:\n", + "\t [Node] Finished \"selectfiles\", elapsed time 0.204118s.\n", + "240624-07:04:05,653 nipype.workflow INFO:\n", + "\t [Node] Finished \"selectfiles\", elapsed time 0.22915s.\n", + "240624-07:04:07,306 nipype.workflow INFO:\n", + "\t [Job 2] Completed (l1_analysis.selectfiles).\n", + "240624-07:04:07,309 nipype.workflow INFO:\n", + "\t [Job 3] Completed (l1_analysis.selectfiles).\n", + "240624-07:04:07,311 nipype.workflow INFO:\n", + "\t [MultiProc] Running 0 tasks, and 13 jobs ready. Free memory (GB): 13.77/13.77, Free processors: 2/2.\n", + "240624-07:04:07,378 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.parameters\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_020/parameters\".\n", + "240624-07:04:07,378 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.selectfiles\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_013/selectfiles\".\n", + "240624-07:04:07,384 nipype.workflow INFO:\n", + "\t [Node] Executing \"selectfiles\" \n", + "240624-07:04:07,386 nipype.workflow INFO:\n", + "\t [Node] Executing \"parameters\" \n", + "240624-07:04:07,590 nipype.workflow INFO:\n", + "\t [Node] Finished \"selectfiles\", elapsed time 0.202247s.\n", + "240624-07:04:08,389 nipype.workflow INFO:\n", + "\t [Node] Finished \"parameters\", elapsed time 1.000086s.\n", + "240624-07:04:09,307 nipype.workflow INFO:\n", + "\t [Job 4] Completed (l1_analysis.selectfiles).\n", + "240624-07:04:09,310 nipype.workflow INFO:\n", + "\t [Job 5] Completed (l1_analysis.parameters).\n", + "240624-07:04:09,313 nipype.workflow INFO:\n", + "\t [MultiProc] Running 0 tasks, and 20 jobs ready. Free memory (GB): 13.77/13.77, Free processors: 2/2.\n", + "240624-07:04:09,379 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.subject_infos\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_020/subject_infos\".\n", + "240624-07:04:09,379 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.parameters\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_001/parameters\".\n", + "240624-07:04:09,386 nipype.workflow INFO:\n", + "\t [Node] Executing \"subject_infos\" \n", + "240624-07:04:09,387 nipype.workflow INFO:\n", + "\t [Node] Executing \"parameters\" \n", + "240624-07:04:09,650 nipype.workflow INFO:\n", + "\t [Node] Finished \"subject_infos\", elapsed time 0.260735s.\n", + "240624-07:04:09,870 nipype.workflow INFO:\n", + "\t [Node] Finished \"parameters\", elapsed time 0.480165s.\n", + "240624-07:04:11,309 nipype.workflow INFO:\n", + "\t [Job 6] Completed (l1_analysis.subject_infos).\n", + "240624-07:04:11,312 nipype.workflow INFO:\n", + "\t [Job 8] Completed (l1_analysis.parameters).\n", + "240624-07:04:11,316 nipype.workflow INFO:\n", + "\t [MultiProc] Running 0 tasks, and 21 jobs ready. Free memory (GB): 13.77/13.77, Free processors: 2/2.\n", + "240624-07:04:11,387 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.subject_infos\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_001/subject_infos\".\n", + "240624-07:04:11,387 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.parameters\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_070/parameters\".\n", + "240624-07:04:11,394 nipype.workflow INFO:\n", + "\t [Node] Executing \"subject_infos\" \n", + "240624-07:04:11,394 nipype.workflow INFO:\n", + "\t [Node] Executing \"parameters\" \n", + "240624-07:04:11,668 nipype.workflow INFO:\n", + "\t [Node] Finished \"subject_infos\", elapsed time 0.271306s.\n", + "240624-07:04:11,957 nipype.workflow INFO:\n", + "\t [Node] Finished \"parameters\", elapsed time 0.55984s.\n", + "240624-07:04:13,311 nipype.workflow INFO:\n", + "\t [Job 9] Completed (l1_analysis.subject_infos).\n", + "240624-07:04:13,313 nipype.workflow INFO:\n", + "\t [Job 11] Completed (l1_analysis.parameters).\n", + "240624-07:04:13,317 nipype.workflow INFO:\n", + "\t [MultiProc] Running 0 tasks, and 19 jobs ready. Free memory (GB): 13.77/13.77, Free processors: 2/2.\n", + "240624-07:04:13,374 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.subject_infos\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_070/subject_infos\".\n", + "240624-07:04:13,374 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.parameters\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_013/parameters\".\n", + "240624-07:04:13,379 nipype.workflow INFO:\n", + "\t [Node] Executing \"subject_infos\" \n", + "240624-07:04:13,379 nipype.workflow INFO:\n", + "\t [Node] Executing \"parameters\" \n", + "240624-07:04:13,694 nipype.workflow INFO:\n", + "\t [Node] Finished \"subject_infos\", elapsed time 0.311791s.\n", + "240624-07:04:13,872 nipype.workflow INFO:\n", + "\t [Node] Finished \"parameters\", elapsed time 0.490478s.\n", + "240624-07:04:15,313 nipype.workflow INFO:\n", + "\t [Job 12] Completed (l1_analysis.subject_infos).\n", + "240624-07:04:15,317 nipype.workflow INFO:\n", + "\t [Job 14] Completed (l1_analysis.parameters).\n", + "240624-07:04:15,321 nipype.workflow INFO:\n", + "\t [MultiProc] Running 0 tasks, and 17 jobs ready. Free memory (GB): 13.77/13.77, Free processors: 2/2.\n", + "240624-07:04:15,395 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l1_analysis.subject_infos\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_013/subject_infos\".\n", + "240624-07:04:15,401 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"_gunzip_func0\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_020/gunzip_func/mapflow/_gunzip_func0\".\n", + "240624-07:04:15,404 nipype.workflow INFO:\n", + "\t [Node] Executing \"subject_infos\" \n", + "240624-07:04:15,407 nipype.workflow INFO:\n", + "\t [Node] Executing \"_gunzip_func0\" \n", + "240624-07:04:15,679 nipype.workflow INFO:\n", + "\t [Node] Finished \"subject_infos\", elapsed time 0.271406s.\n", + "240624-07:04:17,315 nipype.workflow INFO:\n", + "\t [Job 15] Completed (l1_analysis.subject_infos).\n", + "240624-07:04:17,319 nipype.workflow INFO:\n", + "\t [MultiProc] Running 1 tasks, and 15 jobs ready. Free memory (GB): 13.57/13.77, Free processors: 1/2.\n", + " Currently running:\n", + " * _gunzip_func0\n", + "240624-07:04:17,422 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"_gunzip_func1\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_020/gunzip_func/mapflow/_gunzip_func1\".\n", + "240624-07:04:17,430 nipype.workflow INFO:\n", + "\t [Node] Executing \"_gunzip_func1\" \n", + "240624-07:04:19,318 nipype.workflow INFO:\n", + "\t [MultiProc] Running 2 tasks, and 14 jobs ready. Free memory (GB): 13.37/13.77, Free processors: 0/2.\n", + " Currently running:\n", + " * _gunzip_func1\n", + " * _gunzip_func0\n", + "240624-07:04:33,207 nipype.workflow INFO:\n", + "\t [Node] Finished \"_gunzip_func0\", elapsed time 17.792735s.\n", + "240624-07:04:33,209 nipype.workflow WARNING:\n", + "\t Storing result file without outputs\n", + "240624-07:04:33,209 nipype.workflow INFO:\n", + "\t [Node] Finished \"_gunzip_func1\", elapsed time 15.773215s.\n", + "240624-07:04:33,211 nipype.workflow WARNING:\n", + "\t Storing result file without outputs\n", + "240624-07:04:33,212 nipype.workflow WARNING:\n", + "\t [Node] Error on \"_gunzip_func0\" (/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_020/gunzip_func/mapflow/_gunzip_func0)\n", + "240624-07:04:33,213 nipype.workflow WARNING:\n", + "\t [Node] Error on \"_gunzip_func1\" (/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l1_analysis/_subject_id_020/gunzip_func/mapflow/_gunzip_func1)\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[6], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43msubject_level_analysis\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mMultiProc\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mplugin_args\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43m{\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mn_procs\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mnb_cores\u001b[49m\u001b[43m}\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/opt/miniconda-latest/envs/neuro/lib/python3.8/site-packages/nipype/pipeline/engine/workflows.py:638\u001b[0m, in \u001b[0;36mWorkflow.run\u001b[0;34m(self, plugin, plugin_args, updatehash)\u001b[0m\n\u001b[1;32m 636\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m str2bool(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexecution\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcreate_report\u001b[39m\u001b[38;5;124m\"\u001b[39m]):\n\u001b[1;32m 637\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_write_report_info(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mbase_dir, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mname, execgraph)\n\u001b[0;32m--> 638\u001b[0m \u001b[43mrunner\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mexecgraph\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mupdatehash\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mupdatehash\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconfig\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 639\u001b[0m datestr \u001b[38;5;241m=\u001b[39m datetime\u001b[38;5;241m.\u001b[39mutcnow()\u001b[38;5;241m.\u001b[39mstrftime(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mY\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mm\u001b[39m\u001b[38;5;132;01m%d\u001b[39;00m\u001b[38;5;124mT\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mH\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mM\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mS\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 640\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m str2bool(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexecution\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwrite_provenance\u001b[39m\u001b[38;5;124m\"\u001b[39m]):\n", + "File \u001b[0;32m/opt/miniconda-latest/envs/neuro/lib/python3.8/site-packages/nipype/pipeline/plugins/base.py:204\u001b[0m, in \u001b[0;36mDistributedPluginBase.run\u001b[0;34m(self, graph, config, updatehash)\u001b[0m\n\u001b[1;32m 201\u001b[0m logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNot submitting (max jobs reached)\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 203\u001b[0m sleep_til \u001b[38;5;241m=\u001b[39m loop_start \u001b[38;5;241m+\u001b[39m poll_sleep_secs\n\u001b[0;32m--> 204\u001b[0m \u001b[43msleep\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mmax\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msleep_til\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mtime\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 206\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_remove_node_dirs()\n\u001b[1;32m 207\u001b[0m report_nodes_not_run(notrun)\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], "source": [ "subject_level_analysis.run('MultiProc', plugin_args = {'n_procs': nb_cores})" ] @@ -117,7 +290,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "silent-twist", "metadata": {}, "outputs": [], @@ -131,7 +304,40 @@ "execution_count": null, "id": "champion-chess", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "240624-07:04:52,395 nipype.workflow INFO:\n", + "\t Workflow l2_analysis_equalRange_nsub_4 settings: ['check', 'execution', 'logging', 'monitoring']\n", + "240624-07:04:52,425 nipype.workflow INFO:\n", + "\t Running in parallel.\n", + "240624-07:04:52,429 nipype.workflow INFO:\n", + "\t [MultiProc] Running 0 tasks, and 3 jobs ready. Free memory (GB): 13.77/13.77, Free processors: 2/2.\n", + "240624-07:04:52,531 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l2_analysis_equalRange_nsub_4.selectfiles_groupanalysis\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l2_analysis_equalRange_nsub_4/_contrast_id_0002/selectfiles_groupanalysis\".\n", + "240624-07:04:52,530 nipype.workflow INFO:\n", + "\t [Node] Setting-up \"l2_analysis_equalRange_nsub_4.selectfiles_groupanalysis\" in \"/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l2_analysis_equalRange_nsub_4/_contrast_id_0001/selectfiles_groupanalysis\".\n", + "240624-07:04:52,540 nipype.workflow INFO:\n", + "\t [Node] Executing \"selectfiles_groupanalysis\" \n", + "240624-07:04:52,541 nipype.workflow INFO:\n", + "\t [Node] Executing \"selectfiles_groupanalysis\" \n", + "240624-07:04:52,548 nipype.workflow INFO:\n", + "\t [Node] Finished \"selectfiles_groupanalysis\", elapsed time 0.001661s.\n", + "240624-07:04:52,549 nipype.workflow INFO:\n", + "\t [Node] Finished \"selectfiles_groupanalysis\", elapsed time 0.001738s.\n", + "240624-07:04:52,551 nipype.workflow WARNING:\n", + "\t Storing result file without outputs\n", + "240624-07:04:52,552 nipype.workflow WARNING:\n", + "\t Storing result file without outputs\n", + "240624-07:04:52,554 nipype.workflow WARNING:\n", + "\t [Node] Error on \"l2_analysis_equalRange_nsub_4.selectfiles_groupanalysis\" (/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l2_analysis_equalRange_nsub_4/_contrast_id_0002/selectfiles_groupanalysis)\n", + "240624-07:04:52,555 nipype.workflow WARNING:\n", + "\t [Node] Error on \"l2_analysis_equalRange_nsub_4.selectfiles_groupanalysis\" (/work/run/reproduced/NARPS-2T6S-reproduced/intermediate_results/l2_analysis_equalRange_nsub_4/_contrast_id_0001/selectfiles_groupanalysis)\n" + ] + } + ], "source": [ "group_level_analysis_ei.run('MultiProc', plugin_args = {'n_procs': nb_cores})" ]