This repo contains python scripts for analyzing MEA electrophysiology data.
Please generate issues in github (here) or email max ([email protected]) to report errors, difficulties, comments, and requests.
Download and install Anaconda for Python 2.7, found here: https://www.continuum.io/downloads
Download this repository and unzip it in your directory of choice.
Double-click on setup.bat to run the setup batch file.
To use these scripts, double click on their associated batch file. Alternatively, open a command line in the script's directory and enter python script_name.py
.
For example, to use CV_dev.py, enter python CV_dev.py
.
Note that these analysis scripts currently analyze text files generated by MC_DataTool - before analyzing a file, be sure to generate its text file via mcd_datatool_gen.bat.
Errors, when they occur, will be logged in files named after the current date and time in the error_logs folder.
Double-click on the 'mcd_datatool_gen.bat' batch file.
Select a folder for conversion. All subfolders will be converted as well.
This generates a script for MC_DataTool. Double click on the newly-generated .bat file, named after the folder you selected.
MC_DataTool is now running. Check the terminal for progress.
The converted files are generated in the MC_DataTool_Output folder and are ready for use.
To run the QT interval script, double-click the 'QT_Dev.bat' batch file.
This will open up a dialog to select a file.
The converted files available will be in the MC_DataTool_Output folder.
The script will then analyze all spikes across the channels and display the average spikes for review.
Enter the electrodes you would like to analyze for their QT interval. Press enter to proceed.
The first row plots the average spikes for the selected channel. The second row plots all spikes for the channel.
On the first row, click and drag to select the QT interval. The third row will update to display your selection.
Press enter to confirm your selection. The average QT interval is displayed in the terminal. If you entered multiple channels, the script will continue to the next channel.
To run the conduction velocity script, double-click the 'CV_dev.bat' batch file.
This will open up a dialog to select a file.
The converted files available will be in the MC_DataTool_Output folder.
The script will then analyze all spikes across the channels and display the average spikes for review.
In the command line, enter the two channels you want to analyze for conduction velocity and press enter.
The script will plot the two channels on top of each other in the first row and the stimulation channel(if it exists) in the second row.
Click and drag to select a region in which to calculate conduction velocity. The region for the two channels will update in the bottom two rows based on your selection.
Press enter to confirm your selection and to calculate conduction velocity. The average conduction velocity between the two channels in the region you selected is displayed in the terminal.
To run the PCA script, double-click on 'spike_pca_dev' batch file.
This will open up a dialog to select a file.
The converted files available will be in the MC_DataTool_Output folder.
The PCA images are generated and placed in a PCA_Images folder