vignettes/gRowthAnalysis.Rmd
gRowthAnalysis.Rmd
How to use:
code underneath is able to parse the tecan xml output into a rather simple csv file that can then be straightforwardly processed. This function is not so fast, and thus it is best to do this once at the beginning of an analysis, write to a csv, and work from the csv latter on.
The current concept starts with calculations per well, and only at the final point add the meta information (with a simple join). Summaries can easily be made using the summarize function from dplyr.
df.exp.time <- df.1 %>%
filter(variable == "ABS_600_600_NA") %>%
mutate(exp.time = map_dbl(data, ~calc.exp.time(., input_time = "time"))) %>%
ungroup() %>%
select(well, exp.time)
# join with the original table
df.exp <- df.1 %>%
left_join(df.exp.time)
# create dataframe with data only from exponential time
df.2 <- df.exp %>%
mutate(data.exp = map2(data, exp.time, ~.x %>% filter(time < .y)))
df.tmp <- df.2 %>% filter(variable == "ABS_600_600_NA") %>% ungroup()
df.tmp2 <- df.2 %>% filter (variable != "ABS_600_600_NA") %>% ungroup()
df.ratio <- df.tmp2 %>%
left_join(df.tmp %>% select(norm.data = data, well), by= c("well" = "well")) %>%
mutate(data = map2(data, `norm.data`, ~left_join(.x, .y, by = c("time" = "time"), suffix= c("", ".norm")))) %>%
select(-data.exp ) %>%
select(-norm.data) %>%
mutate(data.exp = map2(data, exp.time, ~.x %>% filter(time < .y)))
df.ratio.fit <- df.ratio %>%
mutate(lin.fit = map(data.exp, ~ratio.calc.individual(., x.signal = 'value.norm', y.signal='value')))
o <- ratio.extract.data(df.ratio.fit, "lin.fit")