-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cal_Inspect.R
58 lines (39 loc) · 1.5 KB
/
Cal_Inspect.R
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
## Script for exploration and visualization of calorimetry results ----
# Written by:
# Chelsea L Faber
# Mirzadeh Lab at Barrow Neurological Institute
# Use this script to visually inspect cleaned calorimety data prior to inputting
# into the automated plotting and statistical analysis pipeline
## Load required packages ----------------
library(plyr, include.only = 'mapvalues')
library(tidyverse)
library(lubridate)
## User-defined parameters -----------------
cohort <- "cal017"
rundate <- "2023-01-11"
fpath <- "C:/Users/cfaber/Dropbox (Barrow Neurological Institute)/Mirzadeh Lab Dropbox MAIN/Data/Calorimetry/macro_processed/r_cleaned"
## Load data -------------
fname <- paste(rundate,cohort,sep = "_")
# Prompt user which .Rda should be loaded if a Copy exists
if (file.exists(paste0(fpath,"/",fname,"_Clean.Rda"))
& file.exists(paste0(fpath,"/",fname,"_Clean_COPY.Rda"))) {
tmp <- menu(c("Original","Copy"),
title = "Two .Rda files found for this run. Which would you like to inspect?")
if (tmp == 1) {
f <- paste0(fpath,"/",fname,"_Clean.Rda")
} else if (tmp == 2) {
f <- paste0(fpath,"/",fname,"_Clean_COPY.Rda")
}
}
# Load Clean.Rda
load(f)
## Summary --------------------------
# Desired metrics:
# - count unique subjects
# - number within each Treatment, Diet, Group, Sex
# - whether any intervention, diet, or light schedule change occurred
# - length of recording
# -
## Quick time-series plots
## Identify outliers
##