def custom_default_params_list(sorter_name, check=False): """ Get a dictionary of params for a sorter. if check if True just return default. """ default_params = ss.get_default_params(sorter_name) if check: default_params = default_params elif sorter_name == "klusta": default_params["detect_sign"] = 1 default_params["extract_s_before"] = 10 default_params["extract_s_after"] = 40 default_params["num_starting_clusters"] = 50 default_params["threshold_strong_std_factor"] = 4.5 elif sorter_name == "spykingcircus": default_params["detect_sign"] = 1 default_params["adjacency_radius"] = 0.2 default_params["detect_threshold"] = 4.5 default_params["template_width_ms"] = 3 default_params["filter"] = False default_params["num_workers"] = 8 elif sorter_name == "herdingspikes": default_params["filter"] = False return default_params
reference='median') ############################################################################## # Now you are ready to spikesort using the :code:`sorters` module! # Let's first check which sorters are implemented and which are installed print('Available sorters', ss.available_sorters()) print('Installed sorters', ss.installed_sorter_list) ############################################################################## # The :code:`ss.installed_sorter_list` will list the sorters installed in the machine. Each spike sorter # is implemented as a class. We can see we have Klusta and Mountainsort4 installed. # Spike sorters come with a set of parameters that users can change. The available parameters are dictionaries and # can be accessed with: print(ss.get_default_params('mountainsort4')) print(ss.get_default_params('klusta')) ############################################################################## # Let's run mountainsort4 and change one of the parameter, the detection_threshold: sorting_MS4 = ss.run_mountainsort4(recording=recording_cmr, detect_threshold=6) ############################################################################## # Alternatively we can pass full dictionary containing the parameters: ms4_params = ss.get_default_params('mountainsort4') ms4_params['detect_threshold'] = 4 ms4_params['curation'] = False # parameters set by params dictionary
print(recording_preprocessed) ############################################################################## # Now you are ready to spike sort using the :code:`sorters` module! # Let's first check which sorters are implemented and which are installed print('Available sorters', ss.available_sorters()) print('Installed sorters', ss.installed_sorters()) ############################################################################## # The :code:`ss.installed_sorters()` will list the sorters installed in the machine. # We can see we have HerdingSpikes and Tridesclous installed. # Spike sorters come with a set of parameters that users can change. # The available parameters are dictionaries and can be accessed with: print(ss.get_default_params('herdingspikes')) print(ss.get_default_params('tridesclous')) ############################################################################## # Let's run herdingspikes and change one of the parameter, say, the detect_threshold: sorting_HS = ss.run_herdingspikes(recording=recording_preprocessed, detect_threshold=4) print(sorting_HS) ############################################################################## # Alternatively we can pass full dictionary containing the parameters: other_params = ss.get_default_params('herdingspikes') other_params['detect_threshold'] = 5 # parameters set by params dictionary