@@ -57,6 +57,8 @@ def writeToFile(value: str):
5757# function to read hdf5 file
5858def read_hdf5 (event , filepath , key ):
5959 if event :
60+ event = event .replace ("\\ " ,"_" )
61+ event = event .replace ("/" ,"_" )
6062 op = os .path .join (filepath , event + '.hdf5' )
6163 else :
6264 op = filepath
@@ -71,6 +73,8 @@ def read_hdf5(event, filepath, key):
7173
7274# function to write hdf5 file
7375def write_hdf5 (data , event , filepath , key ):
76+ event = event .replace ("\\ " ,"_" )
77+ event = event .replace ("/" ,"_" )
7478 op = os .path .join (filepath , event + '.hdf5' )
7579
7680 # if file does not exist create a new file
@@ -119,6 +123,8 @@ def create_csv_area_peak(filepath, arr, name, index=[]):
119123
120124# function to create dataframe for each event PSTH and save it to h5 file
121125def create_Df (filepath , event , name , psth , columns = []):
126+ event = event .replace ("\\ " ,"_" )
127+ event = event .replace ("/" ,"_" )
122128 if name :
123129 op = os .path .join (filepath , event + '_{}.h5' .format (name ))
124130 else :
@@ -161,6 +167,8 @@ def create_Df(filepath, event, name, psth, columns=[]):
161167
162168# function to read h5 file and make a dataframe from it
163169def read_Df (filepath , event , name ):
170+ event = event .replace ("\\ " ,"_" )
171+ event = event .replace ("/" ,"_" )
164172 if name :
165173 op = os .path .join (filepath , event + '_{}.h5' .format (name ))
166174 else :
@@ -221,6 +229,9 @@ def helper_psth(z_score, event, filepath,
221229 bin_psth_trials , use_time_or_trials ,
222230 baselineStart , baselineEnd ,
223231 naming , just_use_signal ):
232+
233+ event = event .replace ("\\ " ,"_" )
234+ event = event .replace ("/" ,"_" )
224235
225236 sampling_rate = read_hdf5 ('timeCorrection_' + naming , filepath , 'sampling_rate' )[0 ]
226237
@@ -350,6 +361,9 @@ def helper_psth(z_score, event, filepath,
350361# function to create PSTH for each event using function helper_psth and save the PSTH to h5 file
351362def storenamePsth (filepath , event , inputParameters ):
352363
364+ event = event .replace ("\\ " ,"_" )
365+ event = event .replace ("/" ,"_" )
366+
353367 selectForComputePsth = inputParameters ['selectForComputePsth' ]
354368 bin_psth_trials = inputParameters ['bin_psth_trials' ]
355369 use_time_or_trials = inputParameters ['use_time_or_trials' ]
@@ -439,6 +453,9 @@ def helperPSTHPeakAndArea(psth_mean, timestamps, sampling_rate, peak_startPoint,
439453
440454# function to compute PSTH peak and area using the function helperPSTHPeakAndArea save the values to h5 and csv files.
441455def findPSTHPeakAndArea (filepath , event , inputParameters ):
456+
457+ event = event .replace ("\\ " ,"_" )
458+ event = event .replace ("/" ,"_" )
442459
443460 #sampling_rate = read_hdf5(storesList[0,0], filepath, 'sampling_rate')
444461 peak_startPoint = inputParameters ['peak_startPoint' ]
@@ -511,6 +528,9 @@ def psth_shape_check(psth):
511528# function to compute average of group of recordings
512529def averageForGroup (folderNames , event , inputParameters ):
513530
531+ event = event .replace ("\\ " ,"_" )
532+ event = event .replace ("/" ,"_" )
533+
514534 print ("Averaging group of data..." )
515535 insertLog ("Averaging group of data" , logging .DEBUG )
516536 path = []
0 commit comments