knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(stringr)
library(googlesheets4)
inbox <- tibble(inbox = list.files("/home/niklas/bucket/inbox")) %>% 
  mutate(inbox_name = if_else(grepl(pattern = "^0000\\d+__\\d+-\\d\\d-\\d+T\\d+_\\d+_\\d+-Measurement_\\d$",
                                    perl = TRUE,
                                    x = inbox),
                              TRUE, FALSE)) %>% 
  filter(inbox != "README.txt") %>% 
  mutate(barcode = str_extract(pattern = "^\\d+", string = inbox) %>% as.numeric()) %>% 
  mutate(flatfield = if_else(inbox %in% list.files("/home/niklas/bucket/flatfield"), TRUE, FALSE))
options(httr_oob_default=TRUE)
cclf_ascites <- sheets_get("1o7kA5M8SZL0aYW8VzA4fLMG9lpVKohpeVD1De3KcPP0")

cclf_imaging <- cclf_ascites$spreadsheet_id %>%
    #ugly fix to use the spreadsheet id see https://github.com/tidyverse/googlesheets4/issues/74
    read_sheet(sheet = "imaging")
inbox %>% 
  full_join(cclf_imaging) %>%
  filter(!imaging_status %in% c("failed", "test")) %>% 
  filter(perturbation == TRUE) %>% 
  select(start_date, barcode, flatfield, inbox)



NiklasTR/dcp_helper documentation built on June 12, 2020, 10:22 p.m.