Step 1 : Save Input Parameters using Input Parameters GUI - LernerLab/GuPPy GitHub Wiki
a. In the individual analysis section of the GUI, navigate to the folder where your data is stored. The bar at the top indicates the current folder and any folders or files within that folder are displayed in the File Browser below. To navigate to a subfolder, click on the one you want to highlight it and then press the down arrow button to the right of the bar indicating the current folder. Once you are in the folder with your data, you can select a folder of data to analyze by moving it to the Selected Files column using the '>>' button. You can select one or more folders of data to analyze. To remove a folder from the selected files list, use the '<<' button.
Note :
- The folder you select should have either TDT files, csv files, Neurophotometrics or Doric system data files
- If you are using csv files, there is a specific file structure you need to create. Please look at the Sample data to see the structure of these files. Make sure the column names of the csv files are as shown in the Sample data, in lowercase. For each recording, you should have one csv file with your fiber photometry signal, one with your isosbestic control signal (if you're using it), and one or more with a list of behavioral timestamps for making PSTHs.
b. After identifying folders of data to analyze, there are a number of input paraments to specify based on what you would like to do. See below ('e') for an explanation of the different parameters you can set. Once you have selected your preferred options, save your Input Parameters file by clicking on the blue 'Save to file' button at the left hand side of the window.
c. After clicking 'Save to file', input parameters will be saved in all the folders you selected for the analysis which can be useful for future reference.
Note :
- All analysis steps can be performed without saving input parameters. Saving of input parameters is for the user's convenience so that you can refer to it in the future.
- removeArtifacts should be set to 'False' initially until you determine if there are artifacts requiring removal.
d. As shown in the screenshot, multiple recording sessions can be analyzed simultaneously if desired
Note: Selecting too many files at once may slow down processing speed. If the code is running slow try reducing the number of files you are trying to analyze at once, or increasing the cores used in the parameters settings (see below), checking that your computer has more cores to use.
e. Input Parameters Options Explanation:
Under Individual Analysis:
-
# of cores : Some of the modules in GuPPy use multiprocessing (meaning they try to use all the cores in your machine so that processing is faster). Do not set this number to more than the number of cores in your machine. You can see how many cores your computer has in System Information.
-
Combine Data? : Make this parameter True if you want to combine multiple files, for example when a recording was stopped and restarted mid-session.
-
Isosbestic Control Channel? : Make this parameter True if you want to use an isosbestic control channel in your analysis. Make this parameter False if you do not want to use or don't have a control channel.
-
Eliminate first few seconds : This parameter eliminates the first x seconds from the data. Default is 1 second.
-
Window for Moving Average filter (int) : GuPPy filters your data using a zero-phase moving average linear digital filter. You can adjust the window over which the moving filter is calculated. The default is 100 data points, which is usually appropriate for data recorded using a high sampling rate (~1000 Hz) like the data recorded by a TDT system.
Note :
- If the sampling rate is low, the user needs to change this window.
- Neurophotometrics data is typically sampled at ~20 Hz. In that case, we suggest using a window of 5-10 datapoints
-
Number of channels (Neurophotometrics only) : Neurophotometrics version 1 saves data in a csv file without "Flags" or "LedState". So, if you used an older Neurophotometrics system to record your data, you'll need to input the number of channels here since GuPPy cannot detect it automatically.
-
z_score and/or ΔF/F? (PSTH) : This parameter determines whether z-score, ΔF/F, or both will be used to generate peri-stimulus time histograms (PSTHs)
-
z_score and/or ΔF/F? (transients) : This parameter determines whether z-score, ΔF/F, or both will be used for transients detection
-
z-score plot and/or ΔF/F plot? : This parameter which determines whether data will be plotted as z-score, ΔF/F plot, or both during analysis
-
Moving Window for transients detection (int) : Transients in the z-score and/or ΔF/F are detected using this moving window. Default is 15 seconds. You may need to adjust this parameter for accurate peak detection depending on how frequent the transients in your data are.
-
High Amplitude filtering threshold (HAFT) (for transient detection) : For the transient detection function, GuPPy creates a baseline by filtering out high amplitude events, defined as events greater than x times the median absolute deviation (MAD) above the median. The median of the resulant trace is calculated and used in the next step of transient detection. Here, you can define x (the high amplitude filtering threshold). Default is 2.
-
Transients detection threshold (TD Thresh) : Peaks with local maxima greater than x times the MAD above the median of the baseline trace (calculated using the above HAFT) are detected as transients. Here, you can define x (the transients detection threshold). Default is 3.
-
removeArtifacts? : Make this parameter True if there are artifacts you would like to remove. This parameter should initially be set as False
-
removeArtifacts method : While doing artifacts removal, selecting "concatenate" will remove chunks selected by the user and concatenate the remaining of good chunks together. Selecting "replace with NaN" will replace chunks selected by the user with NaN values. Default is "concatenate".
Note :
- When using compute cross-correlation, please use remove artifacts method as "replace with NaN".
-
Z-score Parameters : GuPPy offers three different computational methods for calculating z-scores. The default is 'standard z-score' and we suggest leaving the default unless you have a specific reason to select another option ('baseline z-score' or 'modified z-score'). For a description of the options to help you decide, please see the 'Things to keep in mind' page of this Wiki.
-
PSTH Parameters :
- To plot peri-stimulus/event time histograms (PSTHs), set the window of time you would like to look at around each timestamp by entering the seconds before the timestamp to include (default is 10) and the seconds after (default is 20).
- The time interval parameter determines how far apart two timestamps must be to be counted (default is 2 seconds, so for example, if there are two timestamps that are only 1s apart in your data, only the first of these will be used in calculation of the PSTH if the time interval is set to 2).
- Compute Cross-correlation set as True will do cross-correlation of behavior event PSTHs between signals collected from different brain regions (DLS and DMS) or between different kind of signals (RCamp and GCamp).
- Bin PSTH trials give two options : Time (min) and # of Trials. If Time (min) is selected, time (integer value) should be inputted in the Time (min)/# of trials for binning? which will bin trials in the window of this time frame. If the parameter is changed to 10 mins, for example, GuPPy will make PSTHs averaging trials in 10 min bins of time. If # of Trials is selected, number (integer value) should be inputted in the Time (min)/# of trials for binning? which will bin trials by selecting those number of trials. If the parameter is changed to 10 trials, for example, GuPPy will make PSTHs averaging 10 trials like 0-10 trials, 10-20 trials, 20-30 trials ... so on. The PSTHs for these different bins can then be visualized in the Visualization step.)
-
Baseline Parameters : If values are entered here, GuPPy will do a baseline correction for each trial to be included in the PSTH, using the specified time window as the baseline period. The default is to use the 5s before the timestamp (-5s to 0s). The baseline time window must be within the PSTH time window selected above.
-
Peak and AUC Parameters : GuPPy can find peaks in the PSTH trace within 10 separate specified windows. For example, it is initially set to find the peak values from -5-0s, 0-3s, and 5-10s. GuPPy will also compute the area under the curve (AUC) for each of the specified windows entered here.
Under Group Analysis:
- Average Group? : Make this parameter True to find the average of multiple recording sessions. This parameter should be set to False until all your individual recording sessions have been analyzed. Come back to set it to True in Step 7: Group Analysis.
Under Visualization Parameters:
-
z-score or ΔF/F? (for visualization) : This parameter determines whether data will be plotted as z-score or ΔF/F during visualization (in Visualization GUI)
-
Visualize Average Results? : Make this parameter True to visualize the average analysis results, if averaging multiple recordings during Group Analysis (Leave it as False until Step 7).
Step 1 Video Reference: Explaining Input Parameters GUI tutorial video