README.md 3.08 KB
Newer Older
dmattek's avatar
dmattek committed
1 2
# Time-course analysis web-app

dmattek's avatar
dmattek committed
3
## Running the app from the server
dmattek's avatar
dmattek committed
4
The app can be accessed here:
Maciej Dobrzynski's avatar
Maciej Dobrzynski committed
5
http://pertzlab.unibe.ch:3838/shiny-timecourse-inspector/ (UniBe VPN only!)
dmattek's avatar
dmattek committed
6

dmattek's avatar
dmattek committed
7
## Running the app locally
dmattek's avatar
dmattek committed
8 9 10 11 12 13 14 15 16
Alternatively, after downloading the code, the app can be run within RStudio. Open `server.R` or `ui.R` file, then click "Run App" button with green triangle in the upper right corner of the window with code open.

Following packages need to be installed in order to run the app locally:

* shiny
* shinyjs
* data.table
* ggplot2
* gplots
dmattek's avatar
dmattek committed
17
* scales
dmattek's avatar
dmattek committed
18 19 20 21 22
* plotly
* d3heatmap
* dendextend
* RColorBrewer
* sparcl
dmattek's avatar
dmattek committed
23 24
* imputeTS
* dtw
25 26 27 28
* DT
* MASS
* robust
* pracma
dmattek's avatar
dmattek committed
29 30 31

Install packages using `install.packages('name_of_the_package_from_the_list_above')` command in RStudio command line.

dmattek's avatar
dmattek committed
32 33
```
install.packages(c("shiny", "shinyjs", 
34
					"data.table", "DT",
dmattek's avatar
dmattek committed
35 36 37
					"ggplot2", "gplots", "plotly", "d3heatmap", "scales",
					"dendextend", "dendextend", "RColorBrewer",
					"sparcl", "dtw",
38 39
					"imputeTS",
					"MASS", "robust", "pracma")) 
dmattek's avatar
dmattek committed
40 41
```

Maciej Dobrzynski's avatar
Maciej Dobrzynski committed
42
**Note**
dmattek's avatar
dmattek committed
43
As of July 2018, *sparcl* has been removed from CRAN. If you don't need sparse hierarchical clustering, you can simply comment the line `library(sparcl)` in `server.R` file or install it from the [archive](https://cran.r-project.org/web/packages/sparcl/index.html):
Maciej Dobrzynski's avatar
Maciej Dobrzynski committed
44

dmattek's avatar
dmattek committed
45 46 47 48 49
```
install_url('https://cran.r-project.org/src/contrib/Archive/sparcl/sparcl_1.0.3.tar.gz')
```

**Additionally**, a time series analysis package needs to be installed from [GitHub](https://github.com/dmattek/tca-package):
50 51 52 53 54

```
install_github("dmattek/tca-package")
```

dmattek's avatar
dmattek committed
55
The `install_url` and `install_github` functions are available in *devtools* package:
56 57 58 59 60 61

```
install.packages("devtools")
library(devtools)
```

dmattek's avatar
dmattek committed
62 63
## Input file
The app recognises CSV (comma-separated values) files: data columns separated by a comma, floating point numbers using a dot (full-stop).
dmattek's avatar
dmattek committed
64 65 66 67

The data file has to be in a so called long format, where individual time-courses (tracks) are arranged one after another. Note a wide-format where individual tracks are arranged in neighbouring columns is NOT supported!

Sample few lines of the input file:
dmattek's avatar
dmattek committed
68 69 70 71 72 73
```
"Metadata_Series", "TrackObjects_Label", "Intensity_MeanIntensity_Ratio", "RealTime", "Stim_All_Ch", "Stim_All_S"
0, 2, 1149.00311105531, 0, "Ch01: FGF 250 ng/ml 60min pulse", "S00: FGF 250 ng/ml 60min pulse"
0, 3, 1160.43905280656, 0, "Ch01: FGF 250 ng/ml 60min pulse", "S00: FGF 250 ng/ml 60min pulse"
0, 4, 1303.06046656558, 0, "Ch01: FGF 250 ng/ml 60min pulse", "S00: FGF 250 ng/ml 60min pulse"
```
dmattek's avatar
dmattek committed
74 75 76 77 78 79 80 81 82

The first row should include column headers. Necessary columns include:

* Unique number of the field of view (FOV), here "Metadata_Series"
* Unique identifier of track ID within the FOV, here "TrackObjects_Label"
* Time point, here "RealTime"
* Measurement column (can be many columns), here "Intensity_MeanIntensity_Ratio"

Additionally, columns with condition names can be included. In the example above, "Stim_All_S" identifies condition per FOV, and "Stim_All_Ch" relates to a condition name within the well. These two columns are useful to group and plot time-courses in separate facets per FOV or per well.