Skip to content

Commit

Permalink
update prePhy to accept _1 suffix on metrics files
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyasterjones committed Jul 21, 2022
1 parent c381659 commit f0e1df6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ecephys_spike_sorting/modules/prePhy_filters/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import pandas as pd

from ...common.utils import write_cluster_group_tsv
from ...common.utils import write_cluster_group_tsv, getFileVersion


def filter_by_metrics(args):
Expand All @@ -16,8 +16,12 @@ def filter_by_metrics(args):

start = time.time()

# find the correct metrics file (eg metrics.csv, metrics_1.csv, ...)
metrics_file_args = args['cluster_metrics']['cluster_metrics_file']
metrics_file, version = getFileVersion(metrics_file_args)
metrics_file = f"{metrics_file[:-5]}{version-1}.csv"

# read the metrics and current cluster assignments
metrics_file = args['cluster_metrics']['cluster_metrics_file']
metrics = pd.read_csv(metrics_file)
clusters_file = os.path.join(args['directories']['kilosort_output_directory'], \
args['ephys_params']['cluster_group_file_name'])
Expand Down

0 comments on commit f0e1df6

Please sign in to comment.