Skip to content

mccutcheonlab/tdt-convert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TDT-convert instructions

Quick start

NB: the changes to the .m file described below can be done on any computer whether or not it has Matlab installed. You can open the .m file in any text editor (e.g. Notepad) and make the changes. If you have Matlab installed and want to edit from within Matlab's editor you can do this my typing edit myproject_convert at a Matlab prompt but the folder has to be on Matlab's path (see step 7 below).

  1. Clone tdt-convert from https://github.com/mccutcheonlab/tdt-convert

  2. Copy template_convert.m to a master folder for the project (e.g. a location on the R drive where everything is stored, R:\DA_and_Reward\jem64\myproject) and rename the .m file with a project-specific name (e.g. myproject_convert.m).

  3. Create metafile sheet in project's Excel experimental details file (see metafile instructions below).

  4. Change value for folder in myproject_convert.m script to point to project master folder (can be edited in Matlab or another text editor such as Notepad).

  5. Ensure TDT tanks are inside a folder named tdtfiles in the folder from step 4.

  6. Create a folder named matfiles in the folder from step 4.

  7. Add the tdt-convert folder and the folder with myproject_convert.m (if different) to Matlab's path by clicking 'Set Path' in the Matlab command ribbon.

  8. Run myproject_convert.m by typing its name at the Matlab command prompt .

  9. Check log file (conversion_log.txt) in the matfiles folder to see if any files failed the conversion process.

More information and detailed instructions

Make metafile in Excel file

An example metafile is included in the tdt-convert folder named example_metafile.xlsx. For your project this Excel file should be located in your master folder.

The metafile must have the following columns (spelled exactly as below):

  • tdtfile – name of the TDT tank, not the entire path

  • rat – name or ID of the rat, e.g. PPP1-1

  • session – name of the session, could be s1, s2 etc or lick1, lick2 etc

  • include-mat – 0 or 1 depending on if a file is to be included or not

In addition, there should be two columns for with the names of the stored streamed signals from Synapse named 'sig-blue' and 'sig-uv' and columns for any TTLs that you need to extract from Synapse which should be start with the prefix 'ttl-', e.g. ttl-lick or ttl-sipper.

These values will differ for Box 1 and Box 2 and is how the conversion program knows which signals are matched up with each rat.

As many additional columns as you want can be included, for example, you may need these for further analysis using Python. These columns can be interspersed with the required columns as is shown on the example.

After the header is set up, data can be added to the columns. Entries for the sig- and ttl- columns need to correspond to the names for streamed signals and TTLs that Synapse uses.

Detail on the project-specific conversion script (e.g. myproject_covert.m)

This is the main Matlab script that you will run for each project and should be the only thing that needs creating/editing. There is an example version in the tdt-convert repository (named template_convert.m).

  • folder – This should be the master folder, often kept on the R drive, although it could be a local folder on a hard drive or USB stick. It should include the following subfolders:

  • tdtfiles – this folder is where you should put all the tanks that will be read and processed

  • matfiles – you need to create this empty folde, which is the location where the .mat filses that are produced will be saved.

  • skipfiles – default is 1, which will result in the script skipping over files that have already been converted

  • processfiles – this setting can be ignored at present.

  • xlfile – name of Excel file that contains metafile sheet. Needs to be in folder.

  • sheet – name of sheet in xlfile with metafile data.

For help with these scripts please contact Jaime McCutcheon (jem64@le.ac.uk).

About

Files for converting TDT files to Matlab and Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors