@@ -58,6 +58,8 @@ def writeToFile(value: str):
5858# function to read hdf5 file
5959def read_hdf5 (event , filepath , key ):
6060 if event :
61+ event = event .replace ("\\ " ,"_" )
62+ event = event .replace ("/" ,"_" )
6163 op = os .path .join (filepath , event + '.hdf5' )
6264 else :
6365 op = filepath
@@ -72,6 +74,8 @@ def read_hdf5(event, filepath, key):
7274
7375# function to write hdf5 file
7476def write_hdf5 (data , event , filepath , key ):
77+ event = event .replace ("\\ " ,"_" )
78+ event = event .replace ("/" ,"_" )
7579 op = os .path .join (filepath , event + '.hdf5' )
7680
7781 # if file does not exist create a new file
@@ -120,6 +124,8 @@ def create_csv_area_peak(filepath, arr, name, index=[]):
120124
121125# function to create dataframe for each event PSTH and save it to h5 file
122126def create_Df (filepath , event , name , psth , columns = []):
127+ event = event .replace ("\\ " ,"_" )
128+ event = event .replace ("/" ,"_" )
123129 if name :
124130 op = os .path .join (filepath , event + '_{}.h5' .format (name ))
125131 else :
@@ -162,6 +168,8 @@ def create_Df(filepath, event, name, psth, columns=[]):
162168
163169# function to read h5 file and make a dataframe from it
164170def read_Df (filepath , event , name ):
171+ event = event .replace ("\\ " ,"_" )
172+ event = event .replace ("/" ,"_" )
165173 if name :
166174 op = os .path .join (filepath , event + '_{}.h5' .format (name ))
167175 else :
@@ -222,6 +230,9 @@ def helper_psth(z_score, event, filepath,
222230 bin_psth_trials , use_time_or_trials ,
223231 baselineStart , baselineEnd ,
224232 naming , just_use_signal ):
233+
234+ event = event .replace ("\\ " ,"_" )
235+ event = event .replace ("/" ,"_" )
225236
226237 sampling_rate = read_hdf5 ('timeCorrection_' + naming , filepath , 'sampling_rate' )[0 ]
227238
@@ -351,6 +362,9 @@ def helper_psth(z_score, event, filepath,
351362# function to create PSTH for each event using function helper_psth and save the PSTH to h5 file
352363def storenamePsth (filepath , event , inputParameters ):
353364
365+ event = event .replace ("\\ " ,"_" )
366+ event = event .replace ("/" ,"_" )
367+
354368 selectForComputePsth = inputParameters ['selectForComputePsth' ]
355369 bin_psth_trials = inputParameters ['bin_psth_trials' ]
356370 use_time_or_trials = inputParameters ['use_time_or_trials' ]
@@ -440,6 +454,9 @@ def helperPSTHPeakAndArea(psth_mean, timestamps, sampling_rate, peak_startPoint,
440454
441455# function to compute PSTH peak and area using the function helperPSTHPeakAndArea save the values to h5 and csv files.
442456def findPSTHPeakAndArea (filepath , event , inputParameters ):
457+
458+ event = event .replace ("\\ " ,"_" )
459+ event = event .replace ("/" ,"_" )
443460
444461 #sampling_rate = read_hdf5(storesList[0,0], filepath, 'sampling_rate')
445462 peak_startPoint = inputParameters ['peak_startPoint' ]
@@ -512,6 +529,9 @@ def psth_shape_check(psth):
512529# function to compute average of group of recordings
513530def averageForGroup (folderNames , event , inputParameters ):
514531
532+ event = event .replace ("\\ " ,"_" )
533+ event = event .replace ("/" ,"_" )
534+
515535 print ("Averaging group of data..." )
516536 insertLog ("Averaging group of data" , logging .DEBUG )
517537 path = []
0 commit comments