Skip to content

Commit

Permalink
Merge pull request #128 from yarikoptic/enh-examples-gen
Browse files Browse the repository at this point in the history
Primarily to make more reproducible -- sort files
  • Loading branch information
bclenet authored May 22, 2024
2 parents 3a4177f + 48b3320 commit 2ec70ea
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 61 deletions.
61 changes: 2 additions & 59 deletions .github/workflows/parsers_test_on_nidmexamples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,65 +23,8 @@ jobs:
sudo apt-get install graphviz
- name: SPM/FSL/AFNI parsing on nidm-examples
run: |
mkdir -p nidmresults-examples
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_group_ols/batch.m -O nidmresults-examples/spm_group_ols_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_voxelunct4/batch.m -O nidmresults-examples/spm_thr_voxelunct4_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_clustfwep05/batch.m -O nidmresults-examples/spm_thr_clustfwep05_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_covariate/batch.m -O nidmresults-examples/spm_covariate_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_group_wls/batch.m -O nidmresults-examples/spm_group_wls_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_contrast_mask/batch.m -O nidmresults-examples/spm_contrast_mask_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_clustunck10/batch.m -O nidmresults-examples/spm_thr_clustunck10_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_voxelfwep05/batch.m -O nidmresults-examples/spm_thr_voxelfwep05_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_hrf_fir/batch.m -O nidmresults-examples/spm_hrf_fir_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_explicit_mask/batch.m -O nidmresults-examples/spm_explicit_mask_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_2_t_test/batch.m -O nidmresults-examples/spm_2_t_test_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_conjunction/batch.m -O nidmresults-examples/spm_conjunction_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_con_f/batch.m -O nidmresults-examples/spm_con_f_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_default/batch.m -O nidmresults-examples/spm_default_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_HRF_informed_basis/batch.m -O nidmresults-examples/spm_HRF_informed_basis_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_partial_conjunction/batch.m -O nidmresults-examples/spm_partial_conjunction_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_voxelfdrp05/batch.m -O nidmresults-examples/spm_thr_voxelfdrp05_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_temporal_derivative/batch.m -O nidmresults-examples/spm_temporal_derivative_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_non_sphericity/batch.m -O nidmresults-examples/spm_non_sphericity_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_con_f/report_log.html -O nidmresults-examples/fsl_con_f_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_con_f_multiple/report_log.html -O nidmresults-examples/fsl_con_f_multiple_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_contrast_mask/report_log.html -O nidmresults-examples/fsl_contrast_mask_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_default/report_log.html -O nidmresults-examples/fsl_default_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_full_examples001/report_log.html -O nidmresults-examples/fsl_full_examples001_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_gamma_basis/report_log.html -O nidmresults-examples/fsl_gamma_basis_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_gaussian/report_log.html -O nidmresults-examples/fsl_gaussian_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_group_btw/report_log.html -O nidmresults-examples/fsl_group_btw_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_group_ols/report_log.html -O nidmresults-examples/fsl_group_ols_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_group_wls/report_log.html -O nidmresults-examples/fsl_group_wls_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_hrf_fir/report_log.html -O nidmresults-examples/fsl_hrf_fir_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_hrf_gammadiff/report_log.html -O nidmresults-examples/fsl_hrf_gammadiff_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_motion_reg/report_log.html -O nidmresults-examples/fsl_motion_reg_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_motion_reg_der/report_log.html -O nidmresults-examples/fsl_motion_reg_der_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_thr_clustfwep05/report_log.html -O nidmresults-examples/fsl_thr_clustfwep05_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_thr_voxelfwep05/report_log.html -O nidmresults-examples/fsl_thr_voxelfwep05_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_default/subject_results/group.DS0011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_default_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_hrf_gammadiff/subject_results/group.DS0011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_hrf_gammadiff_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_hrf_tent/subject_results/group.DS0011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_hrf_tent_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_thr_clustfwep05/proc.sub_001 -O nidmresults-examples/afni_thr_clustfwep05_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_other_template/subject_results/group.DS0011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_other_template_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_gam/subject_results/group.DS000011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_gam_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_clustconn_18/proc.sub_001 -O nidmresults-examples/afni_clustconn_18_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_clustconn_26/proc.sub_001 -O nidmresults-examples/afni_clustconn_26_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_con_f/proc.sub_001 -O nidmresults-examples/afni_con_f_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_thr_clustunck10/proc.sub_001 -O nidmresults-examples/afni_thr_clustunck10_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_thr_voxelfdrp05/proc.sub_001 -O nidmresults-examples/afni_thr_voxelfdrp05_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_alt_onesided/proc.sub_001 -O nidmresults-examples/afni_alt_onesided_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_bi_sided_t_test/proc.sub_001 -O nidmresults-examples/afni_bi_sided_t_test_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_thr_voxelunct4/proc.sub_001 -O nidmresults-examples/afni_thr_voxelunct4_proc.sub_001
wget https://raw.githubusercontent.com/afni/apaper_highlight_narps/main/scripts_suppl_proc_vox/do_13_view_zoom.tcsh -O nidmresults-examples/narps_do_13_view_zoom.tcsh
wget https://raw.githubusercontent.com/afni/apaper_highlight_narps/main/scripts_suppl_proc_teams/do_04_make_imgs_A.tcsh -O nidmresults-examples/narps_do_04_make_imgs_A.tcsh
wget https://raw.githubusercontent.com/afni/apaper_highlight_narps/main/scripts_suppl_proc_teams/do_02_pc_with_sign0.tcsh -O nidmresults-examples/narps_do_02_pc_with_sign0.tcsh
python launch_parser_on_nidm.py --input_dir nidmresults-examples --output_dir examples/from_parsers
./fetch_nidmresults-examples
./launch_parser_on_nidm.py --input_dir nidmresults-examples --output_dir examples/from_parsers
- name: push on the repo the dir "examples/from_parsers"
run: |
git config user.name "GitHub Actions Bot"
Expand Down
60 changes: 60 additions & 0 deletions fetch_nidmresults-examples
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

set -eu

mkdir -p nidmresults-examples
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_group_ols/batch.m -O nidmresults-examples/spm_group_ols_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_voxelunct4/batch.m -O nidmresults-examples/spm_thr_voxelunct4_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_clustfwep05/batch.m -O nidmresults-examples/spm_thr_clustfwep05_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_covariate/batch.m -O nidmresults-examples/spm_covariate_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_group_wls/batch.m -O nidmresults-examples/spm_group_wls_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_contrast_mask/batch.m -O nidmresults-examples/spm_contrast_mask_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_clustunck10/batch.m -O nidmresults-examples/spm_thr_clustunck10_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_voxelfwep05/batch.m -O nidmresults-examples/spm_thr_voxelfwep05_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_hrf_fir/batch.m -O nidmresults-examples/spm_hrf_fir_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_explicit_mask/batch.m -O nidmresults-examples/spm_explicit_mask_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_2_t_test/batch.m -O nidmresults-examples/spm_2_t_test_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_conjunction/batch.m -O nidmresults-examples/spm_conjunction_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_con_f/batch.m -O nidmresults-examples/spm_con_f_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_default/batch.m -O nidmresults-examples/spm_default_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_HRF_informed_basis/batch.m -O nidmresults-examples/spm_HRF_informed_basis_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_partial_conjunction/batch.m -O nidmresults-examples/spm_partial_conjunction_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_thr_voxelfdrp05/batch.m -O nidmresults-examples/spm_thr_voxelfdrp05_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_temporal_derivative/batch.m -O nidmresults-examples/spm_temporal_derivative_batch.m
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_non_sphericity/batch.m -O nidmresults-examples/spm_non_sphericity_batch.m

wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_con_f/report_log.html -O nidmresults-examples/fsl_con_f_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_con_f_multiple/report_log.html -O nidmresults-examples/fsl_con_f_multiple_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_contrast_mask/report_log.html -O nidmresults-examples/fsl_contrast_mask_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_default/report_log.html -O nidmresults-examples/fsl_default_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_full_examples001/report_log.html -O nidmresults-examples/fsl_full_examples001_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_gamma_basis/report_log.html -O nidmresults-examples/fsl_gamma_basis_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_gaussian/report_log.html -O nidmresults-examples/fsl_gaussian_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_group_btw/report_log.html -O nidmresults-examples/fsl_group_btw_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_group_ols/report_log.html -O nidmresults-examples/fsl_group_ols_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_group_wls/report_log.html -O nidmresults-examples/fsl_group_wls_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_hrf_fir/report_log.html -O nidmresults-examples/fsl_hrf_fir_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_hrf_gammadiff/report_log.html -O nidmresults-examples/fsl_hrf_gammadiff_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_motion_reg/report_log.html -O nidmresults-examples/fsl_motion_reg_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_motion_reg_der/report_log.html -O nidmresults-examples/fsl_motion_reg_der_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_thr_clustfwep05/report_log.html -O nidmresults-examples/fsl_thr_clustfwep05_report_log.html
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/fsl_thr_voxelfwep05/report_log.html -O nidmresults-examples/fsl_thr_voxelfwep05_report_log.html

wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_default/subject_results/group.DS0011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_default_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_hrf_gammadiff/subject_results/group.DS0011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_hrf_gammadiff_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_hrf_tent/subject_results/group.DS0011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_hrf_tent_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_thr_clustfwep05/proc.sub_001 -O nidmresults-examples/afni_thr_clustfwep05_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_other_template/subject_results/group.DS0011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_other_template_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_gam/subject_results/group.DS000011/subj.sub_001/proc.sub_001 -O nidmresults-examples/afni_gam_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_clustconn_18/proc.sub_001 -O nidmresults-examples/afni_clustconn_18_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_clustconn_26/proc.sub_001 -O nidmresults-examples/afni_clustconn_26_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_con_f/proc.sub_001 -O nidmresults-examples/afni_con_f_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_thr_clustunck10/proc.sub_001 -O nidmresults-examples/afni_thr_clustunck10_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_thr_voxelfdrp05/proc.sub_001 -O nidmresults-examples/afni_thr_voxelfdrp05_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_alt_onesided/proc.sub_001 -O nidmresults-examples/afni_alt_onesided_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_bi_sided_t_test/proc.sub_001 -O nidmresults-examples/afni_bi_sided_t_test_proc.sub_001
wget https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/afni_thr_voxelunct4/proc.sub_001 -O nidmresults-examples/afni_thr_voxelunct4_proc.sub_001

wget https://raw.githubusercontent.com/afni/apaper_highlight_narps/main/scripts_suppl_proc_vox/do_13_view_zoom.tcsh -O nidmresults-examples/narps_do_13_view_zoom.tcsh
wget https://raw.githubusercontent.com/afni/apaper_highlight_narps/main/scripts_suppl_proc_teams/do_04_make_imgs_A.tcsh -O nidmresults-examples/narps_do_04_make_imgs_A.tcsh
wget https://raw.githubusercontent.com/afni/apaper_highlight_narps/main/scripts_suppl_proc_teams/do_02_pc_with_sign0.tcsh -O nidmresults-examples/narps_do_02_pc_with_sign0.tcsh
6 changes: 4 additions & 2 deletions launch_parser_on_nidm.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import argparse
import os
import random
Expand Down Expand Up @@ -79,8 +81,8 @@ def main():
context_write.write("Processing files...\n")

# Iteration on each example
for root, _, files in os.walk(opt.input_dir):
for file in files:
for root, _, files in sorted(os.walk(opt.input_dir)):
for file in sorted(files):

if file.endswith("batch.m"): # spm
filename_ss_ext = file.split(".m")[0]
Expand Down

0 comments on commit 2ec70ea

Please sign in to comment.