def run_network(network_index): network_index = int(network_index) network_names = { 0: "visual", 1: "somatomotor", 2: "dorsal_attention", 3: "ventral_attention", 4: "limbic", 5: "fronto_parietal", 6: "default_mode", 7: "subcortical", 8: "cerebellum" } analysis_name = network_names[network_index] project_folder = '.' # get data data = IQData() covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_single_networks(use_cached=False) X = data.networks[network_index] y = data.fsiq del data # run analysis pipe = construct_hyperpipe(analysis_name, project_folder) pipe.fit(X, y, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
def run_perm_test(row): row_array = row.split(';') perm_ind = row_array[0] perm_y = row_array[1] perm_y = np.asarray(perm_y.split(',')).astype(int) networks = [ 'visual', 'somatomotor', 'dorsal_attention', 'ventral_attention', 'limbic', 'default_mode', 'fronto_parietal' ] for network in networks: analysis_name = 'schaefer_{}_noTiv_perm_'.format(network) + str( perm_ind) data_folder = '/scratch/tmp/wintern/iq_frankfurt/' project_folder = '/scratch/tmp/wintern/iq_frankfurt/results/noTivRescaling/perm/schaefer_{}'.format( network) os.makedirs(project_folder, exist_ok=True) cache_dir = '/scratch/tmp/wintern/cache' # get data data = IQData(data_folder=data_folder, tiv_rescaled=False) covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_schaefer_network(network, use_cached=True) # run analysis pipe = construct_hyperpipe_schaefer(analysis_name, project_folder, cache_dir) pipe.groups = data.fsiq pipe.fit(data.schaefer_network, perm_y, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
def run_perm_test(row, network_index): network_index = int(network_index) network_names = { 0: "visual", 1: "somatomotor", 2: "dorsal_attention", 3: "ventral_attention", 4: "limbic", 5: "fronto_parietal", 6: "default_mode", 7: "subcortical", 8: "cerebellum" } row_array = row.split(';') perm_ind = row_array[0] perm_y = row_array[1] perm_y = np.asarray(perm_y.split(',')).astype(int) analysis_name = network_names[network_index] + '_perm_' + str(perm_ind) project_folder = './perms/' # get data data = IQData() covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_single_networks(use_cached=True) X = data.networks[network_index] y = data.fsiq del data # run analysis pipe = construct_hyperpipe(analysis_name, project_folder) pipe.groups = y pipe.fit(X, perm_y, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
def run_perm_test(row): row_array = row.split(';') perm_ind = row_array[0] perm_y = row_array[1] perm_y = np.asarray(perm_y.split(',')).astype(int) analysis_name = 'whole_brain_noTiv_perm_' + str(perm_ind) project_folder = './perm/' # get data data = IQData(tiv_rescaled=False) covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_whole_brain(use_cached=True) # run analysis pipe = construct_hyperpipe(analysis_name, project_folder) pipe.groups = data.fsiq pipe.fit(data.whole_brain, perm_y, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
def run_perm_test(row): row_array = row.split(';') perm_ind = row_array[0] perm_y = row_array[1] perm_y = np.asarray(perm_y.split(',')).astype(int) analysis_name = 'whole_brain_perm_' + str(perm_ind) data_folder = '/scratch/tmp/wintern/iq_frankfurt/' project_folder = '/scratch/tmp/wintern/iq_frankfurt/results/perm/whole_brain/' cache_dir = '/scratch/tmp/wintern/cache' # get data data = IQData(data_folder=data_folder) covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_whole_brain(use_cached=True) # run analysis pipe = construct_hyperpipe(analysis_name, project_folder, cache_dir) pipe.groups = data.fsiq pipe.fit(data.whole_brain, perm_y, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
Last updated: 18-02-2019 Author ------ Nils R. Winter [email protected] Translationale Psychiatrie Universitaetsklinikum Muenster """ import sys sys.path.append('/scratch/tmp/wintern/iq_frankfurt/photonai') sys.path.append('/scratch/tmp/wintern/iq_frankfurt/') from analyses.analysis_base import construct_hyperpipe_schaefer from data.data import IQData import numpy as np import os analysis_name = 'shen_no_tiv' data_folder = '/scratch/tmp/wintern/iq_frankfurt/' project_folder = '/scratch/tmp/wintern/iq_frankfurt/results/noTivRescaling/shen' cache_dir = '/scratch/tmp/wintern/cache' # get data data = IQData(data_folder=data_folder, tiv_rescaled=False) covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_shen(use_cached=False) # run analysis pipe = construct_hyperpipe_schaefer(analysis_name, project_folder, cache_dir) pipe.fit(data.shen, data.fsiq, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
Author ------ Nils R. Winter [email protected] Translationale Psychiatrie Universitaetsklinikum Muenster """ import sys sys.path.append('/scratch/tmp/wintern/iq_frankfurt/photonai') sys.path.append('/scratch/tmp/wintern/iq_frankfurt/') from analyses.analysis_base import construct_hyperpipe_schaefer from data.data import IQData import numpy as np import os analysis_name = 'schaefer' data_folder = '/scratch/tmp/wintern/iq_frankfurt/' project_folder = '/scratch/tmp/wintern/iq_frankfurt/results' cache_dir = '/scratch/tmp/wintern/cache' # get data data = IQData(data_folder=data_folder) covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_schaefer(use_cached=False) # run analysis pipe = construct_hyperpipe_schaefer(analysis_name, project_folder, cache_dir) pipe.fit(data.schaefer, data.fsiq, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
Last updated: 28-01-2020 Author ------ Nils R. Winter [email protected] Translationale Psychiatrie Universitaetsklinikum Muenster """ import sys sys.path.append('/scratch/tmp/wintern/iq_frankfurt/photonai') sys.path.append('/scratch/tmp/wintern/iq_frankfurt/') from analyses.analysis_base import construct_hyperpipe_schaefer from data.data import IQData import numpy as np import os analysis_name = 'shen' data_folder = '/scratch/tmp/wintern/iq_frankfurt/' project_folder = '/scratch/tmp/wintern/iq_frankfurt/results/TivRescaling/shen/' cache_dir = '/scratch/tmp/wintern/cache' # get data data = IQData(data_folder=data_folder) covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_shen(use_cached=False) # run analysis pipe = construct_hyperpipe_schaefer(analysis_name, project_folder, cache_dir) pipe.fit(data.shen, data.fsiq, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
This scripts implements the global (whole brain) analysis without TiV rescaling Version ------- Created: 28-01-2019 Last updated: 29-09-2019 Author ------ Nils R. Winter [email protected] Translationale Psychiatrie Universitaetsklinikum Muenster """ from analyses.analysis_base import construct_hyperpipe from data.data import IQData import numpy as np import os analysis_name = 'whole_brain_no_tiv_rescaling' project_folder = '.' # get data data = IQData() covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_whole_brain(use_cached=True) # run analysis pipe = construct_hyperpipe(analysis_name, project_folder) pipe.fit(data.whole_brain, data.fsiq, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
Last updated: 18-02-2019 Author ------ Nils R. Winter [email protected] Translationale Psychiatrie Universitaetsklinikum Muenster """ import sys sys.path.append('/scratch/tmp/wintern/iq_frankfurt/photonai') sys.path.append('/scratch/tmp/wintern/iq_frankfurt/') from analyses.analysis_base import construct_hyperpipe_schaefer from data.data import IQData import numpy as np import os analysis_name = 'schaefer100_no_tiv' data_folder = '/scratch/tmp/wintern/iq_frankfurt/' project_folder = '/scratch/tmp/wintern/iq_frankfurt/results/noTivRescaling/schaefer100' cache_dir = '/scratch/tmp/wintern/cache' # get data data = IQData(data_folder=data_folder, tiv_rescaled=False) covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_schaefer100(use_cached=False) # run analysis pipe = construct_hyperpipe_schaefer(analysis_name, project_folder, cache_dir) pipe.fit(data.schaefer100, data.fsiq, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)
Translationale Psychiatrie Universitaetsklinikum Muenster """ import sys sys.path.append('/scratch/tmp/wintern/iq_frankfurt/photonai') sys.path.append('/scratch/tmp/wintern/iq_frankfurt/') from analyses.analysis_base import construct_hyperpipe_schaefer from data.data import IQData import numpy as np import os networks = ['visual', 'somatomotor', 'dorsal_attention', 'ventral_attention', 'limbic', 'default_mode', 'fronto_parietal'] for network in networks: analysis_name = 'schaefer_{}'.format(network) data_folder = '/scratch/tmp/wintern/iq_frankfurt/' project_folder = '/scratch/tmp/wintern/iq_frankfurt/results/TivRescaling/schaefer_{}'.format(network) os.makedirs(project_folder, exist_ok=True) cache_dir = '/scratch/tmp/wintern/cache' # get data data = IQData(data_folder=data_folder, tiv_rescaled=True) covariates = np.asarray([data.age, data.gender, data.handedness]).T data.load_schaefer_network(network, use_cached=False) # run analysis pipe = construct_hyperpipe_schaefer(analysis_name, project_folder, cache_dir) pipe.fit(data.schaefer_network, data.fsiq, **{'covariates': covariates}) os.remove(pipe.output_settings.pretrained_model_filename)