diff --git a/python/compute_scaling_experiments.py b/python/compute_scaling_experiments.py index aa1b443..d82e119 100644 --- a/python/compute_scaling_experiments.py +++ b/python/compute_scaling_experiments.py @@ -24,9 +24,10 @@ else: simulation = 'lichtman_chii2_different_seed' +base_path = os.path.join(os.getcwd(), 'out/') + if simulation == 'lichtman_chii2_different_seed': from compute_scaling_experiments_helpers import state_scaling_lichtman_chii2_different_seed as state - base_path = '/p/scratch/cjinb33/jinb3330/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2/' save_data_dir = 'simulated_data/scaling_experiment_lichtman_chii2_different_seed' interesting_paths = [ '07338a82a7f3331ed0309d0aefe2512b/', @@ -52,7 +53,6 @@ ana_path = 'd8057e7a966caf3eefdc9d234a0785d3/' elif simulation == 'lower_etoi': from compute_scaling_experiments_helpers import state_lower_e_to_i as state - base_path = '/p/scratch/cjinb33/jinb3330/huvi_fraction_EI_lower_e_to_i/' save_data_dir = 'simulated_data/scaling_experiment_lower_e_to_i' interesting_paths = [ '12742e24273ad73c879fc396b575e2e9/', @@ -72,7 +72,6 @@ ana_path = '099ed2eb40bf4285921a916d32bf5343/' elif simulation == 'lichtman_chii2_smaller_g': from compute_scaling_experiments_helpers import state_scaling_lichtman_chii2_smaller_g as state - base_path = '/p/scratch/cjinb33/shimoura1/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2_smaller_g/' save_data_dir = 'simulated_data/scaling_experiment_lichtman_chii2_smaller_g' interesting_paths = [ '08e8618517e6e057db688d6257680da6/', @@ -85,7 +84,6 @@ ana_path = 'd8057e7a966caf3eefdc9d234a0785d3/' elif simulation == 'lichtman_chii2_different_time_consts': from compute_scaling_experiments_helpers import state_scaling_lichtman_chii2_different_time_consts as state - base_path = '/p/scratch/cjinb33/shimoura1/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2_different_synaptic_time_constants/' save_data_dir = 'simulated_data/scaling_experiment_lichtman_chii2_different_time_consts' interesting_paths = [ '013292ec8fa6c9230d1c9518b71d19ad/', @@ -103,7 +101,6 @@ ana_path = 'd8057e7a966caf3eefdc9d234a0785d3/' elif simulation == 'lichtman_chii2_distributed_params': from compute_scaling_experiments_helpers import state_scaling_lichtman_chii2_distributed_params as state - base_path = '/p/scratch/cjinb33/shimoura1/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2_distributed_parameters/' save_data_dir = 'simulated_data/scaling_experiment_lichtman_chii2_distributed_params' interesting_paths = [ '2c60ac72127fa0089cf8c65a9f4aaf8e/', @@ -142,7 +139,7 @@ # ============================================================================== # ============================================================================== -filename = '/p/project/cjinb33/jinb3330/gitordner/huvi/data/rutishauser/spikes/' +filename = base_path + 'data/rutishauser/spikes/' data = load_data(filename) print(f'loaded {len(data)} neurons') all_ids = range(len(data)) diff --git a/python/compute_scaling_experiments_helpers.py b/python/compute_scaling_experiments_helpers.py index 72c917c..db06e94 100644 --- a/python/compute_scaling_experiments_helpers.py +++ b/python/compute_scaling_experiments_helpers.py @@ -363,7 +363,7 @@ def LVr(sts, t_ref, t_start=None, t_stop=None, LvR_min_spikes=10): return 0. def calculateFuncionalConnectivityCorrelations(ana_path, tmin=2000, tmax=8000, - base_path='/p/project/cjinb33/shimoura1/huvi-master', + base_path=os.path.join(os.getcwd(), 'out'), exclude_diagonal=True, use_corrcoeff=True): """ Calculates the correlation between experimental and simulated functional diff --git a/python/figure_appendix_rasterplot.py b/python/figure_appendix_rasterplot.py index da2310d..ab4f4d1 100644 --- a/python/figure_appendix_rasterplot.py +++ b/python/figure_appendix_rasterplot.py @@ -1,6 +1,7 @@ import random import numpy as np import pandas as pd +import os from os.path import join as p_join import matplotlib.pyplot as plt @@ -23,7 +24,7 @@ random.seed(1234) -outpath = '/p/scratch/cjinb33/jinb3330/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2/' +outpath = os.path.join(os.getcwd(), 'out/') net_folder = p_join(outpath, '10acdb2ae9247b49d4eeea4d78f308b7') # metastable sim_folder = p_join(net_folder, 'de4934b8c7777751f7c516e2ad35f50a') ana_folder = p_join(sim_folder, 'd8057e7a966caf3eefdc9d234a0785d3') diff --git a/python/figure_connectivity_construction.py b/python/figure_connectivity_construction.py index 4f462ed..fb872c3 100644 --- a/python/figure_connectivity_construction.py +++ b/python/figure_connectivity_construction.py @@ -1,3 +1,4 @@ +import os import numpy as np import pandas as pd from scipy.special import ndtr @@ -15,7 +16,7 @@ except FileNotFoundError: print('Please run data/macaque/preprocessing.py first') exit(1) -net_dict = networkDictFromDump('/p/scratch/cjinb33/jinb3330/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2/517f98422516bbe6cb324c5436e7f66f/') +net_dict = networkDictFromDump(os.path.join(os.getcwd(), 'out/517f98422516bbe6cb324c5436e7f66f/')) roman_to_arabic_numerals = { 'I': '1', diff --git a/python/figure_connectivity_validation.py b/python/figure_connectivity_validation.py index 3da611d..a53adba 100644 --- a/python/figure_connectivity_validation.py +++ b/python/figure_connectivity_validation.py @@ -17,7 +17,7 @@ target_min_outdeg = 100 work_dir = "figures/tmp" figname = "figure_connectivity_validation" -net_dict = networkDictFromDump('/p/scratch/cjinb33/jinb3330/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2/517f98422516bbe6cb324c5436e7f66f/') +net_dict = networkDictFromDump(os.path.join(os.getcwd(), 'out/517f98422516bbe6cb324c5436e7f66f/')) # ========== Preprocess ========== area_list = net_dict['area_list'] diff --git a/python/figure_scaling_experiments.py b/python/figure_scaling_experiments.py index c4a7a92..f211e02 100644 --- a/python/figure_scaling_experiments.py +++ b/python/figure_scaling_experiments.py @@ -475,7 +475,7 @@ # Plot experimental fMRI # ============================================================================== -data_dir = '/p/project/cjinb33/jinb3330/gitordner/huvi/data/senden/rsData_7T_DKparcel/' +data_dir = os.path.join(os.getcwd(), 'data/senden/rsData_7T_DKparcel/') roi = pd.read_csv(os.path.join(data_dir, 'ROIs.txt'), header=None, names=['roi'], dtype=str, squeeze=True) roi = roi.apply(lambda x: x.split('-')[-1]) roi = roi.drop(range(0, 14)).drop(range(82, 85)) diff --git a/python/figure_spike_journey.py b/python/figure_spike_journey.py index 7673360..285bb61 100644 --- a/python/figure_spike_journey.py +++ b/python/figure_spike_journey.py @@ -1,5 +1,6 @@ from os.path import join as path_join from itertools import product, combinations +import os import numpy as np import pandas as pd import matplotlib.pyplot as plt @@ -25,8 +26,7 @@ ana_hash = '9869eeeab580621db9572c8aa8c5f789' # outpath = 'out' -outpath = '/p/scratch/cjinb33/jinb3330/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2_perturbation' - +outpath = os.path.join(os.getcwd(), 'out') def load_diffs(net_hash_orig, net_hash_pert): """Calculate rate differences for the two hashes""" diff --git a/python/figure_spike_statistics.py b/python/figure_spike_statistics.py index be379d8..b5d2d96 100644 --- a/python/figure_spike_statistics.py +++ b/python/figure_spike_statistics.py @@ -1,3 +1,4 @@ +import os import random import numpy as np import pandas as pd @@ -27,7 +28,7 @@ for state in ['groundstate', 'metastable']: name_extension = '_lichtman_chiI2_different_seed' - outpath = '/p/scratch/cjinb33/jinb3330/huvi_fraction_EI_stable_localEtoI1_lichtman_chiI2/' + outpath = os.path.join(os.getcwd(), 'out/') if state == 'groundstate': net_folder = p_join(outpath, '517f98422516bbe6cb324c5436e7f66f') # groundstate elif state == 'metastable':