A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cran.rstudio.com/web/packages/caTools/../GCalcium/vignettes/Examples.html below:

Working with Waveform Data using GCalcium

Working with Waveform Data using GCalcium 2019-03-04

Calcium indicator methods such as GCaMP produce massive amounts of data; in some cases producing hundreds-of-thousands of data points for a single subject. Further, there is currently no ubiquitous way to organize or analyze this type of data. To even analyze the data, the researcher must:

The GCalcium package gets researchers to the analysis phase more quickly by:

This document explains how to use GCalcium’s functions to format, extract, and manipulate calcium indicator data.

Data: GCaMP

The data included with the GCalcium provides a sample of a time series-like dataset exported from Matlab using the TDTFilter command with a modified version of Dr. David Root’s Matlab script. This data was collected using GCaMP6.

This dataset consists of 11 rows and 814 columns. 10 trials from a pilot study were used, with calcium activity from 4 seconds before and after stimulus onset (0s).

Data formatting

In order to use the rest of the package, data must be in a data frame format, with the requirements being:

  1. The first column is a measure of time

  2. The following columns are recorded values from trials in ascending order that correspond to the times the values were recorded at, with 1 column per trial

Fortunately, the GCalcium package includes functions that quickly reformat the data for ease with both user manipulation and use of this package. All formatting commands output this type of data frame.

Format organized data with format_data

Currently, the only command for formatting data is format_data, which takes a matrix of a time measurement in the first column or row, and one trial per column or row in the subsequent columns/rows. A data frame with the first row “Time” and subsequent rows “Trial#” is outputted.

GCaMP.form <- format_data(GCaMP)

### Old table
GCaMP[1:5, 1:5]
#>         [,1]    [,2]    [,3]    [,4]    [,5]
#> [1,] -3.9902 -3.9803 -3.9705 -3.9607 -3.9508
#> [2,] 82.6890 82.6560 82.6500 82.6710 82.7120
#> [3,] 82.8580 82.9220 82.9840 83.0420 83.0850
#> [4,] 81.7090 81.7020 81.7130 81.7260 81.7320
#> [5,] 89.7470 89.6370 89.5450 89.4760 89.4280

### New table
GCaMP.form[1:5, 1:5]
#>      Time Trial1 Trial2 Trial3 Trial4
#> 1 -3.9902 82.689 82.858 81.709 89.747
#> 2 -3.9803 82.656 82.922 81.702 89.637
#> 3 -3.9705 82.650 82.984 81.713 89.545
#> 4 -3.9607 82.671 83.042 81.726 89.476
#> 5 -3.9508 82.712 83.085 81.732 89.428

Note: the data frame used with the GCalcium package does not have to be labeled the same as the format_data frame. This is simply for ease of calling each trial using outside functions.

Transformations and filtering z_score

z_score transforms input values into z-scores. This also allows for a user-specified mean and standard deviation to compare distributions.

Let’s say we wanted to see how the variability of baseline and trial compare by using a mean and standard deviation from a baseline period before epoc.

Note that the return format is different from the base R ‘scale’ function, in that it does not create new attributes.

Plotting plot_trials

plot_trials uses the base R graphics to create a quick plot of the trial waves.

For example: we want to visualize the first 2 and last 2 trials

Note: this function automatically adjusts the x- and y- axes to fit all values. It also creates a legend for the corresponding trials.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4