export_to_phy vs using kilosort sorter output params.py directly
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Start at the export_to_phy function and compare the files it produces with the params.py and TSV files used by the direct Kilosort4 workflow. Reproduce both workflows on the same sorting, then identify what extra work accounts for the runtime and fewer waveform channels, and document whether the direct workflow is equivalent.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Hello!
We realised in our lab recently that two of us were using two different ways to manually curate units with Phy after sorting with kilosort4.
The first is to use to use the export_to_phy function and then open the params.py file with Phy as described in the documentation (the exporting is very slow, sometimes slower than the actual sorting):
analyzer = si.create_sorting_analyzer(sorting_KS4, recording_saved, sparse=True)
# compute all the extensions required
sexp.export_to_phy(sorting_analyzer=analyzer, output_folder=Path(data_dir) / 'phy_folder', verbose=True, copy_binary=False)
The second is to just compute the extensions needed, save them as tsv files, copy to the sorter output location where params.py from the sorter output is generated, and then just open that with Phy without the export_to_phy function (much faster, barely any extra compute time).
sorting_analyzer = si.create_sorting_analyzer(sorting=sorting_KS4, recording=rec_corrected, format="binary_folder", folder = KSfolder / 'analyzer_med' )
contamination = sqm.compute_sliding_rp_violations(sorting_analyzer=sorting_analyzer,
bin_size_ms=0.25)
presence_ratio = sqm.compute_presence_ratios(sorting_analyzer=sorting_analyzer)
def save_dict_to_tsv(data, header_name, file_path, delimiter='\t'):
"""
Saves a dictionary to a TSV file.
Args:
data (dict): The dictionary to save. Keys will be the header row.
file_path (str): The path to the TSV file.
delimiter (str, optional): The delimiter. Defaults to tab ('\t').
"""
#with open(file_path, 'w', newline='', encoding='utf-8') as tsvfile:
with open(Path(KSfolder) / 'sorter_output' / file_path, 'w', newline='', encoding='utf-8') as tsvfile:
writer = csv.writer(tsvfile, delimiter=delimiter)
writer.writerow(['cluster_id', header_name])
for key, value in data.items():
writer.writerow([key, value])
save_dict_to_tsv(contamination, 'sliding_rp', 'cluster_sliding_rp.tsv')
save_dict_to_tsv(presence_ratio, 'presence', 'cluster_presence.tsv')
# move these to the same folder that holds your params.py file for phy
We tried both for the same sorting, and the only thing that jumped out to us was that the second method resulted in fewer channels in the waveform view on Phy, but no other noticeable difference.
What does export_to_phy do that takes so much time, and is it necessary to do it, since the second method seems to be working fine? Or are we missing something here?
- Langage dominant
- Python
- Étoiles
- 858
- Forks
- 281
- Merge moyen
- 4 j 19 min
- PR mergées (30 j)
- 47
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de SpikeInterface/spikeinterface
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
SpikeInterface/spikeinterface#4842 · 2 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
testing
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
SpikeInterface/spikeinterface#4756 ·
Les mainteneurs répondent en général sous 2 jours
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
SpikeInterface/spikeinterface#4510 · 2 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
Process channels in banks in preprocessors to reduce RAM usagePeut-être pris @h-mayorquin l’a pris il y a 4 jours. Ouverteperformance preprocessing
SpikeInterface/spikeinterface#4837 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
-
Extend `TimeSeriesExecutor` to `num_chunks_per_job`Peut-être pris @samuelgarcia l’a pris il y a 5 jours. Ouverteconcurrency
SpikeInterface/spikeinterface#4831 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de SpikeInterface/spikeinterface
Issues similaires
-
[BUG] Container scenario crashes without expected_recovery_time, kube DNS example uses retry_waitOuverteneeds-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
krkn-chaos/krkn#1627 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
NousResearch/hermes-agent#136483 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
[BUG] LazyStackedTensorDictStore zeroes the last byte of a new key set on the last elementPeut-être pris @peterdsharpe l’a pris aujourd’hui. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
pytorch/tensordict#2307 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour