Skip to content

Repository files navigation

Tracking_Graph

GitHub License

Tracking_Graph is a tool for track units across spike sorting solutions.

Installation

Install Tracking_Graph using pip:

pip install tracking_graph

Usage

Creating a Graph

fromtracking_graphimportrun_tg, get_tg_groups, EuclideanClassifier# Create a classifiermodelcreator=EuclideanClassifier.creator(std_mult=3) # Classify spikes with length > 3 std# Run Tracking_GraphG=run_tg(
we_list, # List of WaveformExtractor objectsoutputfile='/home/user/examplefolder/tg_data.hdf5',
max_len=2, # Maximum edge length, must be at least 1modelcreator=modelcreator
)
# Compute results programmatically (can be replaced by the GUI)groups, sG, discarded=get_tg_groups(
G,
mintrack=3, # Minimum number of segments for a clustermerge=True# Apply criteria to merge splits
)
# Create a final results tableimportpandasaspddf= []
forgi, ginenumerate(groups):
forcing:
df.append({'segment': c.segment,
'cluster': c.unit,
'tg_unit': gi})
results_table=pd.DataFrame(df)

Exploring Simplified Graphs with GUI

Launch the graphical interface (Streamlit server) using:

tg_gui

Additional Tools

Tracking_Graph provides a wrapper to load aligned waveforms from Wave_Clus clustering results, addressing limitations in SpikeInterface's waveform interpolation:

fromtracking_graph.spikeinterface_addonsimportWaveclus_Waveformspath_times_file='/home/user/examplefolder/times_example.mat'# Full path to Wave_Clus resultwe=Waveclus_Waveforms(path_times_file) # Object with basic WaveformExtractor interface

Limitations

  • Tracking_Graph requires spikeinterface<=0.100 due to its dependency on the WaveformExtractor class.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

For more projects and information, visit my GitHub profile: ferchaure

About

Algorithm for tracking neurons across sessions

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages