Browse Source

fix requirements, paths, minor bugs

Lennart Wittkuhn 3 years ago
parent
commit
006ef63d41
5 changed files with 74 additions and 15 deletions
  1. 3 3
      code/decoding/highspeed-decoding-cluster.sh
  2. 10 10
      code/decoding/highspeed_decoding.py
  3. 59 0
      code/decoding/requirements.txt
  4. 1 1
      glm
  5. 1 1
      masks

+ 3 - 3
code/decoding/highspeed-decoding-cluster.sh

@@ -60,13 +60,13 @@ PARTICIPANTS=$1
 # ==============================================================================
 # initialize a counter for the subjects:
 SUB_COUNT=0
-for i in {1..1}; do
+for i in {1..40}; do
 	# turn the subject id into a zero-padded number:
 	SUB=$(printf "%02d\n" ${i})
 	# start slurm job file:
 	echo "#!/bin/bash" > job
 	# name of the job
-	echo "#SBATCH --job-name highsopeed-decoding-sub-${SUB}" >> job
+	echo "#SBATCH --job-name highspeed-decoding-sub-${SUB}" >> job
 	# set the expected maximum running time for the job:
 	echo "#SBATCH --time 12:00:00" >> job
 	# determine how much RAM your operation needs:
@@ -81,7 +81,7 @@ for i in {1..1}; do
 	echo "#SBATCH --workdir ." >> job
 	# activate virtual environment on cluster:
 	echo "source /etc/bash_completion.d/virtualenvwrapper" >> job
-	echo "workon decoding" >> job
+	echo "workon highspeed-decoding" >> job
 	# define the main command:
 	echo "python3 ${PATH_SCRIPT} ${SUB}" >> job
 	# submit job to cluster queue and remove it to avoid confusion:

+ 10 - 10
code/decoding/highspeed_decoding.py

@@ -76,7 +76,7 @@ if 'darwin' in sys.platform:
 elif 'linux' in sys.platform:
     # path to the project root:
     project_name = 'highspeed-decoding'
-    path_root = os.getcwd().split(project_name)[0] + project_name
+    path_root = os.getenv('PWD').split(project_name)[0] + project_name
     # define the path to the cluster:
     path_tardis = path_root
     # define the path to the server:
@@ -220,42 +220,42 @@ path_mask_vis_task = opj(path_masks, 'mask_visual', sub, '*', '*task-highspeed*.
 path_mask_vis_task = sorted(glob.glob(path_mask_vis_task), key=lambda f: os.path.basename(f))
 logging.info('found %d visual mask task files' % len(path_mask_vis_task))
 logging.info('paths to visual mask task files:\n%s' % pformat(path_mask_vis_task))
-dl.get(glob.glob(path_mask_vis_task))
+dl.get(path_mask_vis_task)
 
 # load the hippocampus mask task files:
 path_mask_hpc_task = opj(path_masks, 'mask_hippocampus', sub, '*', '*task-highspeed*.nii.gz')
 path_mask_hpc_task = sorted(glob.glob(path_mask_hpc_task), key=lambda f: os.path.basename(f))
 logging.info('found %d hpc mask files' % len(path_mask_hpc_task))
 logging.info('paths to hpc mask task files:\n%s' % pformat(path_mask_hpc_task))
-dl.get(glob.glob(path_mask_hpc_task))
+dl.get(path_mask_hpc_task)
 
 # load the whole brain mask files:
 path_mask_whole_task = opj(path_fmriprep, '*', 'func', '*task-highspeed*T1w*brain_mask.nii.gz')
 path_mask_whole_task = sorted(glob.glob(path_mask_whole_task), key=lambda f: os.path.basename(f))
 logging.info('found %d whole-brain masks' % len(path_mask_whole_task))
 logging.info('paths to whole-brain mask files:\n%s' % pformat(path_mask_whole_task))
-dl.get(glob.glob(path_mask_whole_task))
+dl.get(path_mask_whole_task)
 
 # load the functional mri task files:
 path_func_task = opj(path_level1, 'smooth', sub, '*', '*task-highspeed*nii.gz')
 path_func_task = sorted(glob.glob(path_func_task), key=lambda f: os.path.basename(f))
 logging.info('found %d functional mri task files' % len(path_func_task))
 logging.info('paths to functional mri task files:\n%s' % pformat(path_func_task))
-dl.get(glob.glob(path_func_task))
+dl.get(path_func_task)
 
 # define path to the functional resting state runs:
 path_rest = opj(path_tardis, 'masks', 'masks', 'smooth', sub, '*', '*task-rest*nii.gz')
 path_rest = sorted(glob.glob(path_rest), key=lambda f: os.path.basename(f))
 logging.info('found %d functional mri rest files' % len(path_rest))
 logging.info('paths to functional mri rest files:\n%s' % pformat(path_rest))
-dl.get(glob.glob(path_rest))
+dl.get(path_rest)
 
 # load the anatomical mri file:
 path_anat = opj(path_fmriprep, 'anat', '%s_desc-preproc_T1w.nii.gz' % sub)
 path_anat = sorted(glob.glob(path_anat), key=lambda f: os.path.basename(f))
 logging.info('found %d anatomical mri file' % len(path_anat))
 logging.info('paths to anatoimical mri files:\n%s' % pformat(path_anat))
-dl.get(glob.glob(path_anat))
+dl.get(path_anat)
 
 # load the confounds files:
 path_confs_task = opj(path_fmriprep, '*', 'func', '*task-highspeed*confounds_regressors.tsv')
@@ -263,21 +263,21 @@ path_confs_task = sorted(glob.glob(path_confs_task), key=lambda f: os.path.basen
 logging.info('found %d confounds files' % len(path_confs_task))
 logging.info('found %d confounds files' % len(path_confs_task))
 logging.info('paths to confounds files:\n%s' % pformat(path_confs_task))
-dl.get(glob.glob(path_confs_task))
+dl.get(path_confs_task)
 
 # load the spm.mat files:
 path_spm_mat = opj(path_level1, 'contrasts', sub, '*', 'SPM.mat')
 path_spm_mat = sorted(glob.glob(path_spm_mat), key=lambda f: os.path.dirname(f))
 logging.info('found %d spm.mat files' % len(path_spm_mat))
 logging.info('paths to spm.mat files:\n%s' % pformat(path_spm_mat))
-dl.get(glob.glob(path_spm_mat))
+dl.get(path_spm_mat)
 
 # load the t-maps of the first-level glm:
 path_tmap = opj(path_level1, 'contrasts', sub, '*', 'spmT*.nii')
 path_tmap = sorted(glob.glob(path_tmap), key=lambda f: os.path.dirname(f))
 logging.info('found %d t-maps' % len(path_tmap))
 logging.info('paths to t-maps files:\n%s' % pformat(path_tmap))
-dl.get(glob.glob(path_tmap))
+dl.get(path_tmap)
 '''
 ========================================================================
 LOAD THE MRI DATA:

+ 59 - 0
code/decoding/requirements.txt

@@ -0,0 +1,59 @@
+annexremote==1.4.4
+appdirs==1.4.4
+attrs==20.3.0
+boto==2.49.0
+certifi==2020.11.8
+cffi==1.14.3
+chardet==3.0.4
+Counter==1.0.0
+cryptography==3.2.1
+cycler==0.10.0
+datalad==0.13.5
+Deprecated==1.2.10
+distro==1.5.0
+fasteners==0.15
+future==0.18.2
+humanize==3.1.0
+idna==2.10
+iniconfig==1.1.1
+iso8601==0.1.13
+jeepney==0.6.0
+joblib==0.17.0
+jsmin==2.2.2
+keyring==21.5.0
+keyrings.alt==4.0.1
+kiwisolver==1.3.1
+matplotlib==3.3.3
+monotonic==1.5
+msgpack==1.0.0
+nibabel==3.2.0
+nilearn==0.7.0
+numpy==1.19.4
+packaging==20.4
+pandas==1.1.4
+patool==1.12
+Pillow==8.0.1
+pkg-resources==0.0.0
+pluggy==0.13.1
+py==1.9.0
+pycparser==2.20
+PyGithub==1.53
+PyJWT==1.7.1
+pyparsing==2.4.7
+pytest==6.1.2
+python-dateutil==2.8.1
+pytz==2020.4
+PyYAML==5.3.1
+requests==2.25.0
+scikit-learn==0.23.2
+scipy==1.5.4
+SecretStorage==3.2.0
+simplejson==3.17.2
+six==1.15.0
+sklearn==0.0
+threadpoolctl==2.1.0
+toml==0.10.2
+tqdm==4.53.0
+urllib3==1.26.2
+Whoosh==2.7.4
+wrapt==1.12.1

+ 1 - 1
glm

@@ -1 +1 @@
-Subproject commit cbb58f3c72274c1aa280d5c99be3684ab03d81ce
+Subproject commit a64f426261994c3649ec2cab6343fa37bc68677d

+ 1 - 1
masks

@@ -1 +1 @@
-Subproject commit a126c47380bfb7b184721f642cb17fe583a06d2d
+Subproject commit 80143d9d318867cb1305a079411c3577cc64776d