@@ -90,7 +90,7 @@ def generate_CatGT_input_json(self):
9090 print ('run_CatGT is set to False, skipping...' )
9191 return
9292
93- session_str , gate_str , _ , probe_str = self .parse_input_filename ()
93+ session_str , gate_str , trig_str , probe_str = self .parse_input_filename ()
9494
9595 first_trig , last_trig = SpikeGLX_utils .ParseTrigStr (
9696 'start,end' , probe_str , gate_str , self ._npx_input_dir .as_posix ())
@@ -111,6 +111,18 @@ def generate_CatGT_input_json(self):
111111
112112 input_meta_fullpath , continuous_file = self ._get_raw_data_filepaths ()
113113
114+ # create symbolic link to the actual data files - as CatGT expects files to follow a certain naming convention
115+ continuous_file_symlink = (continuous_file .parent / f'{ session_str } _g{ gate_str } '
116+ / f'{ session_str } _g{ gate_str } _imec{ probe_str } '
117+ / f'{ session_str } _g{ gate_str } _t{ trig_str } .imec{ probe_str } .ap.bin' )
118+ continuous_file_symlink .parent .mkdir (parents = True , exist_ok = True )
119+ continuous_file_symlink .symlink_to (continuous_file )
120+ input_meta_fullpath_symlink = (input_meta_fullpath .parent / f'{ session_str } _g{ gate_str } '
121+ / f'{ session_str } _g{ gate_str } _imec{ probe_str } '
122+ / f'{ session_str } _g{ gate_str } _t{ trig_str } .imec{ probe_str } .ap.meta' )
123+ input_meta_fullpath_symlink .parent .mkdir (parents = True , exist_ok = True )
124+ input_meta_fullpath_symlink .symlink_to (input_meta_fullpath )
125+
114126 createInputJson (self ._catGT_input_json .as_posix (),
115127 KS2ver = self ._KS2ver ,
116128 npx_directory = self ._npx_input_dir .as_posix (),
@@ -121,7 +133,7 @@ def generate_CatGT_input_json(self):
121133 probe_string = probe_str ,
122134 continuous_file = continuous_file .as_posix (),
123135 input_meta_path = input_meta_fullpath .as_posix (),
124- extracted_data_directory = self ._ks_output_dir .parent . as_posix (),
136+ extracted_data_directory = self ._ks_output_dir .as_posix (),
125137 kilosort_output_directory = self ._ks_output_dir .as_posix (),
126138 kilosort_repository = _get_kilosort_repository (self ._KS2ver ),
127139 ** {k : v for k , v in catgt_params .items () if k in self ._input_json_args }
0 commit comments