-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
67 lines (51 loc) · 2.47 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
output:
md_document:
variant: markdown_github
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# fluoR
Calcium imaging methods produce massive datasets that require immense data manipulation, exploration, and summarizing. fluoR provides highly-accessible functions to address these issues for both inexperienced and seasoned R users to save researchers time. This package is catered to live-recorded fluorescence data, but works with any type of waveform data. A few functions include:
* `format_data` converts a data frame or matrix to a fluoR-friendly format
* `summarize_trials` calculates a summary statistic; collapsing across trials for each timestamp
* `inflect_points` finds inflection points by using derivatives
* `find_peaks` uses an algorithm to find peaks/valleys with n points increasing/decreasing on each side
* `z_score` calculates a standard or modified z-score without adding R object attributes
The Examples vignette explains these functions and more in greater detail. This can be viewed using `browseVignettes('fluoR')`.
There is also [a fluoR manual in Gitbook format](https://bookdown.org/anta8363/fluoR_bookdown/) that I will be regularly updating over the next few months.
## Installation
```{r, eval = FALSE}
### Install from Github
devtools::install_github('atamalu/fluoR', build_vignettes = TRUE)
```
```{r}
library(fluoR)
```
## Getting started
Since there is currently no ubiquitous way to analyze or format calcium imaging data, most of fluoR's commands require the data frame to be in "fluoR format." This is essentially a transposed time series data frame; where the times of recorded signals are in the first row or column, and the observed values of each trial are in the following rows or columns.
```{r, message = FALSE}
### Format data
df <- format_data(GCaMP)
```
```{r, message = FALSE}
### What does the median value of trials 1, 2, 3, and 4 look like?
head( summarize_trials(dataframe = df, trials = 1:4, summary.type = 'median') )
```
```{r, message = FALSE}
### Where are the inflection points (peaks/valleys) in trial 1?
head( inflect_points(x = df$Trial1) )
```
```{r, message = FALSE}
### Where are the peaks in trial 1 with at least 10 decreasing values on
head( find_peaks(xvals = df$Trial1, n.points = 10) )
```
```{r, message = FALSE}
### Transform raw input values into modified z-scores (using median & mad) for trial 1
head( z_score(xvals = df$Trial1, z.type = 'modified') )
```